Patchwork libata: fix spurious WARN_ON_ONCE() on port freeze

login
register
mail settings
Submitter Tejun Heo
Date Sept. 17, 2009, 9:45 a.m.
Message ID <4AB20537.4080903@kernel.org>
Download mbox | patch
Permalink /patch/33767/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - Sept. 17, 2009, 9:45 a.m.
Commit 54c38444fad6a99b4b19512f8f0055d69115e69e makes libata abort qcs
after the port is frozen.  This is necessary to guarantee that TF
registers are accessed after the DMA engine is shutdown after an
error.  However, this triggers WARN_ON_ONCE() check in
ata_qc_complete() spuriously.  Move WARN_ON_ONCE() downwards such that
failing commands while frozen doesn't trigger it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable <stable@kernel.org>
---
 drivers/ata/libata-core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Garzik - Sept. 17, 2009, 8:49 p.m.
On 09/17/2009 05:45 AM, Tejun Heo wrote:
> Commit 54c38444fad6a99b4b19512f8f0055d69115e69e makes libata abort qcs
> after the port is frozen.  This is necessary to guarantee that TF
> registers are accessed after the DMA engine is shutdown after an
> error.  However, this triggers WARN_ON_ONCE() check in
> ata_qc_complete() spuriously.  Move WARN_ON_ONCE() downwards such that
> failing commands while frozen doesn't trigger it.
>
> Signed-off-by: Tejun Heo<tj@kernel.org>
> Cc: stable<stable@kernel.org>
> ---
>   drivers/ata/libata-core.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

applied


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index df31dea..0ddaf43 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5024,8 +5024,6 @@  void ata_qc_complete(struct ata_queued_cmd *qc)
 		struct ata_device *dev = qc->dev;
 		struct ata_eh_info *ehi = &dev->link->eh_info;
 
-		WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);
-
 		if (unlikely(qc->err_mask))
 			qc->flags |= ATA_QCFLAG_FAILED;
 
@@ -5038,6 +5036,8 @@  void ata_qc_complete(struct ata_queued_cmd *qc)
 			}
 		}
 
+		WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);
+
 		/* read result TF if requested */
 		if (qc->flags & ATA_QCFLAG_RESULT_TF)
 			fill_result_tf(qc);