aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/hp/common/sba_iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/hp/common/sba_iommu.c')
-rw-r--r--arch/ia64/hp/common/sba_iommu.c32
1 files changed, 11 insertions, 21 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
2019static void __init 2020static void __init
2020sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) 2021sba_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
2044static int 2034static int
2045acpi_sba_ioc_add(struct acpi_device *device, 2035acpi_sba_ioc_add(struct acpi_device *device,