]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/VPD: Add pci_read/write_vpd_any()
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 10 Sep 2021 06:22:06 +0000 (08:22 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 11 Oct 2021 20:10:11 +0000 (15:10 -0500)
commit742e9d9fd55fe2995be7b3d912ec252b11dc92d2
tree249089b5b3d093cfcb4451949ddde23598223783
parentfa5d4460cfe6a4ab811a36d49fe44ccb61944b70
PCI/VPD: Add pci_read/write_vpd_any()

In certain cases we need a variant of pci_read_vpd()/pci_write_vpd() that
does not check against dev->vpd.len. Such cases are:

  - Reading VPD if dev->vpd.len isn't set yet (in pci_vpd_size())

  - Devices that map non-VPD information to arbitrary places in VPD address
    space (example: Chelsio T3 EEPROM write-protect flag)

Therefore add pci_read_vpd_any() and pci_write_vpd_any() that check against
PCI_VPD_MAX_SIZE only.

Link: https://lore.kernel.org/r/93ecce28-a158-f02a-d134-8afcaced8efe@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
drivers/pci/vpd.c
include/linux/pci.h