OSDN Git Service

PCI/ASPM: Stop caching device L0s, L1 acceptable exit latencies
authorSaheed O. Bolarinwa <refactormyself@gmail.com>
Fri, 19 Nov 2021 19:37:31 +0000 (20:37 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 19 Nov 2021 22:46:21 +0000 (16:46 -0600)
commit6e332df7c380a7bc936275cba1ed356d9eb36b39
treec3fab1819bf94425c861ad6b62215ae38e033f4f
parent222578dad4731cb8932471f42a0a606116ec5398
PCI/ASPM: Stop caching device L0s, L1 acceptable exit latencies

Previously we calculated the device's acceptable L0s and L1 exit latencies
in pcie_aspm_cap_init() and cached them in struct pcie_link_state.

These values are only used in pcie_aspm_check_latency() where they are
compared with the actual exit latencies of the link.  This path is used
when removing or changing the D state of the device, so it's relatively low
frequency.

To reduce the amount of per-link data we store, remove the acceptable[]
arrays from struct pcie_link_state and calculate them directly from the
already-cached Device Capabilities register when needed.

[bhelgaas: use endpoint->devcap instead of reading it again]
Link: https://lore.kernel.org/r/20211119193732.12343-4-refactormyself@gmail.com
Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/aspm.c