linux/arch/x86/pci
Yinghai Lu 871d5f8dd0 x86: get mp_bus_to_node early
Currently, on an amd k8 system with multi ht chains, the numa_node of
pci devices under /sys/devices/pci0000:80/* is always 0, even if that
chain is on node 1 or 2 or 3.

Workaround: pcibus_to_node(bus) is used when we want to get the node that
pci_device is on.

In struct device, we already have numa_node member, and we could use
dev_to_node()/set_dev_node() to get and set numa_node in the device.
set_dev_node is called in pci_device_add() with pcibus_to_node(bus),
and pcibus_to_node uses bus->sysdata for nodeid.

The problem is when pci_add_device is called, bus->sysdata is not assigned
correct nodeid yet. The result is that numa_node will always be 0.

pcibios_scan_root and pci_scan_root could take sysdata. So we need to get
mp_bus_to_node mapping before these two are called, and thus
get_mp_bus_to_node could get correct node for sysdata in root bus.

In scanning of the root bus, all child busses will take parent bus sysdata.
So all pci_device->dev.numa_node will be assigned correctly and automatically.

Later we could use dev_to_node(&pci_dev->dev) to get numa_node, and we
could also could make other bus specific device get the correct numa_node
too.

This is an updated version of pci_sysdata and Jeff's pci_domain patch.

[ mingo@elte.hu: build fix ]

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-04-26 23:41:04 +02:00
..
acpi.c x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
common.c x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
direct.c x86 pci: remove checking type for mmconfig probe 2008-04-26 23:41:04 +02:00
early.c
fixup.c x86_64: set cfg_size for AMD Family 10h in case MMCONFIG 2008-04-26 23:41:03 +02:00
i386.c PCI: x86: use generic pci_enable_resources() 2008-04-20 21:47:04 -07:00
init.c x86 pci: remove checking type for mmconfig probe 2008-04-26 23:41:04 +02:00
irq.c x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
k8-bus_64.c x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
legacy.c x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
Makefile x86_64: move pci 2007-10-11 11:17:12 +02:00
Makefile_32 x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
Makefile_64 x86_64: move pci 2007-10-11 11:17:12 +02:00
mmconfig_32.c x86: clear pci_mmcfg_virt when mmcfg get rejected 2008-04-26 23:41:03 +02:00
mmconfig_64.c x86: clear pci_mmcfg_virt when mmcfg get rejected 2008-04-26 23:41:03 +02:00
mmconfig-shared.c x86 pci: remove checking type for mmconfig probe 2008-04-26 23:41:04 +02:00
mp_bus_to_node.c x86: get mp_bus_to_node early 2008-04-26 23:41:04 +02:00
numa.c x86: remove mpc_oem_bus_info() 2008-04-17 17:41:08 +02:00
pcbios.c PCI: remove initial bios sort of PCI devices on x86 2008-04-20 21:46:58 -07:00
pci.h x86: clear pci_mmcfg_virt when mmcfg get rejected 2008-04-26 23:41:03 +02:00
visws.c Change pci_raw_ops to pci_raw_read/write 2008-02-10 12:52:46 -08:00