-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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>
- Loading branch information
Heiko Carstens
authored and
Martin Schwidefsky
committed
Apr 27, 2007
1 parent
db77aa5
commit 2fc2d1e
Showing
6 changed files
with
140 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* drivers/s390/char/sclp_config.c | ||
* | ||
* Copyright IBM Corp. 2007 | ||
* Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/errno.h> | ||
#include <linux/cpu.h> | ||
#include <linux/sysdev.h> | ||
#include <linux/workqueue.h> | ||
#include "sclp.h" | ||
|
||
#define TAG "sclp_config: " | ||
|
||
struct conf_mgm_data { | ||
u8 reserved; | ||
u8 ev_qualifier; | ||
} __attribute__((packed)); | ||
|
||
#define EV_QUAL_CAP_CHANGE 3 | ||
|
||
static struct work_struct sclp_cpu_capability_work; | ||
|
||
static void sclp_cpu_capability_notify(struct work_struct *work) | ||
{ | ||
int cpu; | ||
struct sys_device *sysdev; | ||
|
||
printk(KERN_WARNING TAG "cpu capability changed.\n"); | ||
lock_cpu_hotplug(); | ||
for_each_online_cpu(cpu) { | ||
sysdev = get_cpu_sysdev(cpu); | ||
kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); | ||
} | ||
unlock_cpu_hotplug(); | ||
} | ||
|
||
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) | ||
schedule_work(&sclp_cpu_capability_work); | ||
} | ||
|
||
static struct sclp_register sclp_conf_register = | ||
{ | ||
.receive_mask = EVTYP_CONFMGMDATA_MASK, | ||
.receiver_fn = sclp_conf_receiver_fn, | ||
}; | ||
|
||
static int __init sclp_conf_init(void) | ||
{ | ||
int rc; | ||
|
||
INIT_WORK(&sclp_cpu_capability_work, sclp_cpu_capability_notify); | ||
|
||
rc = sclp_register(&sclp_conf_register); | ||
if (rc) { | ||
printk(KERN_ERR TAG "failed to register (%d).\n", rc); | ||
return rc; | ||
} | ||
|
||
if (!(sclp_conf_register.sclp_receive_mask & EVTYP_CONFMGMDATA_MASK)) { | ||
printk(KERN_WARNING TAG "no configuration management.\n"); | ||
sclp_unregister(&sclp_conf_register); | ||
rc = -ENOSYS; | ||
} | ||
return rc; | ||
} | ||
|
||
__initcall(sclp_conf_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters