Commit e0bf9e6b authored by Jian-Hong Pan's avatar Jian-Hong Pan Committed by max wang
Browse files

UPSTREAM: PCI/ASPM: Save parent L1SS config in pci_save_aspm_l1ss_state()

After 17423360 ("PCI/ASPM: Save L1 PM Substates Capability for
suspend/resume"), pci_save_aspm_l1ss_state(dev) saves the L1SS state for
"dev", and pci_restore_aspm_l1ss_state(dev) restores the state for both
"dev" and its parent.

The problem is that unless pci_save_state() has been used in some other
path and has already saved the parent L1SS state, we will restore junk to
the parent, which means the L1 Substates likely won't work correctly.

Save the L1SS config for both the device and its parent in
pci_save_aspm_l1ss_state().  When restoring, we need both because L1SS must
be enabled at the parent (the Downstream Port) before being enabled at the
child (the Upstream Port).

Bug: 367893204
Bug: 418925160
Bug: 419177102
Test: build with and without CONFIG_PCIEASPM
Test: lspci -vvv / check L1 substate capabilities
Link: https://lore.kernel.org/r/20241115072200.37509-3-jhp@endlessos.org
Fixes: 17423360 ("PCI/ASPM: Save L1 PM Substates Capability for suspend/resume")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218394


Suggested-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Change-Id: I2639abacd417088fb315e35b9af053d0733117b9
Signed-off-by: default avatarJian-Hong Pan <jhp@endlessos.org>
[bhelgaas: parallel save/restore structure, simplify commit log, patch at
https: //lore.kernel.org/r/20241212230340.GA3267194@bhelgaas]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Tested-by: Jian-Hong Pan <jhp@endlessos.org> # Asus B1400CEAE
(cherry picked from commit 1db806ec)
Signed-off-by: default avatarBrian Norris <briannorris@google.com>
(cherry picked from commit 866b883a)
Signed-off-by: default avatarMax Wang <max.wang@unisoc.com>
parent b926c9c2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment