aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-01-09 05:19:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-09 14:54:22 -0500
commitefcb3cf7f00c3c424db012380a8a974c2676a3c8 (patch)
treeeaff0a3d6fed469629b81e8781ac80ca7c75eec1 /drivers/ata/libata-core.c
parent43529c97122f2c851126447963eedcb8cba74fbe (diff)
libata: use WARN_ON_ONCE on hot paths
Convert WARN_ON() on command issue/completion paths to WARN_ON_ONCE() so that libata doesn't spam the machine even when one of those conditions triggers repeatedly. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 175df54eb664..c507a9ac78f4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4556,7 +4556,7 @@ void ata_sg_clean(struct ata_queued_cmd *qc)
4556 struct scatterlist *sg = qc->sg; 4556 struct scatterlist *sg = qc->sg;
4557 int dir = qc->dma_dir; 4557 int dir = qc->dma_dir;
4558 4558
4559 WARN_ON(sg == NULL); 4559 WARN_ON_ONCE(sg == NULL);
4560 4560
4561 VPRINTK("unmapping %u sg elements\n", qc->n_elem); 4561 VPRINTK("unmapping %u sg elements\n", qc->n_elem);
4562 4562
@@ -4776,7 +4776,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
4776 struct ata_port *ap = qc->ap; 4776 struct ata_port *ap = qc->ap;
4777 unsigned int tag; 4777 unsigned int tag;
4778 4778
4779 WARN_ON(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4779 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */
4780 4780
4781 qc->flags = 0; 4781 qc->flags = 0;
4782 tag = qc->tag; 4782 tag = qc->tag;
@@ -4791,8 +4791,8 @@ void __ata_qc_complete(struct ata_queued_cmd *qc)
4791 struct ata_port *ap = qc->ap; 4791 struct ata_port *ap = qc->ap;
4792 struct ata_link *link = qc->dev->link; 4792 struct ata_link *link = qc->dev->link;
4793 4793
4794 WARN_ON(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4794 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */
4795 WARN_ON(!(qc->flags & ATA_QCFLAG_ACTIVE)); 4795 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
4796 4796
4797 if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) 4797 if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
4798 ata_sg_clean(qc); 4798 ata_sg_clean(qc);
@@ -4878,7 +4878,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
4878 struct ata_device *dev = qc->dev; 4878 struct ata_device *dev = qc->dev;
4879 struct ata_eh_info *ehi = &dev->link->eh_info; 4879 struct ata_eh_info *ehi = &dev->link->eh_info;
4880 4880
4881 WARN_ON(ap->pflags & ATA_PFLAG_FROZEN); 4881 WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);
4882 4882
4883 if (unlikely(qc->err_mask)) 4883 if (unlikely(qc->err_mask))
4884 qc->flags |= ATA_QCFLAG_FAILED; 4884 qc->flags |= ATA_QCFLAG_FAILED;
@@ -5000,16 +5000,16 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
5000 * check is skipped for old EH because it reuses active qc to 5000 * check is skipped for old EH because it reuses active qc to
5001 * request ATAPI sense. 5001 * request ATAPI sense.
5002 */ 5002 */
5003 WARN_ON(ap->ops->error_handler && ata_tag_valid(link->active_tag)); 5003 WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag));
5004 5004
5005 if (ata_is_ncq(prot)) { 5005 if (ata_is_ncq(prot)) {
5006 WARN_ON(link->sactive & (1 << qc->tag)); 5006 WARN_ON_ONCE(link->sactive & (1 << qc->tag));
5007 5007
5008 if (!link->sactive) 5008 if (!link->sactive)
5009 ap->nr_active_links++; 5009 ap->nr_active_links++;
5010 link->sactive |= 1 << qc->tag; 5010 link->sactive |= 1 << qc->tag;
5011 } else { 5011 } else {
5012 WARN_ON(link->sactive); 5012 WARN_ON_ONCE(link->sactive);
5013 5013
5014 ap->nr_active_links++; 5014 ap->nr_active_links++;
5015 link->active_tag = qc->tag; 5015 link->active_tag = qc->tag;