PCI: Use DWORD accesses for LTR, L1 SS to avoid erratum
authorRajat Jain <rajatja@google.com>
Wed, 22 Dec 2021 01:21:05 +0000 (17:21 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 11 Jan 2022 16:41:24 +0000 (10:41 -0600)
commit4353594eb0980c80e24ebb20d9c871ff95b3b789
tree797564c741987b5af3ea2956bb557c4c874e5b85
parent0cf948aab9a0049456d9a498af3da6b403e2a0ed
PCI: Use DWORD accesses for LTR, L1 SS to avoid erratum

Some devices have an erratum such that they only support DWORD accesses to
some registers.  E.g., this Bayhub O2 device ([VID:DID] = [0x1217:0x8621])
only supports DWORD accesses to LTR latency registers and L1 PM substates
control registers:

  https://github.com/rajatxjain/public_shared/blob/main/OZ711LV2_appnote.pdf

The L1 PM substate control registers are DWORD sized, and hence their
access in the kernel is already DWORD sized, so we don't need to do
anything for them.

However, the LTR registers being WORD sized, are in need of a solution.
Convert the WORD sized accesses to these registers into DWORD sized
accesses while saving and restoring them.

Link: https://lore.kernel.org/r/20211222012105.3438916-1-rajatja@google.com
Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c
drivers/pci/pcie/aspm.c