Skip to content

Commit

Permalink
pci: reduce the scope of pci-discovery-prepared phases
Browse files Browse the repository at this point in the history
PCI quirks might need DMI info, which isn't available before the CPU discovery on Linux.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Jun 16, 2022
1 parent 2e8feda commit aff51a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hwloc/topology.c
Expand Up @@ -3536,6 +3536,8 @@ hwloc_discover(struct hwloc_topology *topology,
/*
* Additional discovery
*/
hwloc_pci_discovery_prepare(topology);

if (topology->backend_phases & HWLOC_DISC_PHASE_PCI) {
dstatus->phase = HWLOC_DISC_PHASE_PCI;
hwloc_discover_by_phase(topology, dstatus, "PCI");
Expand All @@ -3553,6 +3555,8 @@ hwloc_discover(struct hwloc_topology *topology,
hwloc_discover_by_phase(topology, dstatus, "ANNOTATE");
}

hwloc_pci_discovery_exit(topology); /* pci needed up to annotate */

if (getenv("HWLOC_DEBUG_SORT_CHILDREN"))
hwloc_debug_sort_children(topology->levels[0][0]);

Expand Down Expand Up @@ -4085,15 +4089,11 @@ hwloc_topology_load (struct hwloc_topology *topology)
*/
hwloc_set_binding_hooks(topology);

hwloc_pci_discovery_prepare(topology);

/* actual topology discovery */
err = hwloc_discover(topology, &dstatus);
if (err < 0)
goto out;

hwloc_pci_discovery_exit(topology);

#ifndef HWLOC_DEBUG
if (getenv("HWLOC_DEBUG_CHECK"))
#endif
Expand Down

0 comments on commit aff51a9

Please sign in to comment.