From: Russell King <rmk@arm.linux.org.uk>
To: "David S. Miller" <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org, Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: [PATCH] Fix Promise UDMA33 IDE driver (pdc202xx_old)
Date: Sun, 3 Jan 2010 22:35:42 +0000 [thread overview]
Message-ID: <20100103223542.GA24920@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20100103002314.GA16528@flint.arm.linux.org.uk>
On Sun, Jan 03, 2010 at 12:23:14AM +0000, Russell King wrote:
> - with IDE
> - locks the interrupt line, and makes the machine extremely painful -
> about an hour to get to the point of being able to unload the
> pdc202xx_old module.
Having manually bisected kernel versions, I've narrowed it down to some
change between 2.6.30 and 2.6.31. There's not much which has changed
between the two kernels, but one change stands out like a sore thumb:
+static int pdc202xx_test_irq(ide_hwif_t *hwif)
+{
+ struct pci_dev *dev = to_pci_dev(hwif->dev);
+ unsigned long high_16 = pci_resource_start(dev, 4);
+ u8 sc1d = inb(high_16 + 0x1d);
+
+ if (hwif->channel) {
+ /*
+ * bit 7: error, bit 6: interrupting,
+ * bit 5: FIFO full, bit 4: FIFO empty
+ */
+ return ((sc1d & 0x50) == 0x40) ? 1 : 0;
+ } else {
+ /*
+ * bit 3: error, bit 2: interrupting,
+ * bit 1: FIFO full, bit 0: FIFO empty
+ */
+ return ((sc1d & 0x05) == 0x04) ? 1 : 0;
+ }
+}
Reading the (documented as a 32-bit) system control register when the
interface is idle gives: 0x01da110c
So, the byte at 0x1d is 0x11, which is documented as meaning that the
primary and secondary FIFOs are empty.
The code above, which is trying to see whether an IRQ is pending, checks
for the IRQ bit to be one, and the FIFO bit to be zero - or in English,
to be non-empty.
Since during a BM-DMA read, the FIFOs will naturally be drained to the
PCI bus, the chance of us getting to the interface before this happens
are extremely small - and if we don't, it means we decide not to service
the interrupt. Hence, the screaming interrupt problem with drivers/ide.
Fix this by only indicating an interrupt is ready if both the interrupt
and FIFO empty bits are at '1'.
This bug only affects PDC20246/PDC20247 (Promise Ultra33) based cards,
and has been tested on 2.6.31 and 2.6.33-rc2.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/ide/pdc202xx_old.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index cb812f3..f5c08f4 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -100,13 +100,13 @@ static int pdc202xx_test_irq(ide_hwif_t *hwif)
* bit 7: error, bit 6: interrupting,
* bit 5: FIFO full, bit 4: FIFO empty
*/
- return ((sc1d & 0x50) == 0x40) ? 1 : 0;
+ return ((sc1d & 0x50) == 0x50) ? 1 : 0;
} else {
/*
* bit 3: error, bit 2: interrupting,
* bit 1: FIFO full, bit 0: FIFO empty
*/
- return ((sc1d & 0x05) == 0x04) ? 1 : 0;
+ return ((sc1d & 0x05) == 0x05) ? 1 : 0;
}
}
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
next prev parent reply other threads:[~2010-01-03 22:35 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-24 18:13 2.6.32: Promise UDMA33 card refuses to work in UDMA mode Russell King
2009-12-24 21:54 ` Russell King
2010-01-03 0:23 ` Russell King
2010-01-03 3:08 ` Robert Hancock
2010-01-03 10:05 ` Russell King
2010-01-03 11:40 ` Alan Cox
2010-01-03 22:35 ` Russell King [this message]
2010-01-04 19:14 ` [PATCH] Fix Promise UDMA33 IDE driver (pdc202xx_old) Sergei Shtylyov
2010-01-05 6:26 ` David Miller
2010-01-05 17:49 ` Russell King
2010-01-05 17:52 ` Sergei Shtylyov
2010-01-03 23:46 ` 2.6.32: Promise UDMA33 card refuses to work in UDMA mode Russell King
2010-01-04 10:37 ` Alan Cox
2010-01-04 13:30 ` Russell King
2010-01-04 15:16 ` Alan Cox
2010-01-04 15:32 ` Jeff Garzik
2010-01-04 15:44 ` Russell King
2010-01-04 15:55 ` Alan Cox
2010-01-04 16:15 ` Russell King
2010-01-04 16:48 ` Jeff Garzik
2010-01-04 17:16 ` Sergei Shtylyov
2010-01-04 15:48 ` Alan Cox
2010-01-04 15:25 ` Jeff Garzik
2010-01-04 15:42 ` Russell King
2010-01-05 2:06 ` Robert Hancock
2010-01-05 11:25 ` Alan Cox
2010-01-05 13:00 ` Jeff Garzik
2010-01-05 13:37 ` Alan Cox
2010-01-05 13:11 ` Jeff Garzik
2010-01-04 15:46 ` Alan Cox
2010-01-04 16:32 ` Jeff Garzik
2010-01-04 17:02 ` Alan Cox
2010-01-04 17:27 ` Jeff Garzik
2010-01-04 17:30 ` Russell King
2010-01-04 18:03 ` Jeff Garzik
2010-01-04 18:06 ` Russell King
2010-01-04 18:35 ` Jeff Garzik
2010-01-04 17:38 ` Alan Cox
2010-01-04 18:07 ` Jeff Garzik
2010-01-04 18:29 ` Jeff Garzik
2010-01-04 16:31 ` Bartlomiej Zolnierkiewicz
2010-01-04 17:28 ` Russell King
2010-01-04 17:39 ` Alan Cox
2010-01-04 17:46 ` Russell King
2010-01-04 18:20 ` Alan Cox
2010-01-04 17:49 ` Bartlomiej Zolnierkiewicz
2010-01-05 1:03 ` Robert Hancock
2010-01-05 10:04 ` Jeff Garzik
2010-01-05 17:44 ` Russell King
2010-01-06 0:30 ` Robert Hancock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100103223542.GA24920@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=davem@davemloft.net \
--cc=linux-ide@vger.kernel.org \
--cc=sshtylyov@ru.mvista.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.