This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc64 / kernel / sysfs.c
index 3bcbdec..97a83ff 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/percpu.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/module.h>
 #include <asm/current.h>
 #include <asm/processor.h>
 #include <asm/cputable.h>
@@ -114,6 +115,7 @@ void ppc64_enable_pmcs(void)
        unsigned long hid0;
        unsigned long set, reset;
        int ret;
+       unsigned int ctrl;
 
        /* Only need to enable them once */
        if (__get_cpu_var(pmcs_enabled))
@@ -158,9 +160,21 @@ void ppc64_enable_pmcs(void)
                char *ptr = (char *)&paca[smp_processor_id()].xLpPaca;
                ptr[0xBB] = 1;
        }
+
+       /*
+        * On SMT machines we have to set the run latch in the ctrl register
+        * in order to make PMC6 spin.
+        */
+       if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) {
+               ctrl = mfspr(CTRLF);
+               ctrl |= RUNLATCH;
+               mtspr(CTRLT, ctrl);
+       }
 }
 #endif
 
+EXPORT_SYMBOL_GPL(ppc64_enable_pmcs);
+
 /* XXX convert to rusty's on_one_cpu */
 static unsigned long run_on_cpu(unsigned long cpu,
                                unsigned long (*func)(unsigned long),
@@ -314,6 +328,16 @@ static int __init topology_init(void)
 #ifdef CONFIG_NUMA
                parent = &node_devices[cpu_to_node(cpu)];
 #endif
+               /*
+                * For now, we just see if the system supports making
+                * the RTAS calls for CPU hotplug.  But, there may be a
+                * more comprehensive way to do this for an individual
+                * CPU.  For instance, the boot cpu might never be valid
+                * for hotplugging.
+                */
+               if (systemcfg->platform != PLATFORM_PSERIES_LPAR)
+                       c->no_control = 1;
+
                register_cpu(c, cpu, parent);
 
                register_cpu_pmc(&c->sysdev);