]> err.no Git - linux-2.6/blobdiff - drivers/s390/char/sclp_config.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / drivers / s390 / char / sclp_config.c
index 5322e5e54a988e8d06522f532bbbe04c5e67abd4..9e784d5f7f576460b69324361801bb9e749f81be 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/cpu.h>
 #include <linux/sysdev.h>
 #include <linux/workqueue.h>
+#include <asm/smp.h>
 #include "sclp.h"
 
 #define TAG    "sclp_config: "
@@ -19,9 +20,11 @@ struct conf_mgm_data {
        u8 ev_qualifier;
 } __attribute__((packed));
 
+#define EV_QUAL_CPU_CHANGE     1
 #define EV_QUAL_CAP_CHANGE     3
 
 static struct work_struct sclp_cpu_capability_work;
+static struct work_struct sclp_cpu_change_work;
 
 static void sclp_cpu_capability_notify(struct work_struct *work)
 {
@@ -29,12 +32,17 @@ static void sclp_cpu_capability_notify(struct work_struct *work)
        struct sys_device *sysdev;
 
        printk(KERN_WARNING TAG "cpu capability changed.\n");
-       lock_cpu_hotplug();
+       get_online_cpus();
        for_each_online_cpu(cpu) {
                sysdev = get_cpu_sysdev(cpu);
                kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
        }
-       unlock_cpu_hotplug();
+       put_online_cpus();
+}
+
+static void sclp_cpu_change_notify(struct work_struct *work)
+{
+       smp_rescan_cpus();
 }
 
 static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
@@ -42,8 +50,14 @@ static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
        struct conf_mgm_data *cdata;
 
        cdata = (struct conf_mgm_data *)(evbuf + 1);
-       if (cdata->ev_qualifier == EV_QUAL_CAP_CHANGE)
+       switch (cdata->ev_qualifier) {
+       case EV_QUAL_CPU_CHANGE:
+               schedule_work(&sclp_cpu_change_work);
+               break;
+       case EV_QUAL_CAP_CHANGE:
                schedule_work(&sclp_cpu_capability_work);
+               break;
+       }
 }
 
 static struct sclp_register sclp_conf_register =
@@ -57,6 +71,7 @@ static int __init sclp_conf_init(void)
        int rc;
 
        INIT_WORK(&sclp_cpu_capability_work, sclp_cpu_capability_notify);
+       INIT_WORK(&sclp_cpu_change_work, sclp_cpu_change_notify);
 
        rc = sclp_register(&sclp_conf_register);
        if (rc) {
@@ -64,7 +79,7 @@ static int __init sclp_conf_init(void)
                return rc;
        }
 
-       if (!(sclp_conf_register.sclp_receive_mask & EVTYP_CONFMGMDATA_MASK)) {
+       if (!(sclp_conf_register.sclp_send_mask & EVTYP_CONFMGMDATA_MASK)) {
                printk(KERN_WARNING TAG "no configuration management.\n");
                sclp_unregister(&sclp_conf_register);
                rc = -ENOSYS;