Skip to content

Commit 284a940

Browse files
antonblanchardpaulusmack
authored andcommitted
[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>
1 parent 00ae36d commit 284a940

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/powerpc/kernel/pci_64.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,14 @@ struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
199199
pci_setup_pci_controller(phb);
200200
phb->arch_data = dev;
201201
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+
}
204210
return phb;
205211
}
206212

0 commit comments

Comments
 (0)