[PATCH] PCI/VPD: Silence warning if optional VPD PROM is missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Realtek RTL8169/8168/8125 NIC families indicate VPD capability and an
optional VPD EEPROM can be connected via I2C/SPI. However I haven't
seen any card or system with such a VPD EEPROM yet. The missing EEPROM
causes the following warning whenever e.g. lscpi -vv is executed.

invalid short VPD tag 00 at offset 01

The warning confuses users, I think we should handle the situation more
gentle. Therefore, if first VPD byte is read as 0x00, assume a missing
optional VPD PROM as and silently set the VPD length to 0.

Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx>
---
 drivers/pci/vpd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index ef5165eb3..bd174705f 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -89,6 +89,10 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)
 	       pci_read_vpd(dev, off, 1, header) == 1) {
 		unsigned char tag;
 
+		/* assume missing optional VPD PROM */
+		if (!header[0] && !off)
+			return 0;
+
 		if (header[0] & PCI_VPD_LRDT) {
 			/* Large Resource Data Type Tag */
 			tag = pci_vpd_lrdt_tag(header);
-- 
2.29.2




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux