On Thu, Sep 24, 2020 at 04:24:37PM +0200, Saheed O. Bolarinwa wrote: > pcie_get_aspm_reg() reads LNKCAP to learn whether the device supports > ASPM L0s and/or L1 and L1 substates. > > If we cache the entire LNKCAP word early enough, we may be able to > use it in other places that read LNKCAP, e.g. pcie_get_speed_cap(), > pcie_get_width_cap(), pcie_init(), etc. > > - Add struct pci_dev.lnkcap (u32) > - Read PCI_EXP_LNKCAP in set_pcie_port_type() and save it > in pci_dev.lnkcap > - Use pdev->lnkcap instead of reading PCI_EXP_LNKCAP I think we might as well go ahead and use the cached copy in these other places in this patch, i.e., pcie_init pcie_get_speed_cap pcie_get_width_cap pcie_link_bandwidth_notification_supported