diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2021-09-10 08:22:06 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-10-11 15:10:11 -0500 |
commit | bf2928c7a284e31f9f91a004b5dca09c522157c0 (patch) | |
tree | 249089b5b3d093cfcb4451949ddde23598223783 /include | |
parent | e4e737bb5c170df6135a127739a9e6148ee3da82 (diff) | |
download | linux-stable-bf2928c7a284e31f9f91a004b5dca09c522157c0.tar.gz linux-stable-bf2928c7a284e31f9f91a004b5dca09c522157c0.tar.bz2 linux-stable-bf2928c7a284e31f9f91a004b5dca09c522157c0.zip |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pci.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index cd8aa6fce204..9649bd9e468d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1350,6 +1350,8 @@ void pci_unlock_rescan_remove(void); /* Vital Product Data routines */ ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); +ssize_t pci_read_vpd_any(struct pci_dev *dev, loff_t pos, size_t count, void *buf); +ssize_t pci_write_vpd_any(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); |