[Skiboot] [PATCH] pci: Fix PCI_DEVICE_ID()

Andrew Jeffery andrew at aj.id.au
Mon Jun 4 13:06:03 AEST 2018


The vendor ID is 16 bits not 8. This error leaves the top of the vendor
ID in the bottom bits of the device ID, which resulted in e.g. a failure
to run the PCI quirk for the AST VGA device.

Fixes: 2b841bf0ef1b ("core/pci: Use cached vendor/device IDs in quirks")
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
 include/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/pci.h b/include/pci.h
index 6141159f2fcc..253dbd8b1e9a 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -76,7 +76,7 @@ struct pci_device {
 	uint32_t		vdid;
 	uint32_t		sub_vdid;
 #define PCI_VENDOR_ID(x)	((x) & 0xFFFF)
-#define PCI_DEVICE_ID(x)	((x) >> 8)
+#define PCI_DEVICE_ID(x)	((x) >> 16)
 	uint32_t		class;
 	uint64_t		cap_list;
 	struct {
-- 
2.17.0



More information about the Skiboot mailing list