summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2020-10-12 12:55:56 -0700
committerFelix Singer <felixsinger@posteo.net>2022-09-29 17:03:23 +0000
commitbb83de61d14fb3130dd2615e96deee98ad2b04c4 (patch)
treefee5ffc2c8637b6952f5e1bfee81e485175b5223
parentcae8c739562b2756f71f2ae3cd317ac842f9fe36 (diff)
downloadflashrom-bb83de61d14fb3130dd2615e96deee98ad2b04c4.tar.gz
flashrom-bb83de61d14fb3130dd2615e96deee98ad2b04c4.tar.bz2
flashrom-bb83de61d14fb3130dd2615e96deee98ad2b04c4.zip
pcidev.c: populate IDs with pci_fill_info()
With pciutils 3.7.0, flashrom is unable to match any PCI devices by vendor/device ID because the vendor_id and device_id fields of struct pci_dev are not filled in. Call pci_fill_info() to request these identifiers before trying to match them against the supported device list. The pciutils ChangeLog for 3.7.0 mentions that the documentation and back-end behavior for pci_fill_info() was updated; it seems that a call to pci_fill_info() was always intended to be required, but some backends (such as the sysfs one used on Linux) would fill the identifier fields even when not requested by the user. The pci_fill_info() function and the PCI_FILL_IDENT flag have been available for all versions of pciutils since at least 2.0 from 1999, so it should be safe to add without any version checks. With this change, reading/writing a nicintel_spi boot ROM is successful. Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Change-Id: Ia011d4d801f8a54160e45a70b14b740e6dcc00ef Reviewed-on: https://review.coreboot.org/c/flashrom/+/46310 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67858 Reviewed-by: Felix Singer <felixsinger@posteo.net>
-rw-r--r--pcidev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pcidev.c b/pcidev.c
index f5ad819d1..b0fb487df 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -207,6 +207,7 @@ struct pci_dev *pcidev_init(const struct dev_entry *devs, int bar)
for (dev = pacc->devices; dev; dev = dev->next) {
if (pci_filter_match(&filter, dev)) {
+ pci_fill_info(dev, PCI_FILL_IDENT);
/* Check against list of supported devices. */
for (i = 0; devs[i].device_name != NULL; i++)
if ((dev->vendor_id == devs[i].vendor_id) &&