Page MenuHomeFreeBSD

pci: Don't re-route legacy PCI on MSI/MSIX devs
Needs ReviewPublic

Authored by cperciva on Sat, Apr 12, 12:46 AM.

Details

Summary

There is a (very historical) call to pci_assign_interrupt for the
purpose of routing PCI IRQs. On INTRNG systems this can cause a
(synthetic) IRQ leak and ultimately a kernel panic after many
hotplug/unplug cycles.

Since this should only be necessary on legacy PCI, disable it for
devices which use MSI/MSIX.

MFC after: 2 weeks
Sponsored by: Amazon

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63472
Build 60356: arc lint + arc unit

Event Timeline

@jhb This avoids the IRQ leak on the EC2 instance I was having trouble with before. I think you suggested that this was only necessary for non-MSI/MSIX devices before I went down the (wrong) route of making it x86-only.

@jrtc27 @jhibbits Can you try this patch on your systems and let me know if it causes problems?

sys/dev/pci/pci.c
4178

The problem with this is that the driver might still choose to use INTx (or the admin might have disabled MSI via tunable, etc.) and since cfg->intline isn't invalid, we won't try to check it.

Maybe we need to encode this differently and only call pci_assign_interrupt() the first time pci_alloc_resource() tries to alloc the INTx interrupt. The IRQ in dmesg might still be wrong in this case though.