linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: Fix failed assertion in ata_qc_complete()
@ 2005-06-30  9:56 Albert Lee
  2005-07-05  6:26 ` Albert Lee
  0 siblings, 1 reply; 2+ messages in thread
From: Albert Lee @ 2005-06-30  9:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux IDE

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

Hi Jeff,

(This is the patch #4 in the summary.)
Problem:
    'assert(qc->flags & ATA_QCFLAG_ACTIVE)' assertion failed in ata_pio_complete().

Root cause:
  Please see the detailed dmesg log in the follow-up mail.

Change:
- Reorder the clearing of the 'qc->flags &= ~ATA_QCFLAG_ACTIVE' flag to
   be _before_ 'qc->complete_fn(qc, drv_stat)' instead of _after_.
- Add a comment per Tejun's advice.

Attached please find the patch against the linux-2.6.git tree
(HEAD 9b4311eedb17fa88f02e4876cd6aa9a08e383cd6) for your review. Thanks.

Albert

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>


[-- Attachment #2: patch.diff --]
[-- Type: text/plain, Size: 625 bytes --]

--- linux/drivers/scsi/libata-core.c.ori	2005-06-30 17:16:28.000000000 +0800
+++ linux/drivers/scsi/libata-core.c	2005-06-30 17:35:50.000000000 +0800
@@ -3086,9 +3086,14 @@
 	if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
 		ata_sg_clean(qc);
 
+	/* atapi: inactivate qc to prevent the interrupt handler from 
+	 * completing the command twice, before the scsi error handler
+	 * is called.
+	 */
+	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

end of thread, other threads:[~2005-07-05  6:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-30  9:56 [PATCH] libata: Fix failed assertion in ata_qc_complete() Albert Lee
2005-07-05  6:26 ` Albert Lee

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).