diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8ee56e5..5424a59 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5251,9 +5251,13 @@ fsm_start: if (likely(status & (ATA_ERR | ATA_DF))) /* device stops HSM for abort/error */ qc->err_mask |= AC_ERR_DEV; - else + else { /* HSM violation. Let EH handle this */ + ata_dev_printk(qc->dev, KERN_WARNING, + "HSM violation: HSM_ST_FIRST: " + "!DRQ && !ERR && !DF\n"); qc->err_mask |= AC_ERR_HSM; + } ap->hsm_task_state = HSM_ST_ERR; goto fsm_start; @@ -5344,13 +5348,17 @@ fsm_start: if (likely(status & (ATA_ERR | ATA_DF))) /* device stops HSM for abort/error */ qc->err_mask |= AC_ERR_DEV; - else + else { /* HSM violation. Let EH handle this. * Phantom devices also trigger this * condition. Mark hint. */ + ata_dev_printk(qc->dev, KERN_WARNING, + "HSM violation: HSM_ST: " + "!DRQ && !ERR && !DF\n"); qc->err_mask |= AC_ERR_HSM | AC_ERR_NODEV_HINT; + } ap->hsm_task_state = HSM_ST_ERR; goto fsm_start; @@ -5375,8 +5383,12 @@ fsm_start: status = ata_wait_idle(ap); } - if (status & (ATA_BUSY | ATA_DRQ)) + if (status & (ATA_BUSY | ATA_DRQ)) { + ata_dev_printk(qc->dev, KERN_WARNING, + "HSM violation: HSM_ST: " + "ERR/DF w/ BUSY/DRQ\n"); qc->err_mask |= AC_ERR_HSM; + } /* ata_pio_sectors() might change the * state to HSM_ST_LAST. so, the state diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 496edaf..8caaa77 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1394,6 +1394,8 @@ static void ata_eh_analyze_serror(struct ata_link *link) action |= ATA_EH_SOFTRESET; } if (serror & SERR_PROTOCOL) { + ata_link_printk(link, KERN_WARNING, + "HSM violation: analyze_serror: SERR_PROTOCOL\n"); err_mask |= AC_ERR_HSM; action |= ATA_EH_SOFTRESET; } @@ -1504,6 +1506,8 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, u8 stat = tf->command, err = tf->feature; if ((stat & (ATA_BUSY | ATA_DRQ | ATA_DRDY)) != ATA_DRDY) { + ata_dev_printk(qc->dev, KERN_WARNING, + "HSM violation: eh_analyze_tf: BUSY|DRQ\n"); qc->err_mask |= AC_ERR_HSM; return ATA_EH_SOFTRESET; } diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h