linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: fix spurious WARN_ON_ONCE() on port freeze
@ 2009-09-17  9:45 Tejun Heo
  2009-09-17 20:49 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2009-09-17  9:45 UTC (permalink / raw)
  To: Jeff Garzik, ide, stable

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

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-17 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17  9:45 [PATCH] libata: fix spurious WARN_ON_ONCE() on port freeze Tejun Heo
2009-09-17 20:49 ` 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).