* [PATCH] pata_marvell: Cable and reset fixes
@ 2007-03-07 16:48 Alan Cox
2007-03-09 12:32 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2007-03-07 16:48 UTC (permalink / raw)
To: akpm, jgarzik, linux-ide
There are two changes here. Firstly we switch to a cable detect method,
secondly the old code forgot to call ata_std_prereset() but somehow
managed to work anyway. Fix the missing call.
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc2-mm2/drivers/ata/pata_marvell.c linux-2.6.21-rc2-mm2/drivers/ata/pata_marvell.c
--- linux.vanilla-2.6.21-rc2-mm2/drivers/ata/pata_marvell.c 2007-03-06 23:09:46.000000000 +0000
+++ linux-2.6.21-rc2-mm2/drivers/ata/pata_marvell.c 2007-03-06 23:35:28.000000000 +0000
@@ -20,7 +20,7 @@
#include <linux/ata.h>
#define DRV_NAME "pata_marvell"
-#define DRV_VERSION "0.1.1"
+#define DRV_VERSION "0.1.4"
/**
* marvell_pre_reset - check for 40/80 pin
@@ -52,22 +52,23 @@
if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
(!(devices & 0x10))) /* PATA enable ? */
return -ENOENT;
+ return ata_std_prereset(ap);
+}
+static int marvell_cable_detect(struct ata_port *ap)
+{
/* Cable type */
switch(ap->port_no)
{
case 0:
if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
- ap->cbl = ATA_CBL_PATA40;
- else
- ap->cbl = ATA_CBL_PATA80;
- break;
-
+ return ATA_CBL_PATA40;
+ return ATA_CBL_PATA80;
case 1: /* Legacy SATA port */
- ap->cbl = ATA_CBL_SATA;
- break;
+ return ATA_CBL_SATA;
}
- return ata_std_prereset(ap);
+ BUG();
+ return 0; /* Our BUG macro needs the right markup */
}
/**
@@ -123,6 +124,7 @@
.thaw = ata_bmdma_thaw,
.error_handler = marvell_error_handler,
.post_internal_cmd = ata_bmdma_post_internal_cmd,
+ .cable_detect = marvell_cable_detect,
/* BMDMA handling is PCI ATA format, use helpers */
.bmdma_setup = ata_bmdma_setup,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] pata_marvell: Cable and reset fixes
2007-03-07 16:48 [PATCH] pata_marvell: Cable and reset fixes Alan Cox
@ 2007-03-09 12:32 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-03-09 12:32 UTC (permalink / raw)
To: Alan Cox; +Cc: akpm, linux-ide
Alan Cox wrote:
> There are two changes here. Firstly we switch to a cable detect method,
> secondly the old code forgot to call ata_std_prereset() but somehow
> managed to work anyway. Fix the missing call.
>
> Signed-off-by: Alan Cox <alan@redhat.com>
applied (patch dated mar 07)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-09 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-07 16:48 [PATCH] pata_marvell: Cable and reset fixes Alan Cox
2007-03-09 12:32 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).