linux/drivers/pci/pcie
Alex Williamson 15d2aba7c6 PCI/portdrv: Use shared MSI/MSI-X vector for Bandwidth Management
The Interrupt Message Number in the PCIe Capabilities register (PCIe r4.0,
sec 7.5.3.2) indicates which MSI/MSI-X vector is shared by interrupts
related to the PCIe Capability, including Link Bandwidth Management and
Link Autonomous Bandwidth Interrupts (Link Control, 7.5.3.7), Command
Completed and Hot-Plug Interrupts (Slot Control, 7.5.3.10), and the PME
Interrupt (Root Control, 7.5.3.12).

pcie_message_numbers() checked whether we want to enable PME or Hot-Plug
interrupts but neglected to check for Link Bandwidth Management, so if we
only wanted the Bandwidth Management interrupts, it decided we didn't need
any vectors at all.  Then pcie_port_enable_irq_vec() tried to reallocate
zero vectors, which failed, resulting in fallback to INTx.

On some systems, e.g., an X79-based workstation, that INTx seems broken or
not handled correctly, so we got spurious IRQ16 interrupts for Bandwidth
Management events.

Change pcie_message_numbers() so that if we want Link Bandwidth Management
interrupts, we use the shared MSI/MSI-X vector from the PCIe Capabilities
register.

Fixes: e8303bb7a7 ("PCI/LINK: Report degraded links via link bandwidth notification")
Link: https://lore.kernel.org/lkml/155597243666.19387.1205950870601742062.stgit@gimli.home
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2019-05-01 15:34:01 -05:00
..
aer_inject.c PCI/AER: Refactor error injection fallbacks 2018-10-18 19:43:19 -05:00
aer.c PCI/AER: Use match_string() helper to simplify the code 2019-01-29 16:32:17 -06:00
aspm.c pci-v4.21-changes 2019-01-05 17:57:34 -08:00
bw_notification.c PCI/LINK: Deduplicate bandwidth reports for multi-function devices 2019-03-25 17:59:07 -05:00
dpc.c PCI/DPC: Fix print AER status in DPC event handling 2019-02-21 17:07:20 -06:00
err.c PCI/ERR: Remove duplicated include from err.c 2018-10-02 16:04:40 -05:00
Kconfig PCI: Update PCIEPORTBUS Kconfig help text 2019-03-06 15:00:09 -06:00
Makefile PCI/LINK: Report degraded links via link bandwidth notification 2019-03-05 15:04:13 -06:00
pme.c PCI/PME: Fix possible use-after-free on remove 2019-03-01 17:45:27 -06:00
portdrv_core.c PCI/portdrv: Use shared MSI/MSI-X vector for Bandwidth Management 2019-05-01 15:34:01 -05:00
portdrv_pci.c PCI/LINK: Report degraded links via link bandwidth notification 2019-03-05 15:04:13 -06:00
portdrv.h PCI/LINK: Report degraded links via link bandwidth notification 2019-03-05 15:04:13 -06:00
ptm.c Merge branch 'pci/spdx' into next 2018-02-01 11:40:07 -06:00