aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2007-11-14 20:35:46 -0500
committerTejun Heo <htejun@gmail.com>2007-11-18 22:28:11 -0500
commit2d3b8eea7f2fbafd5d779cc92f7aedbd1ef575e9 (patch)
tree292cd6197c457defc3e07d02a663cabb3dceb253 /drivers/ata
parent21bef6dd2b419f28c8096a8e30ad86dcbff44c02 (diff)
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: Albert Lee <albertcc@tw.ibm.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Mark Lord <liml@rtr.ca> Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1584164e7704..5478b4c6c6e9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5415,11 +5415,19 @@ fsm_start:
5415 * let the EH abort the command or reset the device. 5415 * let the EH abort the command or reset the device.
5416 */ 5416 */
5417 if (unlikely(status & (ATA_ERR | ATA_DF))) { 5417 if (unlikely(status & (ATA_ERR | ATA_DF))) {
5418 ata_port_printk(ap, KERN_WARNING, "DRQ=1 with device " 5418 /* Some ATAPI tape drives forget to clear the ERR bit
5419 "error, dev_stat 0x%X\n", status); 5419 * when doing the next command (mostly request sense).
5420 qc->err_mask |= AC_ERR_HSM; 5420 * We ignore ERR here to workaround and proceed sending
5421 ap->hsm_task_state = HSM_ST_ERR; 5421 * the CDB.
5422 goto fsm_start; 5422 */
5423 if (!(qc->dev->horkage & ATA_HORKAGE_STUCK_ERR)) {
5424 ata_port_printk(ap, KERN_WARNING,
5425 "DRQ=1 with device error, "
5426 "dev_stat 0x%X\n", status);
5427 qc->err_mask |= AC_ERR_HSM;
5428 ap->hsm_task_state = HSM_ST_ERR;
5429 goto fsm_start;
5430 }
5423 } 5431 }
5424 5432
5425 /* Send the CDB (atapi) or the first data block (ata pio out). 5433 /* Send the CDB (atapi) or the first data block (ata pio out).