aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libata-core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 1669dae53ce3..86cd0e0895d0 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4083,8 +4083,6 @@ void ata_qc_free(struct ata_queued_cmd *qc)
4083 qc->flags = 0; 4083 qc->flags = 0;
4084 tag = qc->tag; 4084 tag = qc->tag;
4085 if (likely(ata_tag_valid(tag))) { 4085 if (likely(ata_tag_valid(tag))) {
4086 if (tag == ap->active_tag)
4087 ap->active_tag = ATA_TAG_POISON;
4088 qc->tag = ATA_TAG_POISON; 4086 qc->tag = ATA_TAG_POISON;
4089 clear_bit(tag, &ap->qactive); 4087 clear_bit(tag, &ap->qactive);
4090 } 4088 }
@@ -4098,6 +4096,9 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
4098 if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) 4096 if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
4099 ata_sg_clean(qc); 4097 ata_sg_clean(qc);
4100 4098
4099 /* command should be marked inactive atomically with qc completion */
4100 qc->ap->active_tag = ATA_TAG_POISON;
4101
4101 /* atapi: mark qc as inactive to prevent the interrupt handler 4102 /* atapi: mark qc as inactive to prevent the interrupt handler
4102 * from completing the command twice later, before the error handler 4103 * from completing the command twice later, before the error handler
4103 * is called. (when rc != 0 and atapi request sense is needed) 4104 * is called. (when rc != 0 and atapi request sense is needed)