* [PATCH] pata_qdi: Fix initialisation
@ 2007-03-02 14:56 Alan Cox
2007-03-02 23:19 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2007-03-02 14:56 UTC (permalink / raw)
To: akpm, jgarzik, linux-ide, linux-kernel
The QDI init code contains some bugs which mean it only works if you have
a test setup that causes both a successful and failed probe. Fix this
Found by Philip Guo
(Who found it working on code analysis tools not running VLB IDE
controllers)
Signed-off-by: Alan Cox <alan@redhat.com>diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc2/drivers/ata/pata_qdi.c linux-2.6.21-rc2/drivers/ata/pata_qdi.c
--- linux.vanilla-2.6.21-rc2/drivers/ata/pata_qdi.c 2007-03-01 13:36:03.000000000 +0000
+++ linux-2.6.21-rc2/drivers/ata/pata_qdi.c 2007-03-02 13:20:27.000000000 +0000
@@ -363,7 +365,8 @@
release_region(port, 2);
continue;
}
- ct += qdi_init_one(port, 6500, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04);
+ if (qdi_init_one(port, 6500, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04) == 0)
+ ct++;
}
if (((r & 0xF0) == 0xA0) || (r & 0xF0) == 0x50) {
/* QD6580: dual channel */
@@ -375,11 +378,14 @@
res = inb(port + 3);
if (res & 1) {
/* Single channel mode */
- ct += qdi_init_one(port, 6580, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04);
+ if (qdi_init_one(port, 6580, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04))
+ ct++;
} else {
/* Dual channel mode */
- ct += qdi_init_one(port, 6580, 0x1F0, 14, r & 0x04);
- ct += qdi_init_one(port + 2, 6580, 0x170, 15, r & 0x04);
+ if (qdi_init_one(port, 6580, 0x1F0, 14, r & 0x04) == 0)
+ ct++;
+ if (qdi_init_one(port + 2, 6580, 0x170, 15, r & 0x04) == 0)
+ ct++;
}
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] pata_qdi: Fix initialisation
2007-03-02 14:56 [PATCH] pata_qdi: Fix initialisation Alan Cox
@ 2007-03-02 23:19 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-03-02 23:19 UTC (permalink / raw)
To: Alan Cox; +Cc: Andrew Morton, linux-ide, linux-kernel
Alan Cox wrote:
> The QDI init code contains some bugs which mean it only works if you have
> a test setup that causes both a successful and failed probe. Fix this
>
> Found by Philip Guo
>
> (Who found it working on code analysis tools not running VLB IDE
> controllers)
>
> Signed-off-by: Alan Cox <alan@redhat.com>diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc2/drivers/ata/pata_qdi.c linux-2.6.21-rc2/drivers/ata/pata_qdi.c
applied, though it appears your patch-sending script munched a few newlines
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-02 23:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-02 14:56 [PATCH] pata_qdi: Fix initialisation Alan Cox
2007-03-02 23:19 ` 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).