From 67954c8b6514859a0e115538200187f3a1ffd366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Tue, 28 Dec 2021 20:14:47 +0100 Subject: lspci: Build tree based on PCI_FILL_PARENT information Topology reported by system (libpci provider) may be different from topology built based on primary/secondary/subordinate numbers from PCI bridges by lspci. This happens for example when some non-compliant PCI-to-PCI bridge with Type 0 header (e.g. Marvell one) is available in the system. So add additional edges reported by libpci when building tree in lspci. --- lspci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lspci.c') diff --git a/lspci.c b/lspci.c index f52e792..b29580a 100644 --- a/lspci.c +++ b/lspci.c @@ -143,7 +143,7 @@ scan_device(struct pci_dev *p) d->config_cached += 64; } pci_setup_cache(p, d->config, d->config_cached); - pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_CLASS_EXT | PCI_FILL_SUBSYS); + pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_CLASS_EXT | PCI_FILL_SUBSYS | (need_topology ? PCI_FILL_PARENT : 0)); return d; } -- cgit v1.2.1