Skip to content

Commit

Permalink
[POWERPC] Check for offline nodes in pci NUMA code
Browse files Browse the repository at this point in the history
During boot we bring up all memory and cpu nodes. Normally a PCI device
will be in one of these online nodes, however in some weird setups it
may not.

We have only seen this in the lab but we may as well check for the case
and fallback to -1 (all nodes).

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Anton Blanchard authored and Paul Mackerras committed Oct 16, 2006
1 parent 00ae36d commit 284a940
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,14 @@ struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
pci_setup_pci_controller(phb);
phb->arch_data = dev;
phb->is_dynamic = mem_init_done;
if (dev)
PHB_SET_NODE(phb, of_node_to_nid(dev));
if (dev) {
int nid = of_node_to_nid(dev);

if (nid < 0 || !node_online(nid))
nid = -1;

PHB_SET_NODE(phb, nid);
}
return phb;
}

Expand Down

0 comments on commit 284a940

Please sign in to comment.