* [PATCH] libata: Clear ATA_QCFLAG_ACTIVE flag before calling the completion callback
@ 2005-08-16 6:25 Albert Lee
2005-08-23 5:03 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Albert Lee @ 2005-08-16 6:25 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Linux IDE, Bartlomiej Zolnierkiewicz, Doug Maxey
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
Jeff,
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
Resend for 2.6.13-rc6(3edea4833a1efcd43e1dff082bc8001fdfe74b34).
For your review, thanks.
Albert
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
[-- Attachment #2: misc1.diff --]
[-- Type: text/plain, Size: 682 bytes --]
--- linux/drivers/scsi/libata-core.c 2005-08-16 10:54:12.000000000 +0800
+++ 01_qcactive/drivers/scsi/libata-core.c 2005-08-16 13:36:22.000000000 +0800
@@ -3086,9 +3086,14 @@
if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
ata_sg_clean(qc);
+ /* atapi: mark qc as inactive to prevent the interrupt handler
+ * from completing the command twice later, before the error handler
+ * is called. (when rc != 0 and atapi request sense is needed)
+ */
+ qc->flags &= ~ATA_QCFLAG_ACTIVE;
+
/* call completion callback */
rc = qc->complete_fn(qc, drv_stat);
- qc->flags &= ~ATA_QCFLAG_ACTIVE;
/* if callback indicates not to complete command (non-zero),
* return immediately
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libata: Clear ATA_QCFLAG_ACTIVE flag before calling the completion callback
2005-08-16 6:25 [PATCH] libata: Clear ATA_QCFLAG_ACTIVE flag before calling the completion callback Albert Lee
@ 2005-08-23 5:03 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2005-08-23 5:03 UTC (permalink / raw)
To: Albert Lee; +Cc: Linux IDE, Bartlomiej Zolnierkiewicz, Doug Maxey
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-23 5:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-16 6:25 [PATCH] libata: Clear ATA_QCFLAG_ACTIVE flag before calling the completion callback Albert Lee
2005-08-23 5:03 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).