diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-05 02:58:32 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-05 02:58:32 -0400 |
commit | 67846b30171cc4d706125f630193a76a26bb334a (patch) | |
tree | 5ba70c2b68086f471686eb1e56e38436eaf73416 /drivers/scsi/ahci.c | |
parent | 643736a58d2668af94aee05670c5e9ae76e7b85f (diff) |
libata: add ata_ratelimit(), use it in AHCI driver irq handler
Diffstat (limited to 'drivers/scsi/ahci.c')
-rw-r--r-- | drivers/scsi/ahci.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index c2c8fa828e24..5ec866b00479 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -672,17 +672,36 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs * | |||
672 | 672 | ||
673 | for (i = 0; i < host_set->n_ports; i++) { | 673 | for (i = 0; i < host_set->n_ports; i++) { |
674 | struct ata_port *ap; | 674 | struct ata_port *ap; |
675 | u32 tmp; | ||
676 | 675 | ||
677 | VPRINTK("port %u\n", i); | 676 | if (!(irq_stat & (1 << i))) |
677 | continue; | ||
678 | |||
678 | ap = host_set->ports[i]; | 679 | ap = host_set->ports[i]; |
679 | tmp = irq_stat & (1 << i); | 680 | if (ap) { |
680 | if (tmp && ap) { | ||
681 | struct ata_queued_cmd *qc; | 681 | struct ata_queued_cmd *qc; |
682 | qc = ata_qc_from_tag(ap, ap->active_tag); | 682 | qc = ata_qc_from_tag(ap, ap->active_tag); |
683 | if (ahci_host_intr(ap, qc)) | 683 | if (!ahci_host_intr(ap, qc)) |
684 | irq_ack |= (1 << i); | 684 | if (ata_ratelimit()) { |
685 | struct pci_dev *pdev = | ||
686 | to_pci_dev(ap->host_set->dev); | ||
687 | printk(KERN_WARNING | ||
688 | "ahci(%s): unhandled interrupt on port %u\n", | ||
689 | pci_name(pdev), i); | ||
690 | } | ||
691 | |||
692 | VPRINTK("port %u\n", i); | ||
693 | } else { | ||
694 | VPRINTK("port %u (no irq)\n", i); | ||
695 | if (ata_ratelimit()) { | ||
696 | struct pci_dev *pdev = | ||
697 | to_pci_dev(ap->host_set->dev); | ||
698 | printk(KERN_WARNING | ||
699 | "ahci(%s): interrupt on disabled port %u\n", | ||
700 | pci_name(pdev), i); | ||
701 | } | ||
685 | } | 702 | } |
703 | |||
704 | irq_ack |= (1 << i); | ||
686 | } | 705 | } |
687 | 706 | ||
688 | if (irq_ack) { | 707 | if (irq_ack) { |