summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorVidya Sagar <vidyas@nvidia.com>2026-09-09 22:19:08 +0530
committerThomas Gleixner <tglx@kernel.org>2026-10-16 00:18:40 +0200
commit2e2f69fc8ae2b280e1c5e01d876c17bc06dbe23f (patch)
tree70200b075672a2e520b915e4462222f0665cdb20 /kernel
parentd2fa415329c138117c870069ebeeb9ac67caf5ef (diff)
downloadlinux-2e2f69fc8ae2b280e1c5e01d876c17bc06dbe23f.tar.gz
linux-2e2f69fc8ae2b280e1c5e01d876c17bc06dbe23f.zip
PCI/MSI: Skip MSI/MSI-X programming while the channel is offline
The MSI-X Table lives in device MMIO space behind a BAR and the MSI Mask register in Configuration Space, so neither is reachable while the Link is down. While a Downstream Port has the Link contained by DPC it completes these accesses with Unsupported Request, and reads return all ones. If the upstream Root Port implements the RP Extensions for DPC, it additionally reports that UR completion as an RP PIO error and triggers a second containment event, this time at the Root Port, which contains every device below it. So a contained Link on one Downstream Port turns into a far wider outage that takes down unrelated devices. pci_free_irq_vectors() is called from driver error_detected() and prepare-for-reset callbacks, i.e. while the Link is contained and before the reset and the pci_restore_state() that follows it, and it masks every descriptor. Skip the programming when pci_channel_offline(), which also covers surprise removal. The msix_ctrl and msi_mask caches are still updated, so the restore paths replay the intended state once the Link is back up, and report_slot_reset() clears the offline state before the driver callback runs, so recovery is unaffected. pci_msix_write_tph_tag() flushes its Vector Control update with an unconditional read, so return -EIO there rather than issue it for a write that was skipped; the caller disables TPH in response. error_state is only set once containment has occurred, so this covers the case where the kernel knows the Link is down; it is not mutual exclusion against a containment event that begins concurrently. This does not attempt to make every Configuration Space access safe while the Link is contained. Signed-off-by: Vidya Sagar <vidyas@nvidia.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260909164908.2562818-1-vidyas@nvidia.com
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions