Add hotplug handling into ata_eh_analyze_serror() and ata_eh_revive() such that they schedule probe or detach if it seems appropriate. Signed-off-by: Tejun Heo <htejun@xxxxxxxxx> --- drivers/scsi/libata-eh.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) a335b73795061654e9dee96c2fc5f161e92780c7 diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c index 6a61c5c..443f81f 100644 --- a/drivers/scsi/libata-eh.c +++ b/drivers/scsi/libata-eh.c @@ -855,7 +855,8 @@ static unsigned int ata_eh_analyze_tf(st * @p_err_mask: Resulting err_mask * * Analyze SError if available and further determine cause of - * failure. + * failure. This function also schedules probing if PHY status + * has changed. * * LOCKING: * None. @@ -885,6 +886,11 @@ static unsigned int ata_eh_analyze_serro *p_err_mask |= AC_ERR_SYSTEM; action |= ATA_PORT_SOFTRESET; } + if (serror & (SERR_PHYRDY_CHG | SERR_DEV_XCHG)) { + *p_err_mask |= AC_ERR_ATA_BUS; + action |= ATA_PORT_SOFTRESET; + ata_schedule_probe(ap); + } return action; } @@ -1282,8 +1288,10 @@ int ata_eh_revive(struct ata_port *ap, u fail: switch (rc) { - case -EINVAL: case -ENODEV: + ata_schedule_probe(ap); + case -EINVAL: + ata_eh_detach_dev(ap, dev); tries[dev->devno] = 0; break; case -EIO: -- 1.2.4 - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html