linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Linux IDE <linux-ide@vger.kernel.org>
Subject: [PATCH] libata: Fix failed assertion in ata_qc_complete()
Date: Thu, 30 Jun 2005 17:56:16 +0800	[thread overview]
Message-ID: <42C3C1C0.2040501@tw.ibm.com> (raw)

[-- 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

             reply	other threads:[~2005-06-30  9:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30  9:56 Albert Lee [this message]
2005-07-05  6:26 ` [PATCH] libata: Fix failed assertion in ata_qc_complete() Albert Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42C3C1C0.2040501@tw.ibm.com \
    --to=albertcc@tw.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).