lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Sep 2009 16:02:31 -0700
From:	"Jung-Ik (John) Lee" <jilee@...gle.com>
To:	sshtylyov@...mvista.com,
	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Cc:	Jeff Garzik <jgarzik@...ox.com>, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers

From: John(Jung-Ik) Lee <jilee@...gle.com>

Fix udma timings of pdc202xx_old controllers.
MB=1, MC=1 (0x20, 0x01) for all UDMA modes of pdc2026{57}.

Signed-off-by: John(Jung-Ik) Lee <jilee@...gle.com>
---

 drivers/ata/pata_pdc202xx_old.c |   15 +++------------
 drivers/ide/pdc202xx_old.c      |    8 +++++---
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 2f3c9be..ae76a9e 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -97,14 +97,6 @@ static void pdc202xx_set_dmamode(struct ata_port
*ap, struct ata_device *adev)
 {
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 	int port = 0x60 + 8 * ap->port_no + 4 * adev->devno;
-	static u8 udma_timing[6][2] = {
-		{ 0x60, 0x03 },	/* 33 Mhz Clock */
-		{ 0x40, 0x02 },
-		{ 0x20, 0x01 },
-		{ 0x40, 0x02 },	/* 66 Mhz Clock */
-		{ 0x20, 0x01 },
-		{ 0x20, 0x01 }
-	};
 	static u8 mdma_timing[3][2] = {
 		{ 0xe0, 0x0f },
 		{ 0x60, 0x04 },
@@ -119,10 +111,9 @@ static void pdc202xx_set_dmamode(struct ata_port
*ap, struct ata_device *adev)
 	r_cp &= ~0x0F;

 	if (adev->dma_mode >= XFER_UDMA_0) {
-		int speed = adev->dma_mode - XFER_UDMA_0;
-		r_bp |= udma_timing[speed][0];
-		r_cp |= udma_timing[speed][1];
-
+		/* MB=1, MC=1 for all UDMA modes of pdc2026{57} */
+		r_bp |= 0x20;
+		r_cp |= 0x01;
 	} else {
 		int speed = adev->dma_mode - XFER_MW_DMA_0;
 		r_bp |= mdma_timing[speed][0];
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index cb812f3..95c58dd 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -51,11 +51,13 @@ static void pdc202xx_set_mode(ide_drive_t *drive,
const u8 speed)

 	switch(speed) {
 		case XFER_UDMA_5:
-		case XFER_UDMA_4:	TB = 0x20; TC = 0x01; break;
-		case XFER_UDMA_2:	TB = 0x20; TC = 0x01; break;
+		case XFER_UDMA_4:
 		case XFER_UDMA_3:
-		case XFER_UDMA_1:	TB = 0x40; TC = 0x02; break;
+		case XFER_UDMA_2:
+		case XFER_UDMA_1:
 		case XFER_UDMA_0:
+		/* MB=1, MC=1 for all UDMA modes of pdc2026{57} */
+					TB = 0x20; TC = 0x01; break;
 		case XFER_MW_DMA_2:	TB = 0x60; TC = 0x03; break;
 		case XFER_MW_DMA_1:	TB = 0x60; TC = 0x04; break;
 		case XFER_MW_DMA_0:	TB = 0xE0; TC = 0x0F; break;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ