summaryrefslogtreecommitdiff
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 22:47:20 +0900
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:23 -0400
commit305d2a1ab137d11d573319c315748a87060fe82d (patch)
tree8dcf81b1742db21c6a745688de96a18944c83617 /drivers/ata/libata-eh.c
parent5958e3025fd9d97429163e074d9cfa3848f51f28 (diff)
libata: unify mechanism to request follow-up SRST
Previously, there were two ways to trigger follow-up SRST from hardreset method - returning -EAGAIN and leaving all device classes unmodified. Drivers never used the latter mechanism and the only use case for the former was when hardreset couldn't classify. Drop the latter mechanism and let -EAGAIN mean "perform follow-up SRST if classification is required". This change removes unnecessary follow-up SRSTs and simplifies reset implementations. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index d8c4a45dcf26..4ec1397434c0 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2055,20 +2055,10 @@ static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset,
if (rc)
return rc;
- /* If any class isn't ATA_DEV_UNKNOWN, consider classification
- * is complete and convert all ATA_DEV_UNKNOWN to
- * ATA_DEV_NONE.
- */
+ /* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */
ata_link_for_each_dev(dev, link)
- if (classes[dev->devno] != ATA_DEV_UNKNOWN)
- break;
-
- if (dev) {
- ata_link_for_each_dev(dev, link) {
- if (classes[dev->devno] == ATA_DEV_UNKNOWN)
- classes[dev->devno] = ATA_DEV_NONE;
- }
- }
+ if (classes[dev->devno] == ATA_DEV_UNKNOWN)
+ classes[dev->devno] = ATA_DEV_NONE;
return 0;
}
@@ -2079,15 +2069,15 @@ static int ata_eh_followup_srst_needed(struct ata_link *link,
{
if (link->flags & ATA_LFLAG_NO_SRST)
return 0;
- if (rc == -EAGAIN)
- return 1;
+ if (rc == -EAGAIN) {
+ if (classify)
+ return 1;
+ rc = 0;
+ }
if (rc != 0)
return 0;
if ((link->ap->flags & ATA_FLAG_PMP) && ata_is_host_link(link))
return 1;
- if (classify && !(link->flags & ATA_LFLAG_ASSUME_CLASS) &&
- classes[0] == ATA_DEV_UNKNOWN)
- return 1;
return 0;
}