Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] Automatically detect added cpus.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
1e489518 0b18d318

+36 -6
+14 -5
arch/s390/kernel/smp.c
··· 505 505 return rc; 506 506 } 507 507 508 - static int smp_rescan_cpus(void) 508 + static int __smp_rescan_cpus(void) 509 509 { 510 510 cpumask_t avail; 511 511 ··· 570 570 kfree(info); 571 571 printk(KERN_INFO "CPUs: %d configured, %d standby\n", c_cpus, s_cpus); 572 572 get_online_cpus(); 573 - smp_rescan_cpus(); 573 + __smp_rescan_cpus(); 574 574 put_online_cpus(); 575 575 } 576 576 ··· 1088 1088 } 1089 1089 1090 1090 #ifdef CONFIG_HOTPLUG_CPU 1091 - static ssize_t __ref rescan_store(struct sys_device *dev, 1092 - const char *buf, size_t count) 1091 + 1092 + int smp_rescan_cpus(void) 1093 1093 { 1094 1094 cpumask_t newcpus; 1095 1095 int cpu; ··· 1098 1098 get_online_cpus(); 1099 1099 mutex_lock(&smp_cpu_state_mutex); 1100 1100 newcpus = cpu_present_map; 1101 - rc = smp_rescan_cpus(); 1101 + rc = __smp_rescan_cpus(); 1102 1102 if (rc) 1103 1103 goto out; 1104 1104 cpus_andnot(newcpus, cpu_present_map, newcpus); ··· 1113 1113 put_online_cpus(); 1114 1114 if (!cpus_empty(newcpus)) 1115 1115 topology_schedule_update(); 1116 + return rc; 1117 + } 1118 + 1119 + static ssize_t __ref rescan_store(struct sys_device *dev, const char *buf, 1120 + size_t count) 1121 + { 1122 + int rc; 1123 + 1124 + rc = smp_rescan_cpus(); 1116 1125 return rc ? rc : count; 1117 1126 } 1118 1127 static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store);
+16 -1
drivers/s390/char/sclp_config.c
··· 10 10 #include <linux/cpu.h> 11 11 #include <linux/sysdev.h> 12 12 #include <linux/workqueue.h> 13 + #include <asm/smp.h> 13 14 #include "sclp.h" 14 15 15 16 #define TAG "sclp_config: " ··· 20 19 u8 ev_qualifier; 21 20 } __attribute__((packed)); 22 21 22 + #define EV_QUAL_CPU_CHANGE 1 23 23 #define EV_QUAL_CAP_CHANGE 3 24 24 25 25 static struct work_struct sclp_cpu_capability_work; 26 + static struct work_struct sclp_cpu_change_work; 26 27 27 28 static void sclp_cpu_capability_notify(struct work_struct *work) 28 29 { ··· 40 37 put_online_cpus(); 41 38 } 42 39 40 + static void sclp_cpu_change_notify(struct work_struct *work) 41 + { 42 + smp_rescan_cpus(); 43 + } 44 + 43 45 static void sclp_conf_receiver_fn(struct evbuf_header *evbuf) 44 46 { 45 47 struct conf_mgm_data *cdata; 46 48 47 49 cdata = (struct conf_mgm_data *)(evbuf + 1); 48 - if (cdata->ev_qualifier == EV_QUAL_CAP_CHANGE) 50 + switch (cdata->ev_qualifier) { 51 + case EV_QUAL_CPU_CHANGE: 52 + schedule_work(&sclp_cpu_change_work); 53 + break; 54 + case EV_QUAL_CAP_CHANGE: 49 55 schedule_work(&sclp_cpu_capability_work); 56 + break; 57 + } 50 58 } 51 59 52 60 static struct sclp_register sclp_conf_register = ··· 71 57 int rc; 72 58 73 59 INIT_WORK(&sclp_cpu_capability_work, sclp_cpu_capability_notify); 60 + INIT_WORK(&sclp_cpu_change_work, sclp_cpu_change_notify); 74 61 75 62 rc = sclp_register(&sclp_conf_register); 76 63 if (rc) {
+6
include/asm-s390/smp.h
··· 108 108 #define smp_cpu_not_running(cpu) 1 109 109 #endif 110 110 111 + #ifdef CONFIG_HOTPLUG_CPU 112 + extern int smp_rescan_cpus(void); 113 + #else 114 + static inline int smp_rescan_cpus(void) { return 0; } 115 + #endif 116 + 111 117 extern union save_area *zfcpdump_save_areas[NR_CPUS + 1]; 112 118 #endif