Re: [PATCH] x86/PCI: initialize PCI bus node numbers early

From: Jesse Barnes
Date: Tue Sep 01 2009 - 18:29:26 EST


On Tue, 1 Sep 2009 15:53:58 +0200
Ingo Molnar <mingo@xxxxxxx> wrote:
> acccaba: x86/PCI: initialize PCI bus node numbers early
>
> caused a boot crash in -tip testing:
>
> calling amd_init+0x0/0x16 @ 1
> pata_amd 0000:00:06.0: version 0.4.1
> pata_amd 0000:00:06.0: setting latency timer to 64
> BUG: unable to handle kernel NULL pointer dereference at 00000e44

The 32 bit part looked a bit off, (unsigned char)-1 == 255. Could
definitely cause issues ("any node" is supposed to be a real -1).

Can you give this patch a try? (Note this code is a copy & paste of
the original AMD code, it could stand some cleanup.)

Thanks,
Jesse

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index eb6eb61..ffcb516 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -640,7 +640,7 @@ int get_mp_bus_to_node(int busnum)

#else /* CONFIG_X86_32 */

-static unsigned char mp_bus_to_node[BUS_NR] = {
+static int mp_bus_to_node[BUS_NR] = {
[0 ... BUS_NR - 1] = -1
};

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/