[PATCH] pata_cs5536 Fix secondary port configuration

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Martin K. Petersen
Date: Tuesday, February 12, 2008 - 7:37 am

>>>>> "Gregor" == Gregor Radtke <mail@g-radtke.name> writes:


Gregor> hmm.. boots perfectly, of course somewhat slow.  dmesg output:

Brown paper bag time.  My devel board has a 16MB 1st generation
compact flash on the secondary so I never noticed this was hosed.
Please try the following patch...

-- 
Martin K. Petersen	Oracle Linux Engineering


Fix speed negotiation for slave device.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

---

diff -r 9f5ca67cc28f drivers/ata/pata_cs5536.c
--- a/drivers/ata/pata_cs5536.c	Mon Feb 11 20:52:01 2008 -0800
+++ b/drivers/ata/pata_cs5536.c	Tue Feb 12 08:52:43 2008 -0500
@@ -40,7 +40,7 @@
 #include <asm/msr.h>
 
 #define DRV_NAME	"pata_cs5536"
-#define DRV_VERSION	"0.0.6"
+#define DRV_VERSION	"0.0.7"
 
 enum {
 	CFG			= 0,
@@ -153,8 +153,8 @@ static void cs5536_set_piomode(struct at
 	struct ata_device *pair = ata_dev_pair(adev);
 	int mode = adev->pio_mode - XFER_PIO_0;
 	int cmdmode = mode;
-	int dshift = ap->port_no ? IDE_D1_SHIFT : IDE_D0_SHIFT;
-	int cshift = ap->port_no ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
+	int dshift = adev->devno ? IDE_D1_SHIFT : IDE_D0_SHIFT;
+	int cshift = adev->devno ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
 	u32 dtc, cast, etc;
 
 	if (pair)
@@ -201,7 +201,7 @@ static void cs5536_set_dmamode(struct at
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 	u32 dtc, etc;
 	int mode = adev->dma_mode;
-	int dshift = ap->port_no ? IDE_D1_SHIFT : IDE_D0_SHIFT;
+	int dshift = adev->devno ? IDE_D1_SHIFT : IDE_D0_SHIFT;
 
 	if (mode >= XFER_UDMA_0) {
 		cs5536_read(pdev, ETC, &etc);


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pata_cs5536 hangs on boot with hdd attached, Gregor Radtke, (Mon Feb 4, 2:00 pm)
Re: pata_cs5536 hangs on boot with hdd attached, Martin K. Petersen, (Mon Feb 4, 11:16 pm)
Re: pata_cs5536 hangs on boot with hdd attached, Gregor Radtke, (Sun Feb 10, 10:00 am)
[PATCH] pata_cs5536 Fix secondary port configuration, Martin K. Petersen, (Tue Feb 12, 7:37 am)
Re: [PATCH] pata_cs5536 Fix secondary port configuration, Gregor Radtke, (Tue Feb 12, 4:17 pm)
Re: [PATCH] pata_cs5536 Fix secondary port configuration, Martin K. Petersen, (Wed Feb 13, 12:12 am)