android_kernel_xiaomi_sm8450/drivers/pci/pcie
Ilpo Järvinen 69795c689e PCI/ASPM: Use RMW accessors for changing LNKCTL
[ Upstream commit e09060b3b6b4661278ff8e1b7b81a37d5ea86eae ]

Don't assume that the device is fully under the control of ASPM and use RMW
capability accessors which do proper locking to avoid losing concurrent
updates to the register values.

If configuration fails in pcie_aspm_configure_common_clock(), the
function attempts to restore the old PCI_EXP_LNKCTL_CCC settings. Store
only the old PCI_EXP_LNKCTL_CCC bit for the relevant devices rather
than the content of the whole LNKCTL registers. It aligns better with
how pcie_lnkctl_clear_and_set() expects its parameter and makes the
code more obvious to understand.

Suggested-by: Lukas Wunner <lukas@wunner.de>
Fixes: 2a42d9dba7 ("PCIe: ASPM: Break out of endless loop waiting for PCI config bits to switch")
Fixes: 7d715a6c1a ("PCI: add PCI Express ASPM support")
Link: https://lore.kernel.org/r/20230717120503.15276-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:20:14 +02:00
..
aer_inject.c PCI: Replace http:// links with https:// 2020-06-30 13:05:09 -05:00
aer.c PCI/AER: Iterate over error counters instead of error strings 2022-08-21 15:16:19 +02:00
aspm.c PCI/ASPM: Use RMW accessors for changing LNKCTL 2023-09-19 12:20:14 +02:00
dpc.c PCI/DPC: Await readiness of secondary bus after reset 2023-03-22 13:30:06 +01:00
edr.c PCI/EDR: Clear Device Status after EDR error recovery 2023-05-17 11:47:57 +02:00
err.c PCI/ERR: Retain status from error notification 2022-08-25 11:38:23 +02:00
Kconfig PCI/LINK: Remove bandwidth notification 2021-03-17 17:06:24 +01:00
Makefile PCI/LINK: Remove bandwidth notification 2021-03-17 17:06:24 +01:00
pme.c PCI/PME: Fix kernel-doc of pcie_pme_resume() and pcie_pme_remove() 2020-05-21 15:04:45 -05:00
portdrv_core.c Revert "PCI/portdrv: Don't disable AER reporting in get_port_device_capability()" 2022-09-05 10:28:55 +02:00
portdrv_pci.c PCI/ERR: Simplify by computing pci_pcie_type() once 2022-08-21 15:16:18 +02:00
portdrv.h PCI/LINK: Remove bandwidth notification 2021-03-17 17:06:24 +01:00
ptm.c PCI/PTM: Inherit Switch Downstream Port PTM settings from Upstream Port 2020-05-21 15:53:07 -05:00