aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-03-04 01:59:30 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-03-05 07:25:43 -0500
commitd6515e6ff4ad3db4bd5ef2dd4e1026a7aca2482e (patch)
tree0c9e899b0c120483661964283807205048071ec8 /drivers/ata
parent55f784c826af2506e417bcc484d7e0e4d27f1977 (diff)
libata: make sure port is thawed when skipping resets
When SCR access is available and the link is offline, softreset is skipped as it only wastes time and some controllers don't respond very well. However, the skip path forgot to thaw the port, which not only blocks further event notification from the port but also causes repeated EH invocations on the same event on drivers which rely on ->thaw() to clear events if the IRQ is shared with another device or port. This problem has always been there but is uncovered by recent sata_nv nf2/3 change which dropped hardreset support while maintaining SCR access. nf2/3 doesn't clear hotplug event mask from the interrupt handler but relies on ->thaw() to clear them. When the hardreset was there, the reset action was never skipped and the port was always thawed but, with the hardreset gone, ->prereset() determines that there's no need for softreset and both ->softreset() and ->thaw() are skipped. This leads to stuck hotplug event in the IRQ status register triggering hotplug event whenever IRQ is delieverd on the same IRQ. As the controller shares the same IRQ for both ports, this happens on every IO if one port is occpupied and the other isn't. This patch fixes the problem by making sure that the port is thawed on reset-skip path. bko#11615 reports this problem. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Robert Hancock <hancockrwd@gmail.com> Reported-by: Dan Andresan <danyer@gmail.com> Reported-by: Arne Woerner <arne_woerner@yahoo.com> Reported-by: Stefan Lippers-Hollmann <s.L-H@gmx.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-eh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 009ccc7c9865..ea890911d4fa 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2423,11 +2423,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
2423 } 2423 }
2424 2424
2425 /* prereset() might have cleared ATA_EH_RESET. If so, 2425 /* prereset() might have cleared ATA_EH_RESET. If so,
2426 * bang classes and return. 2426 * bang classes, thaw and return.
2427 */ 2427 */
2428 if (reset && !(ehc->i.action & ATA_EH_RESET)) { 2428 if (reset && !(ehc->i.action & ATA_EH_RESET)) {
2429 ata_for_each_dev(dev, link, ALL) 2429 ata_for_each_dev(dev, link, ALL)
2430 classes[dev->devno] = ATA_DEV_NONE; 2430 classes[dev->devno] = ATA_DEV_NONE;
2431 if ((ap->pflags & ATA_PFLAG_FROZEN) &&
2432 ata_is_host_link(link))
2433 ata_eh_thaw_port(ap);
2431 rc = 0; 2434 rc = 0;
2432 goto out; 2435 goto out;
2433 } 2436 }