Re: PCI devices sharing IRQs

From: Clemens Ladisch
Date: Fri May 13 2011 - 04:05:37 EST


Simon Richter wrote:
> most of the PCI slots appear to map to the same IRQ, and I'm wondering
> if anything can be done about this.

The routing of PCI interrupts cannot be changed on any modern system.

PCI-Express devices are required to support message-signaled interrupts
(MSIs), which do not require separate hardware interrupt lines and are
never shared. So throw away those cheap Intel chips and use the good
Realtek one instead. ;-)

As for the RAID card, the arcmsr driver does not enable MSI.
I don't know if this an oversight in the driver or a hardware bug.
Please try the patch below.

(Nick, it looks as if there is an error path that doesn't free the
requested interrupt.)

> If there is anything I could try to change in order to give each card
> its own IRQ (especially pulling the RAID card and the Ethernet
> controller apart could possibly be worth something,

If these devices are on cards, you could try changing slots.

> as would handling IRQs on more than one core)

My AMD CPU automatically routes interrupts to an idle core ...


Regards,
Clemens

--8<---------------------------------------------------------------->8--
[SCSI] arcmsr: add MSI support

Try to enable MSI for Areca host adapters. It might actually work.

Signed-off-by: Clemens Ladisch <clemens@xxxxxxxxxx>

--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -692,7 +692,10 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if(error){
goto RAID_controller_stop;
}
+ pci_enable_msi(pdev);
- error = request_irq(pdev->irq, arcmsr_do_interrupt, IRQF_SHARED, "arcmsr", acb);
+ error = request_irq(pdev->irq, arcmsr_do_interrupt,
+ pci_dev_msi_enabled(pdev) ? 0 : IRQF_SHARED,
+ "arcmsr", acb);
if(error){
goto scsi_host_remove;
}
@@ -711,7 +714,9 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto out_free_sysfs;
return 0;
out_free_sysfs:
+ /* FIXME: free_irq */
scsi_host_remove:
+ pci_disable_msi(pdev);
scsi_remove_host(host);
RAID_controller_stop:
arcmsr_stop_adapter_bgrb(acb);
@@ -1050,6 +1055,7 @@ static void arcmsr_remove(struct pci_dev *pdev)
}
}
free_irq(pdev->irq, acb);
+ pci_disable_msi(pdev);
arcmsr_free_ccb_pool(acb);
arcmsr_free_hbb_mu(acb);
arcmsr_unmap_pciregion(acb);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/