aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-01-14 12:04:25 -0500
committerJesse Barnes <jbarnes@hobbes.lan>2009-03-19 22:29:18 -0400
commit600914ba524130583fa5acdd00df4aa7aa44b173 (patch)
tree41278d33d5eaf7832f181fb1b9546875bc1f19a1
parenta1e4ee22863d41a6fbb24310d7951836cb6dafe7 (diff)
PCI/x86: make early dump handle multi-function devices
The early "dump PCI config space" code skips many multi-function devices. This patch fixes that, so it dumps all devices in PCI domain 0. We should not skip the rest of the functions if CLASS_REVISION is 0xffffffff. Often multi-function devices have gaps in the function ID space, e.g., 1c.0 and 1c.2 exist but 1c.1 doesn't. The CLASS_REVISION of the non-existent 1c.1 function will appear to be 0xffffffff. We should only look at the HEADER_TYPE of function zero. Often the "multi-function" is set in function zero, but not in other functions. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--arch/x86/pci/early.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/pci/early.c b/arch/x86/pci/early.c
index f6adf2c6d751..c1a2cd541724 100644
--- a/arch/x86/pci/early.c
+++ b/arch/x86/pci/early.c
@@ -96,18 +96,21 @@ void early_dump_pci_devices(void)
96 for (func = 0; func < 8; func++) { 96 for (func = 0; func < 8; func++) {
97 u32 class; 97 u32 class;
98 u8 type; 98 u8 type;
99
99 class = read_pci_config(bus, slot, func, 100 class = read_pci_config(bus, slot, func,
100 PCI_CLASS_REVISION); 101 PCI_CLASS_REVISION);
101 if (class == 0xffffffff) 102 if (class == 0xffffffff)
102 break; 103 continue;
103 104
104 early_dump_pci_device(bus, slot, func); 105 early_dump_pci_device(bus, slot, func);
105 106
106 /* No multi-function device? */ 107 if (func == 0) {
107 type = read_pci_config_byte(bus, slot, func, 108 type = read_pci_config_byte(bus, slot,
109 func,
108 PCI_HEADER_TYPE); 110 PCI_HEADER_TYPE);
109 if (!(type & 0x80)) 111 if (!(type & 0x80))
110 break; 112 break;
113 }
111 } 114 }
112 } 115 }
113 } 116 }