Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] Check for offline nodes in pci NUMA code

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>

authored by

Anton Blanchard and committed by
Paul Mackerras
284a9406 00ae36de

+8 -2
+8 -2
arch/powerpc/kernel/pci_64.c
··· 199 199 pci_setup_pci_controller(phb); 200 200 phb->arch_data = dev; 201 201 phb->is_dynamic = mem_init_done; 202 - if (dev) 203 - PHB_SET_NODE(phb, of_node_to_nid(dev)); 202 + if (dev) { 203 + int nid = of_node_to_nid(dev); 204 + 205 + if (nid < 0 || !node_online(nid)) 206 + nid = -1; 207 + 208 + PHB_SET_NODE(phb, nid); 209 + } 204 210 return phb; 205 211 } 206 212