aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-08 06:26:12 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-10 16:53:22 -0500
commit4ccd3329a2e51473a86547a55f9e5f98f8f65b33 (patch)
tree40ef0e858a162c29b8a56392365588333b6eeb1e /drivers/ata/libata-eh.c
parent2695e36616c3ece5e8e30666868fc7c90dc3fc75 (diff)
libata: don't normalize UNKNOWN to NONE after reset
After non-classifying reset, ehc->classes[] could contain ATA_DEV_UNKNOWN which used to be normalized to ATA_DEV_NONE for consistency. However, this causes unfortunate side effect for drivers which have non-classifying hardresets (e.g. sata_nv) by making hardreset report ATA_DEV_NONE for non-classifying resets and thus makes EH believe that the port is unoccupied and recovery can be skipped. The end result is that after a device is swapped with another one, the new device isn't attached after the old one is detached. This patch makes ata_eh_reset() not normalize UNKNOWN to NONE after non-classifying resets. This fixes the above problem. As UNKNOWN and NONE are handled differently by only EH hotplug logic, this doesn't cause other behavior changes. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 74269ed22fb9..21a81cd148e4 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2167,13 +2167,11 @@ int ata_eh_reset(struct ata_link *link, int classify,
2167 if (ata_link_offline(link)) 2167 if (ata_link_offline(link))
2168 continue; 2168 continue;
2169 2169
2170 /* apply class override and convert UNKNOWN to NONE */ 2170 /* apply class override */
2171 if (lflags & ATA_LFLAG_ASSUME_ATA) 2171 if (lflags & ATA_LFLAG_ASSUME_ATA)
2172 classes[dev->devno] = ATA_DEV_ATA; 2172 classes[dev->devno] = ATA_DEV_ATA;
2173 else if (lflags & ATA_LFLAG_ASSUME_SEMB) 2173 else if (lflags & ATA_LFLAG_ASSUME_SEMB)
2174 classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */ 2174 classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
2175 else if (classes[dev->devno] == ATA_DEV_UNKNOWN)
2176 classes[dev->devno] = ATA_DEV_NONE;
2177 } 2175 }
2178 2176
2179 /* record current link speed */ 2177 /* record current link speed */