aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xpc_main.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-07-30 01:34:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 12:41:50 -0400
commitee6665e3b6e1283c30ae240732af1345bc02154e (patch)
tree91fbfb2a4cab26e3979df44a9bdcd6851efc9c50 /drivers/misc/sgi-xp/xpc_main.c
parenta7b4d509205db5e9cd3ffc77b306d7b10fe6a34d (diff)
sgi-xp: isolate remote copy buffer to sn2 only
Make the remote copy buffer an sn2 only item. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_main.c')
-rw-r--r--drivers/misc/sgi-xp/xpc_main.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
index b5f3c5e59db0..36dfccea5247 100644
--- a/drivers/misc/sgi-xp/xpc_main.c
+++ b/drivers/misc/sgi-xp/xpc_main.c
@@ -877,7 +877,6 @@ xpc_do_exit(enum xp_retval reason)
877 unregister_sysctl_table(xpc_sysctl); 877 unregister_sysctl_table(xpc_sysctl);
878 878
879 kfree(xpc_partitions); 879 kfree(xpc_partitions);
880 kfree(xpc_remote_copy_buffer_base);
881 880
882 if (is_shub()) 881 if (is_shub())
883 xpc_exit_sn2(); 882 xpc_exit_sn2();
@@ -1031,7 +1030,9 @@ xpc_init(void)
1031 short partid; 1030 short partid;
1032 struct xpc_partition *part; 1031 struct xpc_partition *part;
1033 struct task_struct *kthread; 1032 struct task_struct *kthread;
1034 size_t buf_size; 1033
1034 snprintf(xpc_part->bus_id, BUS_ID_SIZE, "part");
1035 snprintf(xpc_chan->bus_id, BUS_ID_SIZE, "chan");
1035 1036
1036 if (is_shub()) { 1037 if (is_shub()) {
1037 /* 1038 /*
@@ -1054,26 +1055,12 @@ xpc_init(void)
1054 return -ENODEV; 1055 return -ENODEV;
1055 } 1056 }
1056 1057
1057 snprintf(xpc_part->bus_id, BUS_ID_SIZE, "part");
1058 snprintf(xpc_chan->bus_id, BUS_ID_SIZE, "chan");
1059
1060 buf_size = max(XPC_RP_VARS_SIZE,
1061 XPC_RP_HEADER_SIZE + XP_NASID_MASK_BYTES);
1062 xpc_remote_copy_buffer = xpc_kmalloc_cacheline_aligned(buf_size,
1063 GFP_KERNEL,
1064 &xpc_remote_copy_buffer_base);
1065 if (xpc_remote_copy_buffer == NULL) {
1066 dev_err(xpc_part, "can't get memory for remote copy buffer\n");
1067 ret = -ENOMEM;
1068 goto out_1;
1069 }
1070
1071 xpc_partitions = kzalloc(sizeof(struct xpc_partition) * 1058 xpc_partitions = kzalloc(sizeof(struct xpc_partition) *
1072 xp_max_npartitions, GFP_KERNEL); 1059 xp_max_npartitions, GFP_KERNEL);
1073 if (xpc_partitions == NULL) { 1060 if (xpc_partitions == NULL) {
1074 dev_err(xpc_part, "can't get memory for partition structure\n"); 1061 dev_err(xpc_part, "can't get memory for partition structure\n");
1075 ret = -ENOMEM; 1062 ret = -ENOMEM;
1076 goto out_2; 1063 goto out_1;
1077 } 1064 }
1078 1065
1079 /* 1066 /*
@@ -1115,7 +1102,7 @@ xpc_init(void)
1115 if (xpc_rsvd_page == NULL) { 1102 if (xpc_rsvd_page == NULL) {
1116 dev_err(xpc_part, "can't setup our reserved page\n"); 1103 dev_err(xpc_part, "can't setup our reserved page\n");
1117 ret = -EBUSY; 1104 ret = -EBUSY;
1118 goto out_3; 1105 goto out_2;
1119 } 1106 }
1120 1107
1121 /* add ourselves to the reboot_notifier_list */ 1108 /* add ourselves to the reboot_notifier_list */
@@ -1136,7 +1123,7 @@ xpc_init(void)
1136 if (IS_ERR(kthread)) { 1123 if (IS_ERR(kthread)) {
1137 dev_err(xpc_part, "failed while forking hb check thread\n"); 1124 dev_err(xpc_part, "failed while forking hb check thread\n");
1138 ret = -EBUSY; 1125 ret = -EBUSY;
1139 goto out_4; 1126 goto out_3;
1140 } 1127 }
1141 1128
1142 /* 1129 /*
@@ -1164,18 +1151,16 @@ xpc_init(void)
1164 return 0; 1151 return 0;
1165 1152
1166 /* initialization was not successful */ 1153 /* initialization was not successful */
1167out_4: 1154out_3:
1168 /* indicate to others that our reserved page is uninitialized */ 1155 /* indicate to others that our reserved page is uninitialized */
1169 xpc_rsvd_page->stamp = 0; 1156 xpc_rsvd_page->stamp = 0;
1170 1157
1171 (void)unregister_die_notifier(&xpc_die_notifier); 1158 (void)unregister_die_notifier(&xpc_die_notifier);
1172 (void)unregister_reboot_notifier(&xpc_reboot_notifier); 1159 (void)unregister_reboot_notifier(&xpc_reboot_notifier);
1173out_3: 1160out_2:
1174 if (xpc_sysctl) 1161 if (xpc_sysctl)
1175 unregister_sysctl_table(xpc_sysctl); 1162 unregister_sysctl_table(xpc_sysctl);
1176 kfree(xpc_partitions); 1163 kfree(xpc_partitions);
1177out_2:
1178 kfree(xpc_remote_copy_buffer_base);
1179out_1: 1164out_1:
1180 if (is_shub()) 1165 if (is_shub())
1181 xpc_exit_sn2(); 1166 xpc_exit_sn2();