linux/drivers/pci
Ilpo Järvinen 1331e908f2 PCI/ASPM: Fix L1SS saving
commit 7507eb3e7b upstream.

Commit 1db806ec06 ("PCI/ASPM: Save parent L1SS config in
pci_save_aspm_l1ss_state()") aimed to perform L1SS config save for both the
Upstream Port and its upstream bridge when handling an Upstream Port, which
matches what the L1SS restore side does. However, parent->state_saved can
be set true at an earlier time when the upstream bridge saved other parts
of its state. Then later when attempting to save the L1SS config while
handling the Upstream Port, parent->state_saved is true in
pci_save_aspm_l1ss_state() resulting in early return and skipping saving
bridge's L1SS config because it is assumed to be already saved. Later on
restore, junk is written into L1SS config which causes issues with some
devices.

Remove parent->state_saved check and unconditionally save L1SS config also
for the upstream bridge from an Upstream Port which ought to be harmless
from correctness point of view. With the Upstream Port check now present,
saving the L1SS config more than once for the bridge is no longer a problem
(unlike when the parent->state_saved check got introduced into the fix
during its development).

Link: https://lore.kernel.org/r/20250131152913.2507-1-ilpo.jarvinen@linux.intel.com
Fixes: 1db806ec06 ("PCI/ASPM: Save parent L1SS config in pci_save_aspm_l1ss_state()")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219731
Reported-by: Niklāvs Koļesņikovs <pinkflames.linux@gmail.com>
Reported by: Rafael J. Wysocki <rafael@kernel.org>
Closes: https://lore.kernel.org/r/CAJZ5v0iKmynOQ5vKSQbg1J_FmavwZE-nRONovOZ0mpMVauheWg@mail.gmail.com
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Closes: https://lore.kernel.org/r/d7246feb-4f3f-4d0c-bb64-89566b170671@molgen.mpg.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Niklāvs Koļesņikovs <pinkflames.linux@gmail.com>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de> # Dell XPS 13 9360
Cc: Brian Norris <briannorris@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-08-15 12:14:12 +02:00
..
controller PCI: rockchip-host: Fix "Unexpected Completion" log message 2025-08-15 12:13:49 +02:00
endpoint PCI: endpoint: pci-epf-vntb: Fix the incorrect usage of __iomem attribute 2025-08-15 12:13:56 +02:00
hotplug PCI: pnv_php: Fix surprise plug detection and recovery 2025-08-15 12:14:04 +02:00
msi PCI/MSI: Add an option to write MSIX ENTRY_DATA before any reads 2025-05-02 07:58:56 +02:00
pcie PCI/ASPM: Fix L1SS saving 2025-08-15 12:14:12 +02:00
pwrctl PCI/pwrctl: Abandon QCom WCN probe on pre-pwrseq device-trees 2024-10-23 13:34:41 -05:00
switch PCI: switchtec: Add Microchip PCI100X device IDs 2025-02-21 14:01:24 +01:00
access.c PCI: Revert the cfg_access_lock lockdep mechanism 2024-06-04 12:10:05 -05:00
ats.c iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability 2025-05-29 11:02:04 +02:00
bus.c pci-v6.11-changes 2024-07-19 19:03:18 -07:00
devres.c PCI: Fix wrong length of devres array 2025-04-20 10:15:58 +02:00
doe.c PCI/DOE: Support discovery version 2 2024-04-09 09:33:15 -05:00
ecam.c PCI: Dynamically map ECAM regions 2021-06-16 17:20:40 -05:00
host-bridge.c PCI: VMD: ACPI: Make ACPI companion lookup work for VMD bus 2021-09-02 17:59:58 +02:00
iomap.c PCI: Check BAR index for validity 2025-04-20 10:15:26 +02:00
iov.c PCI: Use resource names in PCI log messages 2023-12-15 17:28:42 -06:00
irq.c PCI: Place interrupt related code into irq.c 2024-01-29 17:01:31 -06:00
Kconfig x86/kaslr: Reduce KASLR entropy on most x86 systems 2025-05-29 11:02:40 +02:00
Makefile PCI/NPEM: Add Native PCIe Enclosure Management support 2024-09-04 17:25:12 -05:00
mmap.c PCI/sysfs: Compile pci-sysfs.c only if CONFIG_SYSFS=y 2024-03-05 16:08:43 -06:00
npem.c PCI/NPEM: Add _DSM PCIe SSD status LED management 2024-09-06 11:37:24 -05:00
of.c pci-v6.11-changes 2024-07-19 19:03:18 -07:00
of_property.c PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes 2024-12-09 10:41:09 +01:00
p2pdma.c PCI/P2PDMA: Fix a sleeping issue in a RCU read section 2024-02-08 15:31:43 -06:00
pci-acpi.c Revert "PCI/ACPI: Fix allocated memory release on error in pci_acpi_scan_root()" 2025-07-17 18:37:13 +02:00
pci-bridge-emul.c PCI: Rename CRS Completion Status to RRS 2024-09-10 19:52:30 -05:00
pci-bridge-emul.h PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-driver.c PCI: Make pci_bus_type constant 2024-08-23 12:46:22 -05:00
pci-label.c PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions 2021-06-03 22:14:47 -05:00
pci-mid.c PCI/PM: Switch to new Intel CPU model defines 2024-06-11 17:08:14 -05:00
pci-pf-stub.c PCI: Add missing MODULE_DESCRIPTION() macros 2024-07-08 08:35:35 +00:00
pci-stub.c PCI: Add missing MODULE_DESCRIPTION() macros 2024-07-08 08:35:35 +00:00
pci-sysfs.c PCI: Fix BAR resizing when VF BARs are assigned 2025-04-10 14:39:16 +02:00
pci.c PCI: Fix lock symmetry in pci_slot_unlock() 2025-06-27 11:11:25 +01:00
pci.h PCI: Check BAR index for validity 2025-04-20 10:15:26 +02:00
probe.c PCI: Fix reference leak in pci_register_host_bridge() 2025-04-20 10:15:58 +02:00
proc.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
quirks.c PCI: Add ACS quirk for Loongson PCIe 2025-06-27 11:11:25 +01:00
remove.c pci-v6.12-changes 2024-09-23 12:47:06 -07:00
rom.c PCI: Prefer 'unsigned int' over bare 'unsigned' 2021-10-27 13:41:22 -05:00
search.c PCI: Add pci_get_base_class() helper 2023-09-28 16:49:44 -05:00
setup-bus.c PCI: Fix old_size lower bound in calculate_iosize() too 2025-05-29 11:02:46 +02:00
setup-res.c PCI: Use resource names in PCI log messages 2023-12-15 17:28:42 -06:00
slot.c PCI: Fix use-after-free of slot->bus on hot remove 2024-12-05 14:02:45 +01:00
syscall.c PCI: Use consistent put_user() pointer types 2023-08-25 08:15:13 -05:00
vc.c PCI/VC: Use FIELD_GET() 2023-10-24 16:55:45 -05:00
vgaarb.c pci-v6.7-changes 2023-11-02 14:05:18 -10:00
vpd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
xen-pcifront.c x86: always initialize xen-swiotlb when xen-pcifront is enabling 2023-07-31 17:54:27 +02:00