aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-core.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4bbe31f98ef..c9c52803d0c 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2092,24 +2092,34 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
2092 id, sizeof(id[0]) * ATA_ID_WORDS, 0); 2092 id, sizeof(id[0]) * ATA_ID_WORDS, 0);
2093 if (err_mask) { 2093 if (err_mask) {
2094 if (err_mask & AC_ERR_NODEV_HINT) { 2094 if (err_mask & AC_ERR_NODEV_HINT) {
2095 DPRINTK("ata%u.%d: NODEV after polling detection\n", 2095 ata_dev_printk(dev, KERN_DEBUG,
2096 ap->print_id, dev->devno); 2096 "NODEV after polling detection\n");
2097 return -ENOENT; 2097 return -ENOENT;
2098 } 2098 }
2099 2099
2100 /* Device or controller might have reported the wrong 2100 if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
2101 * device class. Give a shot at the other IDENTIFY if 2101 /* Device or controller might have reported
2102 * the current one is aborted by the device. 2102 * the wrong device class. Give a shot at the
2103 */ 2103 * other IDENTIFY if the current one is
2104 if (may_fallback && 2104 * aborted by the device.
2105 (err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { 2105 */
2106 may_fallback = 0; 2106 if (may_fallback) {
2107 may_fallback = 0;
2107 2108
2108 if (class == ATA_DEV_ATA) 2109 if (class == ATA_DEV_ATA)
2109 class = ATA_DEV_ATAPI; 2110 class = ATA_DEV_ATAPI;
2110 else 2111 else
2111 class = ATA_DEV_ATA; 2112 class = ATA_DEV_ATA;
2112 goto retry; 2113 goto retry;
2114 }
2115
2116 /* Control reaches here iff the device aborted
2117 * both flavors of IDENTIFYs which happens
2118 * sometimes with phantom devices.
2119 */
2120 ata_dev_printk(dev, KERN_DEBUG,
2121 "both IDENTIFYs aborted, assuming NODEV\n");
2122 return -ENOENT;
2113 } 2123 }
2114 2124
2115 rc = -EIO; 2125 rc = -EIO;