PCI: Cache PCIe Device Capabilities register
authorAmey Narkhede <ameynarkhede03@gmail.com>
Tue, 17 Aug 2021 18:04:52 +0000 (23:34 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 17 Aug 2021 20:21:35 +0000 (15:21 -0500)
commit69139244806537f9d51364f37fe146bb2ee88a05
tree6f2589dfbded45253d70ceb92a45723a2b119982
parente73f0f0ee7541171d89f2e2491130c7771ba58d3
PCI: Cache PCIe Device Capabilities register

Add a new member called devcap in struct pci_dev for caching the PCIe
Device Capabilities register to avoid reading PCI_EXP_DEVCAP multiple
times.

Refactor pcie_has_flr() to use cached device capabilities.

Link: https://lore.kernel.org/r/20210817180500.1253-2-ameynarkhede03@gmail.com
Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
drivers/pci/pci.c
drivers/pci/probe.c
include/linux/pci.h