Commit 2d3b8eea authored by Albert Lee's avatar Albert Lee Committed by Tejun Heo

libata: workaround DRQ=1 ERR=1 for ATAPI tape drives

After an error condition, some ATAPI tape drives set DRQ=1 together
with ERR=1 when asking the host to transfer the CDB of the next packet
command (i.e. request sense).  This patch, a revised version of
Alan/Mark's previous patch, adds ATA_HORKAGE_STUCK_ERR to workaround
the problem by ignoring the ERR bit and proceed sending the CDB.
Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent 21bef6dd
...@@ -5415,11 +5415,19 @@ int ata_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, ...@@ -5415,11 +5415,19 @@ int ata_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
* let the EH abort the command or reset the device. * let the EH abort the command or reset the device.
*/ */
if (unlikely(status & (ATA_ERR | ATA_DF))) { if (unlikely(status & (ATA_ERR | ATA_DF))) {
ata_port_printk(ap, KERN_WARNING, "DRQ=1 with device " /* Some ATAPI tape drives forget to clear the ERR bit
"error, dev_stat 0x%X\n", status); * when doing the next command (mostly request sense).
qc->err_mask |= AC_ERR_HSM; * We ignore ERR here to workaround and proceed sending
ap->hsm_task_state = HSM_ST_ERR; * the CDB.
goto fsm_start; */
if (!(qc->dev->horkage & ATA_HORKAGE_STUCK_ERR)) {
ata_port_printk(ap, KERN_WARNING,
"DRQ=1 with device error, "
"dev_stat 0x%X\n", status);
qc->err_mask |= AC_ERR_HSM;
ap->hsm_task_state = HSM_ST_ERR;
goto fsm_start;
}
} }
/* Send the CDB (atapi) or the first data block (ata pio out). /* Send the CDB (atapi) or the first data block (ata pio out).
......
...@@ -340,6 +340,7 @@ enum { ...@@ -340,6 +340,7 @@ enum {
ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */ ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */
ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */ ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */
ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */
ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */
/* DMA mask for user DMA control: User visible values; DO NOT /* DMA mask for user DMA control: User visible values; DO NOT
renumber */ renumber */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment