diff options
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 39f556c02992..2bff9adcacf1 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1056,7 +1056,7 @@ static void ata_eh_analyze_serror(struct ata_port *ap) | |||
1056 | } | 1056 | } |
1057 | if (serror & SERR_INTERNAL) { | 1057 | if (serror & SERR_INTERNAL) { |
1058 | err_mask |= AC_ERR_SYSTEM; | 1058 | err_mask |= AC_ERR_SYSTEM; |
1059 | action |= ATA_EH_SOFTRESET; | 1059 | action |= ATA_EH_HARDRESET; |
1060 | } | 1060 | } |
1061 | if (serror & (SERR_PHYRDY_CHG | SERR_DEV_XCHG)) | 1061 | if (serror & (SERR_PHYRDY_CHG | SERR_DEV_XCHG)) |
1062 | ata_ehi_hotplugged(&ehc->i); | 1062 | ata_ehi_hotplugged(&ehc->i); |
@@ -1151,7 +1151,9 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, | |||
1151 | return ATA_EH_SOFTRESET; | 1151 | return ATA_EH_SOFTRESET; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | if (!(qc->err_mask & AC_ERR_DEV)) | 1154 | if (stat & (ATA_ERR | ATA_DF)) |
1155 | qc->err_mask |= AC_ERR_DEV; | ||
1156 | else | ||
1155 | return 0; | 1157 | return 0; |
1156 | 1158 | ||
1157 | switch (qc->dev->class) { | 1159 | switch (qc->dev->class) { |
@@ -1669,7 +1671,10 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1669 | reset == softreset ? "soft" : "hard"); | 1671 | reset == softreset ? "soft" : "hard"); |
1670 | 1672 | ||
1671 | /* mark that this EH session started with reset */ | 1673 | /* mark that this EH session started with reset */ |
1672 | ehc->i.flags |= ATA_EHI_DID_RESET; | 1674 | if (reset == hardreset) |
1675 | ehc->i.flags |= ATA_EHI_DID_HARDRESET; | ||
1676 | else | ||
1677 | ehc->i.flags |= ATA_EHI_DID_SOFTRESET; | ||
1673 | 1678 | ||
1674 | rc = ata_do_reset(ap, reset, classes); | 1679 | rc = ata_do_reset(ap, reset, classes); |
1675 | 1680 | ||
@@ -1808,6 +1813,10 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1808 | } | 1813 | } |
1809 | } | 1814 | } |
1810 | 1815 | ||
1816 | /* PDIAG- should have been released, ask cable type if post-reset */ | ||
1817 | if ((ehc->i.flags & ATA_EHI_DID_RESET) && ap->ops->cable_detect) | ||
1818 | ap->cbl = ap->ops->cable_detect(ap); | ||
1819 | |||
1811 | /* Configure new devices forward such that user doesn't see | 1820 | /* Configure new devices forward such that user doesn't see |
1812 | * device detection messages backwards. | 1821 | * device detection messages backwards. |
1813 | */ | 1822 | */ |