powerpc/pseries: Cleanup VPA registration and deregistration errors
authorAnton Blanchard <anton@samba.org>
Mon, 25 Jul 2011 01:46:33 +0000 (01:46 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 5 Aug 2011 04:47:57 +0000 (14:47 +1000)
Make the VPA, SLB shadow and DTL registration and deregistration
functions print consistent messages on error. I needed the firmware
error code while chasing a kexec bug but we weren't printing it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/kexec.c
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/setup.c

index 1118cb79f9e3f7af435bc73762b510cb37242934..3bae8bd7db3b947fa9883c38c4071c97c084ba88 100644 (file)
@@ -39,17 +39,20 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
                }
 
                addr = __pa(get_slb_shadow());
-               if (unregister_slb_shadow(hard_smp_processor_id(), addr))
-                       printk("SLB shadow buffer deregistration of "
-                              "cpu %u (hw_cpu_id %d) failed\n",
+               ret = unregister_slb_shadow(hard_smp_processor_id(), addr);
+               if (ret) {
+                       pr_err("WARNING: SLB shadow buffer deregistration "
+                              "for cpu %d (hw %d) failed with %d\n",
                               smp_processor_id(),
-                              hard_smp_processor_id());
+                              hard_smp_processor_id(), ret);
+               }
 
                addr = __pa(get_lppaca());
-               if (unregister_vpa(hard_smp_processor_id(), addr)) {
-                       printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
-                                       "failed\n", smp_processor_id(),
-                                       hard_smp_processor_id());
+               ret = unregister_vpa(hard_smp_processor_id(), addr);
+               if (ret) {
+                       pr_err("WARNING: VPA deregistration for cpu %d "
+                              "(hw %d) failed with %d\n", smp_processor_id(),
+                              hard_smp_processor_id(), ret);
                }
        }
 }
index 225aecf7b425dcae4c81d9b164b0c19baf5efba0..c9a29dae8c0538359e60a3a377484277770c1bc3 100644 (file)
@@ -67,9 +67,8 @@ void vpa_init(int cpu)
        ret = register_vpa(hwcpu, addr);
 
        if (ret) {
-               printk(KERN_ERR "WARNING: vpa_init: VPA registration for "
-                               "cpu %d (hw %d) of area %lx returns %ld\n",
-                               cpu, hwcpu, addr, ret);
+               pr_err("WARNING: VPA registration for cpu %d (hw %d) of area "
+                      "%lx failed with %ld\n", cpu, hwcpu, addr, ret);
                return;
        }
        /*
@@ -80,10 +79,9 @@ void vpa_init(int cpu)
        if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
                ret = register_slb_shadow(hwcpu, addr);
                if (ret)
-                       printk(KERN_ERR
-                              "WARNING: vpa_init: SLB shadow buffer "
-                              "registration for cpu %d (hw %d) of area %lx "
-                              "returns %ld\n", cpu, hwcpu, addr, ret);
+                       pr_err("WARNING: SLB shadow buffer registration for "
+                              "cpu %d (hw %d) of area %lx failed with %ld\n",
+                              cpu, hwcpu, addr, ret);
        }
 
        /*
@@ -100,8 +98,9 @@ void vpa_init(int cpu)
                dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
                ret = register_dtl(hwcpu, __pa(dtl));
                if (ret)
-                       pr_warn("DTL registration failed for cpu %d (%ld)\n",
-                               cpu, ret);
+                       pr_err("WARNING: DTL registration of cpu %d (hw %d) "
+                              "failed with %ld\n", smp_processor_id(),
+                              hwcpu, ret);
                lppaca_of(cpu).dtl_enable_mask = 2;
        }
 }
index d00e52926b71e3ae76a08d809881008a620ed626..0969fd98c4faa8741e7e18f445755b8ad9048322 100644 (file)
@@ -324,8 +324,9 @@ static int alloc_dispatch_logs(void)
        dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
        ret = register_dtl(hard_smp_processor_id(), __pa(dtl));
        if (ret)
-               pr_warn("DTL registration failed for boot cpu %d (%d)\n",
-                       smp_processor_id(), ret);
+               pr_err("WARNING: DTL registration of cpu %d (hw %d) failed "
+                      "with %d\n", smp_processor_id(),
+                      hard_smp_processor_id(), ret);
        get_paca()->lppaca_ptr->dtl_enable_mask = 2;
 
        return 0;