]> 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)
commit03150a4d8ac66503406c44e9eebad1cdb540a9ca
treeb0cdf9e81d20a35bdbf3e1efb0e228c7dd28972b
parentb901123b83fca756ffcd85ea50a6cd9637d66d0c
PCI/VPD: Defer VPD sizing until first access

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