diff options
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4bbe31f98ef8..48519887f94a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -972,7 +972,7 @@ static void ata_dev_disable_pm(struct ata_device *dev) | |||
972 | void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy) | 972 | void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy) |
973 | { | 973 | { |
974 | ap->pm_policy = policy; | 974 | ap->pm_policy = policy; |
975 | ap->link.eh_info.action |= ATA_EHI_LPM; | 975 | ap->link.eh_info.action |= ATA_EH_LPM; |
976 | ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY; | 976 | ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY; |
977 | ata_port_schedule_eh(ap); | 977 | ata_port_schedule_eh(ap); |
978 | } | 978 | } |
@@ -1416,12 +1416,12 @@ static int ata_hpa_resize(struct ata_device *dev) | |||
1416 | /* read native max address */ | 1416 | /* read native max address */ |
1417 | rc = ata_read_native_max_address(dev, &native_sectors); | 1417 | rc = ata_read_native_max_address(dev, &native_sectors); |
1418 | if (rc) { | 1418 | if (rc) { |
1419 | /* If HPA isn't going to be unlocked, skip HPA | 1419 | /* If device aborted the command or HPA isn't going to |
1420 | * resizing from the next try. | 1420 | * be unlocked, skip HPA resizing. |
1421 | */ | 1421 | */ |
1422 | if (!ata_ignore_hpa) { | 1422 | if (rc == -EACCES || !ata_ignore_hpa) { |
1423 | ata_dev_printk(dev, KERN_WARNING, "HPA support seems " | 1423 | ata_dev_printk(dev, KERN_WARNING, "HPA support seems " |
1424 | "broken, will skip HPA handling\n"); | 1424 | "broken, skipping HPA handling\n"); |
1425 | dev->horkage |= ATA_HORKAGE_BROKEN_HPA; | 1425 | dev->horkage |= ATA_HORKAGE_BROKEN_HPA; |
1426 | 1426 | ||
1427 | /* we can continue if device aborted the command */ | 1427 | /* we can continue if device aborted the command */ |
@@ -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; |