[PATCH] namespaces: utsname: use init_utsname when appropriate
[powerpc.git] / arch / powerpc / platforms / pseries / setup.c
index 927e0a4..98189d8 100644 (file)
@@ -213,8 +213,6 @@ static void pseries_lpar_enable_pmcs(void)
 {
        unsigned long set, reset;
 
-       power4_enable_pmcs();
-
        set = 1UL << 63;
        reset = 0;
        plpar_hcall_norets(H_PERFMON, set, reset);
@@ -225,23 +223,37 @@ static void pseries_lpar_enable_pmcs(void)
 }
 
 #ifdef CONFIG_KEXEC
-static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary)
-{
-       mpic_teardown_this_cpu(secondary);
-}
-
-static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
+static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
 {
        /* Don't risk a hypervisor call if we're crashing */
        if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
-               unsigned long vpa = __pa(get_lppaca());
+               unsigned long addr;
+
+               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",
+                              smp_processor_id(),
+                              hard_smp_processor_id());
 
-               if (unregister_vpa(hard_smp_processor_id(), vpa)) {
+               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());
                }
        }
+}
+
+static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary)
+{
+       pseries_kexec_cpu_down(crash_shutdown, secondary);
+       mpic_teardown_this_cpu(secondary);
+}
+
+static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
+{
+       pseries_kexec_cpu_down(crash_shutdown, secondary);
        xics_teardown_cpu(secondary);
 }
 #endif /* CONFIG_KEXEC */
@@ -330,7 +342,7 @@ static int __init pSeries_init_panel(void)
 {
        /* Manually leave the kernel version on the panel. */
        ppc_md.progress("Linux ppc64\n", 0);
-       ppc_md.progress(system_utsname.release, 0);
+       ppc_md.progress(init_utsname()->version, 0);
 
        return 0;
 }
@@ -403,6 +415,12 @@ static int pSeries_check_legacy_ioport(unsigned int baseport)
                        return -ENODEV;
                of_node_put(np);
                break;
+       case PARALLEL_BASE:
+               np = of_find_node_by_type(NULL, "parallel");
+               if (np == NULL)
+                       return -ENODEV;
+               of_node_put(np);
+               break;
        }
        return 0;
 }
@@ -501,7 +519,8 @@ static void pseries_dedicated_idle_sleep(void)
        }
 
        /*
-        * Cede if the other thread is not idle, so that it can
+        * If not SMT, cede processor.  If CPU is running SMT
+        * cede if the other thread is not idle, so that it can
         * go single-threaded.  If the other thread is idle,
         * we ask the hypervisor if it has pending work it
         * wants to do and cede if it does.  Otherwise we keep
@@ -514,7 +533,8 @@ static void pseries_dedicated_idle_sleep(void)
         * very low priority.  The cede enables interrupts, which
         * doesn't matter here.
         */
-       if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
+       if (!cpu_has_feature(CPU_FTR_SMT) || !lppaca[cpu ^ 1].idle
+           || poll_pending() == H_PENDING)
                cede_processor();
 
 out: