]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/s390/kernel/topology.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / arch / s390 / kernel / topology.c
index 36faac50e774e0f6f1700d9da06dc1030bcbe5f5..cc362c9ea8f1acc42d001d957a35e881868b4e0b 100644 (file)
@@ -3,6 +3,9 @@
  *    Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
  */
 
+#define KMSG_COMPONENT "cpu"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
@@ -58,11 +61,11 @@ struct core_info {
        cpumask_t mask;
 };
 
+static int topology_enabled;
 static void topology_work_fn(struct work_struct *work);
 static struct tl_info *tl_info;
 static struct core_info core_info;
 static int machine_has_topology;
-static int machine_has_topology_irq;
 static struct timer_list topology_timer;
 static void set_topology_timer(void);
 static DECLARE_WORK(topology_work, topology_work_fn);
@@ -78,7 +81,7 @@ cpumask_t cpu_coregroup_map(unsigned int cpu)
        cpumask_t mask;
 
        cpus_clear(mask);
-       if (!machine_has_topology)
+       if (!topology_enabled || !machine_has_topology)
                return cpu_possible_map;
        spin_lock_irqsave(&topology_lock, flags);
        while (core) {
@@ -94,6 +97,11 @@ cpumask_t cpu_coregroup_map(unsigned int cpu)
        return mask;
 }
 
+const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
+{
+       return &cpu_core_map[cpu];
+}
+
 static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core)
 {
        unsigned int cpu;
@@ -213,7 +221,7 @@ static void update_cpu_core_map(void)
                cpu_core_map[cpu] = cpu_coregroup_map(cpu);
 }
 
-void arch_update_cpu_topology(void)
+int arch_update_cpu_topology(void)
 {
        struct tl_info *info = tl_info;
        struct sys_device *sysdev;
@@ -222,7 +230,7 @@ void arch_update_cpu_topology(void)
        if (!machine_has_topology) {
                update_cpu_core_map();
                topology_update_polarization_simple();
-               return;
+               return 0;
        }
        stsi(info, 15, 1, 2);
        tl_to_cores(info);
@@ -231,6 +239,7 @@ void arch_update_cpu_topology(void)
                sysdev = get_cpu_sysdev(cpu);
                kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
        }
+       return 1;
 }
 
 static void topology_work_fn(struct work_struct *work)
@@ -258,10 +267,14 @@ static void set_topology_timer(void)
        add_timer(&topology_timer);
 }
 
-static void topology_interrupt(__u16 code)
+static int __init early_parse_topology(char *p)
 {
-       schedule_work(&topology_work);
+       if (strncmp(p, "on", 2))
+               return 0;
+       topology_enabled = 1;
+       return 0;
 }
+early_param("topology", early_parse_topology);
 
 static int __init init_topology_update(void)
 {
@@ -273,14 +286,7 @@ static int __init init_topology_update(void)
                goto out;
        }
        init_timer_deferrable(&topology_timer);
-       if (machine_has_topology_irq) {
-               rc = register_external_interrupt(0x2005, topology_interrupt);
-               if (rc)
-                       goto out;
-               ctl_set_bit(0, 8);
-       }
-       else
-               set_topology_timer();
+       set_topology_timer();
 out:
        update_cpu_core_map();
        return rc;
@@ -301,9 +307,6 @@ void __init s390_init_cpu_topology(void)
                return;
        machine_has_topology = 1;
 
-       if (facility_bits & (1ULL << 51))
-               machine_has_topology_irq = 1;
-
        tl_info = alloc_bootmem_pages(PAGE_SIZE);
        info = tl_info;
        stsi(info, 15, 1, 2);
@@ -312,7 +315,7 @@ void __init s390_init_cpu_topology(void)
        for (i = 0; i < info->mnest - 2; i++)
                nr_cores *= info->mag[NR_MAG - 3 - i];
 
-       printk(KERN_INFO "CPU topology:");
+       pr_info("The CPU configuration topology of the machine is:");
        for (i = 0; i < NR_MAG; i++)
                printk(" %d", info->mag[i]);
        printk(" / %d\n", info->mnest);
@@ -327,5 +330,4 @@ void __init s390_init_cpu_topology(void)
        return;
 error:
        machine_has_topology = 0;
-       machine_has_topology_irq = 0;
 }