Skip to content

Commit

Permalink
libata: fix spurious WARN_ON_ONCE() on port freeze
Browse files Browse the repository at this point in the history
Commit 54c3844 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>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Sep 17, 2009
1 parent 31b239a commit 4dc738e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 4dc738e

Please sign in to comment.