summaryrefslogtreecommitdiff
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-08-09 01:19:18 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-09 01:19:18 -0400
commit3f066887595de490c411762ce58a31412b09e939 (patch)
treea26e04a120ae71ae72910cbd85c52ceba40a3ffc /drivers/scsi/libata-scsi.c
parentf4b5cc874158a139c091b3decd468929e10645e6 (diff)
parent22aac0896b1b0b8cabaf00714c55dd12f25d5738 (diff)
Merge branch 'upstream-fixes' into upstream
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 37ec02661433..d168e3413661 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -2353,6 +2353,19 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
ata_gen_ata_desc_sense(qc);
}
+ /* SCSI EH automatically locks door if sdev->locked is
+ * set. Sometimes door lock request continues to
+ * fail, for example, when no media is present. This
+ * creates a loop - SCSI EH issues door lock which
+ * fails and gets invoked again to acquire sense data
+ * for the failed command.
+ *
+ * If door lock fails, always clear sdev->locked to
+ * avoid this infinite loop.
+ */
+ if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL)
+ qc->dev->sdev->locked = 0;
+
qc->scsicmd->result = SAM_STAT_CHECK_CONDITION;
qc->scsidone(cmd);
ata_qc_free(qc);