2011-05-12 13:29:34

by Simon Richter

[permalink] [raw]
Subject: PCI devices sharing IRQs

Hi,

As already written in another mail, I have trouble with IRQs on one
system. A slightly unrelated issue is that most of the PCI slots appear
to map to the same IRQ, and I'm wondering if anything can be done about
this.

There are no BIOS options dealing with IRQ routing, all I have to go by
right now is the kernel log, which I've attached. 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, as would handling IRQs on more than one core), I'd
be grateful for hints.

Simon


Attachments:
(No filename) (615.00 B)
dmesg (60.17 kB)
Download all attachments

2011-05-13 08:05:28

by Clemens Ladisch

[permalink] [raw]
Subject: Re: PCI devices sharing IRQs

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 <[email protected]>

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