diff options
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_partition.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_partition.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index 65877bc5edaa..d551f09ccb79 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -17,7 +17,9 @@ | |||
17 | 17 | ||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/hardirq.h> | 19 | #include <linux/hardirq.h> |
20 | #include <linux/slab.h> | ||
20 | #include "xpc.h" | 21 | #include "xpc.h" |
22 | #include <asm/uv/uv_hub.h> | ||
21 | 23 | ||
22 | /* XPC is exiting flag */ | 24 | /* XPC is exiting flag */ |
23 | int xpc_exiting; | 25 | int xpc_exiting; |
@@ -92,8 +94,12 @@ xpc_get_rsvd_page_pa(int nasid) | |||
92 | break; | 94 | break; |
93 | 95 | ||
94 | /* !!! L1_CACHE_ALIGN() is only a sn2-bte_copy requirement */ | 96 | /* !!! L1_CACHE_ALIGN() is only a sn2-bte_copy requirement */ |
95 | if (L1_CACHE_ALIGN(len) > buf_len) { | 97 | if (is_shub()) |
96 | kfree(buf_base); | 98 | len = L1_CACHE_ALIGN(len); |
99 | |||
100 | if (len > buf_len) { | ||
101 | if (buf_base != NULL) | ||
102 | kfree(buf_base); | ||
97 | buf_len = L1_CACHE_ALIGN(len); | 103 | buf_len = L1_CACHE_ALIGN(len); |
98 | buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL, | 104 | buf = xpc_kmalloc_cacheline_aligned(buf_len, GFP_KERNEL, |
99 | &buf_base); | 105 | &buf_base); |
@@ -105,7 +111,7 @@ xpc_get_rsvd_page_pa(int nasid) | |||
105 | } | 111 | } |
106 | } | 112 | } |
107 | 113 | ||
108 | ret = xp_remote_memcpy(xp_pa(buf), rp_pa, buf_len); | 114 | ret = xp_remote_memcpy(xp_pa(buf), rp_pa, len); |
109 | if (ret != xpSuccess) { | 115 | if (ret != xpSuccess) { |
110 | dev_dbg(xpc_part, "xp_remote_memcpy failed %d\n", ret); | 116 | dev_dbg(xpc_part, "xp_remote_memcpy failed %d\n", ret); |
111 | break; | 117 | break; |
@@ -143,7 +149,7 @@ xpc_setup_rsvd_page(void) | |||
143 | dev_err(xpc_part, "SAL failed to locate the reserved page\n"); | 149 | dev_err(xpc_part, "SAL failed to locate the reserved page\n"); |
144 | return -ESRCH; | 150 | return -ESRCH; |
145 | } | 151 | } |
146 | rp = (struct xpc_rsvd_page *)__va(rp_pa); | 152 | rp = (struct xpc_rsvd_page *)__va(xp_socket_pa(rp_pa)); |
147 | 153 | ||
148 | if (rp->SAL_version < 3) { | 154 | if (rp->SAL_version < 3) { |
149 | /* SAL_versions < 3 had a SAL_partid defined as a u8 */ | 155 | /* SAL_versions < 3 had a SAL_partid defined as a u8 */ |