OSDN Git Service

PCI/VPD: Defer VPD sizing until first access
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 13 Sep 2021 21:13:26 +0000 (16:13 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 15 Sep 2021 21:26:13 +0000 (16:26 -0500)
commit00e1a5d21b4ff514593554167b28a8caeda1497f
treeb0cdf9e81d20a35bdbf3e1efb0e228c7dd28972b
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
PCI/VPD: Defer VPD sizing until first access

7bac54497c3e ("PCI/VPD: Determine VPD size in pci_vpd_init()") reads VPD at
enumeration-time to find the size.  But this is quite slow, and we don't
need the size until we actually need data from VPD.  Dave reported a boot
slowdown of more than two minutes [1].

Defer the VPD sizing until a driver or the user (via sysfs) requests
information from VPD.

If devices are quirked because VPD is known not to work, don't bother even
looking for the VPD capability.  The VPD will not be accessible at all.

[1] https://lore.kernel.org/r/20210913141818.GA27911@codemonkey.org.uk/
Link: https://lore.kernel.org/r/20210914215543.GA1437800@bjorn-Precision-5520
Fixes: 7bac54497c3e ("PCI/VPD: Determine VPD size in pci_vpd_init()")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/vpd.c