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>
This commit is contained in:
committed by
Jesse Barnes
parent
a1e4ee2286
commit
600914ba52
@@ -96,15 +96,17 @@ void early_dump_pci_devices(void)
|
|||||||
for (func = 0; func < 8; func++) {
|
for (func = 0; func < 8; func++) {
|
||||||
u32 class;
|
u32 class;
|
||||||
u8 type;
|
u8 type;
|
||||||
|
|
||||||
class = read_pci_config(bus, slot, func,
|
class = read_pci_config(bus, slot, func,
|
||||||
PCI_CLASS_REVISION);
|
PCI_CLASS_REVISION);
|
||||||
if (class == 0xffffffff)
|
if (class == 0xffffffff)
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
early_dump_pci_device(bus, slot, func);
|
early_dump_pci_device(bus, slot, func);
|
||||||
|
|
||||||
/* No multi-function device? */
|
if (func == 0) {
|
||||||
type = read_pci_config_byte(bus, slot, func,
|
type = read_pci_config_byte(bus, slot,
|
||||||
|
func,
|
||||||
PCI_HEADER_TYPE);
|
PCI_HEADER_TYPE);
|
||||||
if (!(type & 0x80))
|
if (!(type & 0x80))
|
||||||
break;
|
break;
|
||||||
@@ -112,4 +114,5 @@ void early_dump_pci_devices(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user