[PATCH v2] PCIUtils: fix inconsistent bus centric view between the sysfs and proc methods

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

 



The vendor and device IDs may be different when using sysfs and proc
methods with bus centric view enabled. The sysfs method reads the IDs
from the configuration space rather than uses the values from sysfs
entries. But the proc method always uses values from the proc files.
This fix makes the proc method use the values from the configuration
space too for bus centric view.

Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>

---
 lib/proc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/proc.c b/lib/proc.c
index bf877c4..e9ca24d 100644
--- a/lib/proc.c
+++ b/lib/proc.c
@@ -97,10 +97,10 @@ proc_scan(struct pci_access *a)
       d->func = PCI_FUNC(dfn & 0xff);
       d->vendor_id = vend >> 16U;
       d->device_id = vend & 0xffff;
-      known = PCI_FILL_IDENT;
+      known = 0;
       if (!a->buscentric)
 	{
-	  known |= PCI_FILL_IRQ | PCI_FILL_BASES;
+	  known |= PCI_FILL_IDENT | PCI_FILL_IRQ | PCI_FILL_BASES;
 	  if (cnt >= 10)
 	    known |= PCI_FILL_ROM_BASE;
 	  if (cnt >= 17)
-- 
1.5.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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