diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/hp/common/sba_iommu.c | 32 | ||||
-rw-r--r-- | arch/ia64/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 28 | ||||
-rw-r--r-- | arch/ia64/pci/fixup.c | 25 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 10 |
5 files changed, 35 insertions, 62 deletions
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 30c43d39dede..1a871b78e570 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -1140,11 +1140,13 @@ sba_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | |||
1140 | 1140 | ||
1141 | #ifdef CONFIG_NUMA | 1141 | #ifdef CONFIG_NUMA |
1142 | { | 1142 | { |
1143 | int node = ioc->node; | ||
1143 | struct page *page; | 1144 | struct page *page; |
1144 | page = alloc_pages_exact_node(ioc->node == MAX_NUMNODES ? | ||
1145 | numa_node_id() : ioc->node, flags, | ||
1146 | get_order(size)); | ||
1147 | 1145 | ||
1146 | if (node == NUMA_NO_NODE) | ||
1147 | node = numa_node_id(); | ||
1148 | |||
1149 | page = alloc_pages_exact_node(node, flags, get_order(size)); | ||
1148 | if (unlikely(!page)) | 1150 | if (unlikely(!page)) |
1149 | return NULL; | 1151 | return NULL; |
1150 | 1152 | ||
@@ -1914,7 +1916,7 @@ ioc_show(struct seq_file *s, void *v) | |||
1914 | seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n", | 1916 | seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n", |
1915 | ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF)); | 1917 | ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF)); |
1916 | #ifdef CONFIG_NUMA | 1918 | #ifdef CONFIG_NUMA |
1917 | if (ioc->node != MAX_NUMNODES) | 1919 | if (ioc->node != NUMA_NO_NODE) |
1918 | seq_printf(s, "NUMA node : %d\n", ioc->node); | 1920 | seq_printf(s, "NUMA node : %d\n", ioc->node); |
1919 | #endif | 1921 | #endif |
1920 | seq_printf(s, "IOVA size : %ld MB\n", ((ioc->pdir_size >> 3) * iovp_size)/(1024*1024)); | 1922 | seq_printf(s, "IOVA size : %ld MB\n", ((ioc->pdir_size >> 3) * iovp_size)/(1024*1024)); |
@@ -2015,31 +2017,19 @@ sba_connect_bus(struct pci_bus *bus) | |||
2015 | printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number); | 2017 | printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number); |
2016 | } | 2018 | } |
2017 | 2019 | ||
2018 | #ifdef CONFIG_NUMA | ||
2019 | static void __init | 2020 | static void __init |
2020 | sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) | 2021 | sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) |
2021 | { | 2022 | { |
2023 | #ifdef CONFIG_NUMA | ||
2022 | unsigned int node; | 2024 | unsigned int node; |
2023 | int pxm; | ||
2024 | |||
2025 | ioc->node = MAX_NUMNODES; | ||
2026 | |||
2027 | pxm = acpi_get_pxm(handle); | ||
2028 | |||
2029 | if (pxm < 0) | ||
2030 | return; | ||
2031 | |||
2032 | node = pxm_to_node(pxm); | ||
2033 | 2025 | ||
2034 | if (node >= MAX_NUMNODES || !node_online(node)) | 2026 | node = acpi_get_node(handle); |
2035 | return; | 2027 | if (node != NUMA_NO_NODE && !node_online(node)) |
2028 | node = NUMA_NO_NODE; | ||
2036 | 2029 | ||
2037 | ioc->node = node; | 2030 | ioc->node = node; |
2038 | return; | ||
2039 | } | ||
2040 | #else | ||
2041 | #define sba_map_ioc_to_node(ioc, handle) | ||
2042 | #endif | 2031 | #endif |
2032 | } | ||
2043 | 2033 | ||
2044 | static int | 2034 | static int |
2045 | acpi_sba_ioc_add(struct acpi_device *device, | 2035 | acpi_sba_ioc_add(struct acpi_device *device, |
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 71fbaaa495cc..7d41cc089822 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h | |||
@@ -98,7 +98,7 @@ struct pci_controller { | |||
98 | struct acpi_device *companion; | 98 | struct acpi_device *companion; |
99 | void *iommu; | 99 | void *iommu; |
100 | int segment; | 100 | int segment; |
101 | int node; /* nearest node with memory or -1 for global allocation */ | 101 | int node; /* nearest node with memory or NUMA_NO_NODE for global allocation */ |
102 | 102 | ||
103 | void *platform_data; | 103 | void *platform_data; |
104 | }; | 104 | }; |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 467497ade45f..0d407b300762 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -799,14 +799,9 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) | |||
799 | * ACPI based hotplug CPU support | 799 | * ACPI based hotplug CPU support |
800 | */ | 800 | */ |
801 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 801 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
802 | static | 802 | static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) |
803 | int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | ||
804 | { | 803 | { |
805 | #ifdef CONFIG_ACPI_NUMA | 804 | #ifdef CONFIG_ACPI_NUMA |
806 | int pxm_id; | ||
807 | int nid; | ||
808 | |||
809 | pxm_id = acpi_get_pxm(handle); | ||
810 | /* | 805 | /* |
811 | * We don't have cpu-only-node hotadd. But if the system equips | 806 | * We don't have cpu-only-node hotadd. But if the system equips |
812 | * SRAT table, pxm is already found and node is ready. | 807 | * SRAT table, pxm is already found and node is ready. |
@@ -814,11 +809,10 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | |||
814 | * This code here is for the system which doesn't have full SRAT | 809 | * This code here is for the system which doesn't have full SRAT |
815 | * table for possible cpus. | 810 | * table for possible cpus. |
816 | */ | 811 | */ |
817 | nid = acpi_map_pxm_to_node(pxm_id); | ||
818 | node_cpuid[cpu].phys_id = physid; | 812 | node_cpuid[cpu].phys_id = physid; |
819 | node_cpuid[cpu].nid = nid; | 813 | node_cpuid[cpu].nid = acpi_get_node(handle); |
820 | #endif | 814 | #endif |
821 | return (0); | 815 | return 0; |
822 | } | 816 | } |
823 | 817 | ||
824 | int additional_cpus __initdata = -1; | 818 | int additional_cpus __initdata = -1; |
@@ -925,7 +919,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth, | |||
925 | union acpi_object *obj; | 919 | union acpi_object *obj; |
926 | struct acpi_madt_io_sapic *iosapic; | 920 | struct acpi_madt_io_sapic *iosapic; |
927 | unsigned int gsi_base; | 921 | unsigned int gsi_base; |
928 | int pxm, node; | 922 | int node; |
929 | 923 | ||
930 | /* Only care about objects w/ a method that returns the MADT */ | 924 | /* Only care about objects w/ a method that returns the MADT */ |
931 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) | 925 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) |
@@ -952,17 +946,9 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth, | |||
952 | 946 | ||
953 | kfree(buffer.pointer); | 947 | kfree(buffer.pointer); |
954 | 948 | ||
955 | /* | 949 | /* OK, it's an IOSAPIC MADT entry; associate it with a node */ |
956 | * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell | 950 | node = acpi_get_node(handle); |
957 | * us which node to associate this with. | 951 | if (node == NUMA_NO_NODE || !node_online(node) || |
958 | */ | ||
959 | pxm = acpi_get_pxm(handle); | ||
960 | if (pxm < 0) | ||
961 | return AE_OK; | ||
962 | |||
963 | node = pxm_to_node(pxm); | ||
964 | |||
965 | if (node >= MAX_NUMNODES || !node_online(node) || | ||
966 | cpumask_empty(cpumask_of_node(node))) | 952 | cpumask_empty(cpumask_of_node(node))) |
967 | return AE_OK; | 953 | return AE_OK; |
968 | 954 | ||
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index 5dc969dd4ac0..eee069a0b539 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include <linux/pci.h> | 6 | #include <linux/pci.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/vgaarb.h> | ||
8 | 9 | ||
9 | #include <asm/machvec.h> | 10 | #include <asm/machvec.h> |
10 | 11 | ||
@@ -19,9 +20,10 @@ | |||
19 | * IORESOURCE_ROM_SHADOW is used to associate the boot video | 20 | * IORESOURCE_ROM_SHADOW is used to associate the boot video |
20 | * card with this copy. On laptops this copy has to be used since | 21 | * card with this copy. On laptops this copy has to be used since |
21 | * the main ROM may be compressed or combined with another image. | 22 | * the main ROM may be compressed or combined with another image. |
22 | * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW | 23 | * See pci_map_rom() for use of this flag. Before marking the device |
23 | * is marked here since the boot video device will be the only enabled | 24 | * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set |
24 | * video device at this point. | 25 | * by either arch cde or vga-arbitration, if so only apply the fixup to this |
26 | * already determined primary video card. | ||
25 | */ | 27 | */ |
26 | 28 | ||
27 | static void pci_fixup_video(struct pci_dev *pdev) | 29 | static void pci_fixup_video(struct pci_dev *pdev) |
@@ -35,9 +37,6 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
35 | return; | 37 | return; |
36 | /* Maybe, this machine supports legacy memory map. */ | 38 | /* Maybe, this machine supports legacy memory map. */ |
37 | 39 | ||
38 | if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) | ||
39 | return; | ||
40 | |||
41 | /* Is VGA routed to us? */ | 40 | /* Is VGA routed to us? */ |
42 | bus = pdev->bus; | 41 | bus = pdev->bus; |
43 | while (bus) { | 42 | while (bus) { |
@@ -60,10 +59,14 @@ static void pci_fixup_video(struct pci_dev *pdev) | |||
60 | } | 59 | } |
61 | bus = bus->parent; | 60 | bus = bus->parent; |
62 | } | 61 | } |
63 | pci_read_config_word(pdev, PCI_COMMAND, &config); | 62 | if (!vga_default_device() || pdev == vga_default_device()) { |
64 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { | 63 | pci_read_config_word(pdev, PCI_COMMAND, &config); |
65 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; | 64 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { |
66 | dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); | 65 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; |
66 | dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); | ||
67 | vga_set_default_device(pdev); | ||
68 | } | ||
67 | } | 69 | } |
68 | } | 70 | } |
69 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); | 71 | DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, |
72 | PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video); | ||
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 9e4938d8ca4d..291a582777cf 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg) | |||
126 | return NULL; | 126 | return NULL; |
127 | 127 | ||
128 | controller->segment = seg; | 128 | controller->segment = seg; |
129 | controller->node = -1; | ||
130 | return controller; | 129 | return controller; |
131 | } | 130 | } |
132 | 131 | ||
@@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) | |||
430 | struct pci_root_info *info = NULL; | 429 | struct pci_root_info *info = NULL; |
431 | int busnum = root->secondary.start; | 430 | int busnum = root->secondary.start; |
432 | struct pci_bus *pbus; | 431 | struct pci_bus *pbus; |
433 | int pxm, ret; | 432 | int ret; |
434 | 433 | ||
435 | controller = alloc_pci_controller(domain); | 434 | controller = alloc_pci_controller(domain); |
436 | if (!controller) | 435 | if (!controller) |
437 | return NULL; | 436 | return NULL; |
438 | 437 | ||
439 | controller->companion = device; | 438 | controller->companion = device; |
440 | 439 | controller->node = acpi_get_node(device->handle); | |
441 | pxm = acpi_get_pxm(device->handle); | ||
442 | #ifdef CONFIG_NUMA | ||
443 | if (pxm >= 0) | ||
444 | controller->node = pxm_to_node(pxm); | ||
445 | #endif | ||
446 | 440 | ||
447 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 441 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
448 | if (!info) { | 442 | if (!info) { |