aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-07-24 21:46:34 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-08-05 00:47:58 -0400
commit598c8231ab54cfcc8ea6f52882cefee98b129bd1 (patch)
treeff8ae1a2080780c49edc3cd48ef2af86b451c83b /arch
parent711ef84e80ec6f937ad59c7a00490421a5c92867 (diff)
powerpc/pseries: Simplify vpa deregistration functions
The VPA, SLB shadow and DTL degistration functions do not need an address, so simplify things and remove it. Also cleanup pseries_kexec_cpu_down a bit by storing the cpu IDs in local variables. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c4
-rw-r--r--arch/powerpc/platforms/pseries/kexec.c20
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h8
3 files changed, 14 insertions, 18 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index bc0288501f17..83a3ca2fd282 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -135,7 +135,7 @@ static void pseries_mach_cpu_die(void)
135 get_lppaca()->idle = 0; 135 get_lppaca()->idle = 0;
136 136
137 if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) { 137 if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) {
138 unregister_slb_shadow(hwcpu, __pa(get_slb_shadow())); 138 unregister_slb_shadow(hwcpu);
139 139
140 /* 140 /*
141 * Call to start_secondary_resume() will not return. 141 * Call to start_secondary_resume() will not return.
@@ -150,7 +150,7 @@ static void pseries_mach_cpu_die(void)
150 WARN_ON(get_preferred_offline_state(cpu) != CPU_STATE_OFFLINE); 150 WARN_ON(get_preferred_offline_state(cpu) != CPU_STATE_OFFLINE);
151 151
152 set_cpu_current_state(cpu, CPU_STATE_OFFLINE); 152 set_cpu_current_state(cpu, CPU_STATE_OFFLINE);
153 unregister_slb_shadow(hwcpu, __pa(get_slb_shadow())); 153 unregister_slb_shadow(hwcpu);
154 rtas_stop_self(); 154 rtas_stop_self();
155 155
156 /* Should never get here... */ 156 /* Should never get here... */
diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pseries/kexec.c
index 3bae8bd7db3b..7d94bdc63d50 100644
--- a/arch/powerpc/platforms/pseries/kexec.c
+++ b/arch/powerpc/platforms/pseries/kexec.c
@@ -25,34 +25,30 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
25{ 25{
26 /* Don't risk a hypervisor call if we're crashing */ 26 /* Don't risk a hypervisor call if we're crashing */
27 if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { 27 if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
28 unsigned long addr;
29 int ret; 28 int ret;
29 int cpu = smp_processor_id();
30 int hwcpu = hard_smp_processor_id();
30 31
31 if (get_lppaca()->dtl_enable_mask) { 32 if (get_lppaca()->dtl_enable_mask) {
32 ret = unregister_dtl(hard_smp_processor_id()); 33 ret = unregister_dtl(hwcpu);
33 if (ret) { 34 if (ret) {
34 pr_err("WARNING: DTL deregistration for cpu " 35 pr_err("WARNING: DTL deregistration for cpu "
35 "%d (hw %d) failed with %d\n", 36 "%d (hw %d) failed with %d\n",
36 smp_processor_id(), 37 cpu, hwcpu, ret);
37 hard_smp_processor_id(), ret);
38 } 38 }
39 } 39 }
40 40
41 addr = __pa(get_slb_shadow()); 41 ret = unregister_slb_shadow(hwcpu);
42 ret = unregister_slb_shadow(hard_smp_processor_id(), addr);
43 if (ret) { 42 if (ret) {
44 pr_err("WARNING: SLB shadow buffer deregistration " 43 pr_err("WARNING: SLB shadow buffer deregistration "
45 "for cpu %d (hw %d) failed with %d\n", 44 "for cpu %d (hw %d) failed with %d\n",
46 smp_processor_id(), 45 cpu, hwcpu, ret);
47 hard_smp_processor_id(), ret);
48 } 46 }
49 47
50 addr = __pa(get_lppaca()); 48 ret = unregister_vpa(hwcpu);
51 ret = unregister_vpa(hard_smp_processor_id(), addr);
52 if (ret) { 49 if (ret) {
53 pr_err("WARNING: VPA deregistration for cpu %d " 50 pr_err("WARNING: VPA deregistration for cpu %d "
54 "(hw %d) failed with %d\n", smp_processor_id(), 51 "(hw %d) failed with %d\n", cpu, hwcpu, ret);
55 hard_smp_processor_id(), ret);
56 } 52 }
57 } 53 }
58} 54}
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index a6921aec2d6f..41c24c146d6a 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -53,9 +53,9 @@ static inline long vpa_call(unsigned long flags, unsigned long cpu,
53 return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa); 53 return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
54} 54}
55 55
56static inline long unregister_vpa(unsigned long cpu, unsigned long vpa) 56static inline long unregister_vpa(unsigned long cpu)
57{ 57{
58 return vpa_call(0x5, cpu, vpa); 58 return vpa_call(0x5, cpu, 0);
59} 59}
60 60
61static inline long register_vpa(unsigned long cpu, unsigned long vpa) 61static inline long register_vpa(unsigned long cpu, unsigned long vpa)
@@ -63,9 +63,9 @@ static inline long register_vpa(unsigned long cpu, unsigned long vpa)
63 return vpa_call(0x1, cpu, vpa); 63 return vpa_call(0x1, cpu, vpa);
64} 64}
65 65
66static inline long unregister_slb_shadow(unsigned long cpu, unsigned long vpa) 66static inline long unregister_slb_shadow(unsigned long cpu)
67{ 67{
68 return vpa_call(0x7, cpu, vpa); 68 return vpa_call(0x7, cpu, 0);
69} 69}
70 70
71static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa) 71static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)