diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2007-04-27 16:01:56 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-04-27 16:01:46 +0200 |
commit | 2fc2d1e9ffcde78af7ab63ed640d9a4901797de2 (patch) | |
tree | 9fd8fcbf4b6882200480da1f04e30b406d1f8a57 /drivers/s390/sysinfo.c | |
parent | db77aa5f3d01fe6a6cc629dbd37936b1fdd129ba (diff) | |
download | kernel-crypto-2fc2d1e9ffcde78af7ab63ed640d9a4901797de2.tar.gz kernel-crypto-2fc2d1e9ffcde78af7ab63ed640d9a4901797de2.tar.xz kernel-crypto-2fc2d1e9ffcde78af7ab63ed640d9a4901797de2.zip |
[S390] Processor degradation notification.
Generate uevents for all cpus if cpu capability changes. This can
happen e.g. because the cpus are overheating. The cpu capability can
be read via /sys/devices/system/cpu/cpuN/capability.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/sysinfo.c')
-rw-r--r-- | drivers/s390/sysinfo.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c index 090743d2f91..19343f9675c 100644 --- a/drivers/s390/sysinfo.c +++ b/drivers/s390/sysinfo.c @@ -357,6 +357,24 @@ static __init int create_proc_sysinfo(void) __initcall(create_proc_sysinfo); +int get_cpu_capability(unsigned int *capability) +{ + struct sysinfo_1_2_2 *info; + int rc; + + info = (void *) get_zeroed_page(GFP_KERNEL); + if (!info) + return -ENOMEM; + rc = stsi(info, 1, 2, 2); + if (rc == -ENOSYS) + goto out; + rc = 0; + *capability = info->capability; +out: + free_page((unsigned long) info); + return rc; +} + /* * CPU capability might have changed. Therefore recalculate loops_per_jiffy. */ |