aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2005-08-16 02:25:38 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-23 01:03:38 -0400
commit3f3791d30036a367f05b9d0be28ce7ff2e017a5a (patch)
tree06bd36db635380e3ba5371b15c899b3b03c095a4 /drivers/scsi
parent443d089703ffa585aea1af47c68f1be5d0ec3115 (diff)
[PATCH] libata: Clear ATA_QCFLAG_ACTIVE flag before calling the completion callback
Description: After calling the completion callback, the libata error handler might be running and getting atapi sense data. Clearing the ATA_QCFLAG_ACTIVE flag at this point might interfere with the libata error handler. Changes: - Clear the ATA_QCFLAG_ACTIVE flag before calling the completion callback (and also before the error handler) - Add some comment Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libata-core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 3544f5d020c6..9a6aacf467b8 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -3213,9 +3213,14 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
3213 if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) 3213 if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
3214 ata_sg_clean(qc); 3214 ata_sg_clean(qc);
3215 3215
3216 /* atapi: mark qc as inactive to prevent the interrupt handler
3217 * from completing the command twice later, before the error handler
3218 * is called. (when rc != 0 and atapi request sense is needed)
3219 */
3220 qc->flags &= ~ATA_QCFLAG_ACTIVE;
3221
3216 /* call completion callback */ 3222 /* call completion callback */
3217 rc = qc->complete_fn(qc, drv_stat); 3223 rc = qc->complete_fn(qc, drv_stat);
3218 qc->flags &= ~ATA_QCFLAG_ACTIVE;
3219 3224
3220 /* if callback indicates not to complete command (non-zero), 3225 /* if callback indicates not to complete command (non-zero),
3221 * return immediately 3226 * return immediately