diff options
author | Andi Kleen <ak@suse.de> | 2005-08-22 21:14:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-23 22:59:39 -0400 |
commit | d3813fcf105814d06b47fa586f6b61f3cff1cefc (patch) | |
tree | 88cc854eac01d12063cfc6722c46e73e91a77efb /arch/x86_64 | |
parent | 2bbfb16bf345acd81ab1e6e3d4b35964650517ac (diff) |
[PATCH] x86_64: Don't oops at boot when empty Opteron node has IO
The code to detect IO links on Opteron would not check
if the node had actually memory. This could lead to pci_bus_to_node
returning an invalid node, which might cause crashes later
when dma_alloc_coherent passes it to page_alloc_node().
The bug has been there forever but for some reason
it is causing now crashes.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/pci/k8-bus.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c index c2c38b579939..d80c323669e0 100644 --- a/arch/x86_64/pci/k8-bus.c +++ b/arch/x86_64/pci/k8-bus.c | |||
@@ -47,13 +47,22 @@ fill_mp_bus_to_cpumask(void) | |||
47 | * if there are no busses hanging off of the current | 47 | * if there are no busses hanging off of the current |
48 | * ldt link then both the secondary and subordinate | 48 | * ldt link then both the secondary and subordinate |
49 | * bus number fields are set to 0. | 49 | * bus number fields are set to 0. |
50 | * | ||
51 | * RED-PEN | ||
52 | * This is slightly broken because it assumes | ||
53 | * HT node IDs == Linux node ids, which is not always | ||
54 | * true. However it is probably mostly true. | ||
50 | */ | 55 | */ |
51 | if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 | 56 | if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 |
52 | && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { | 57 | && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { |
53 | for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); | 58 | for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); |
54 | j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); | 59 | j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); |
55 | j++) | 60 | j++) { |
56 | pci_bus_to_node[j] = NODE_ID(nid); | 61 | int node = NODE_ID(nid); |
62 | if (!node_online(node)) | ||
63 | node = 0; | ||
64 | pci_bus_to_node[j] = node; | ||
65 | } | ||
57 | } | 66 | } |
58 | } | 67 | } |
59 | } | 68 | } |