]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitae14ae78b20055c5e888fc7028e6217c1f6258f3
treeb0cdf9e81d20a35bdbf3e1efb0e228c7dd28972b
parent4ce062870c70d404088bf50de34ea03772413b4e
PCI/VPD: Defer VPD sizing until first access

a188240cbcd0 ("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: a188240cbcd0 ("PCI/VPD: Determine VPD size in pci_vpd_init()")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/vpd.c