linux/drivers/pci/pcie
Håkon Bugge 4a0d8d3729 PCI/ACPI: Restrict program_hpx_type2() to AER bits
[ Upstream commit 9abf79c8d7 ]

Previously program_hpx_type2() applied PCIe settings unconditionally,
which could incorrectly change bits like Extended Tag Field Enable and
Enable Relaxed Ordering.

When _HPX was added to ACPI r3.0, the intent of the PCIe Setting
Record (Type 2) in sec 6.2.7.3 was to configure AER registers when the
OS does not own the AER Capability:

  The PCI Express setting record contains ... [the AER] Uncorrectable
  Error Mask, Uncorrectable Error Severity, Correctable Error Mask
  ... to be used when configuring registers in the Advanced Error
  Reporting Extended Capability Structure ...

  OSPM [1] will only evaluate _HPX with Setting Record – Type 2 if
  OSPM is not controlling the PCI Express Advanced Error Reporting
  capability.

ACPI r3.0b, sec 6.2.7.3, added more AER registers, including registers
in the PCIe Capability with AER-related bits, and the restriction that
the OS use this only when it owns PCIe native hotplug:

  ... when configuring PCI Express registers in the Advanced Error
  Reporting Extended Capability Structure *or PCI Express Capability
  Structure* ...

  An OS that has assumed ownership of native hot plug but does not
  ... have ownership of the AER register set must use ... the Type 2
  record to program the AER registers ...

  However, since the Type 2 record also includes register bits that
  have functions other than AER, the OS must ignore values ... that
  are not applicable.

Restrict program_hpx_type2() to only the intended purpose:

  - Apply settings only when OS owns PCIe native hotplug but not AER,

  - Only touch the AER-related bits (Error Reporting Enables) in Device
    Control

  - Don't touch Link Control at all, since nothing there seems AER-related,
    but log _HPX settings for debugging purposes

Note that Read Completion Boundary is now configured elsewhere, since it is
unrelated to _HPX.

[1] Operating System-directed configuration and Power Management

Fixes: 40abb96c51 ("[PATCH] pciehp: Fix programming hotplug parameters")
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260129175237.727059-3-haakon.bugge@oracle.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-02-26 14:59:19 -08:00
..
aer.c PCI/ACPI: Restrict program_hpx_type2() to AER bits 2026-02-26 14:59:19 -08:00
aer_inject.c PCI/AER: Use PCI_DEVID() macro in aer_inject() 2024-09-01 17:05:45 +00:00
aspm.c pci-v6.18-fixes-5 2025-11-14 15:45:31 -08:00
bwctrl.c PCI: Update Link Speed after retraining 2025-05-15 16:28:44 +00:00
dpc.c PCI/AER: Convert aer_get_device_error_info(), aer_print_error() to index 2025-05-23 11:11:36 -05:00
edr.c PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 2024-05-08 15:08:39 -05:00
err.c PCI/ERR: Update device error_state already after reset 2025-08-13 13:20:56 -05:00
Kconfig PCI/AER: Update aer-inject tool source URL 2024-04-17 10:35:43 -05:00
Makefile PCI: Move TLP Log handling to its own file 2025-01-14 17:38:18 -06:00
pme.c PCI/PME: Use FIELD_GET() 2023-10-24 16:55:45 -05:00
portdrv.c PCI/portdrv: Fix potential resource leak 2026-02-26 14:59:16 -08:00
portdrv.h PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller 2024-11-16 10:09:04 -06:00
ptm.c PCI/PTM: Fix pcie_ptm_create_debugfs() memory leak 2026-02-26 14:59:16 -08:00
rcec.c PCI/RCEC: Fix RCiEP device to RCEC association 2021-03-10 15:10:46 -06:00
tlp.c PCI/ERR: Add printk level to pcie_print_tlp_log() 2025-05-23 11:02:03 -05:00