s390 patches for 2.6.22
Subsystems (4)
cover s390 patches for 2.6.22
Couple of patches that haven't been posted before and which should be merged in the 2.6.22 merge window.
PATCH 1/8 Processor degredation support.
From: Heiko Carstens <[email protected]>
Emit a warning if cpu capability changes e.g. because the cpus are overheating. The new cpu capability can be read via /proc/sysinfo.
---
drivers/s390/char/Makefile | 2 - drivers/s390/char/sclp.h | 2 + drivers/s390/char/sclp_confmgm.c | 57 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-)
drivers/s390/char/Makefile +1 -1
@@ -3,7 +3,7 @@ # obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \ - sclp_info.o + sclp_info.o sclp_confmgm.o obj-$(CONFIG_TN3270) += raw3270.o obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
drivers/s390/char/sclp_confmgm.c new file +57 -0
57 lines not on this page · raw message
drivers/s390/char/sclp.h +2 -0
@@ -27,6 +27,7 @@#define EvTyp_CntlProgIdent 0x0B#define EvTyp_SigQuiesce 0x1D#define EvTyp_VT220Msg 0x1A +#define EvTyp_ConfMgmData 0x04#define EvTyp_OpCmd_Mask 0x80000000#define EvTyp_Msg_Mask 0x40000000
@@ -36,6 +37,7 @@#define EvTyp_CtlProgIdent_Mask 0x00200000#define EvTyp_SigQuiesce_Mask 0x00000008#define EvTyp_VT220Msg_Mask 0x00000040 +#define EvTyp_ConfMgmData_Mask 0x10000000#define GnrlMsgFlgs_DOM 0x8000#define GnrlMsgFlgs_SndAlrm 0x4000
Re: [patch 1/8] Processor degredation support.
Hi!
Quoted 9 lines
From: Heiko Carstens <[email protected]>
Emit a warning if cpu capability changes e.g. because the cpus are overheating. The new cpu capability can be read via
/proc/sysinfo.Signed-off-by Martin Schwidefsky <[email protected]>Signed-off-by Heiko Carstens <[email protected]>+++
linux-2.6/drivers/s390/char/sclp_confmgm.c
Can we get less cyptic name?
Quoted 1 line
+#define
SCLP_CONFMGM_PRINT_HEADER"sclp_confmgm: "
Uah, define longer than text it expands to...
drivers/s390/char/sclp_confmgm.c line 29
Quoted 9 lines
drivers/s390/char/sclp_confmgm.c new file +9
-0+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 ) +/* Will be parsed. Don't change. */ +printk (KERN_WARNING "sclp: CPU capability changed.\n" ); +}
What's that? I do not think printk provides guaranteed delivery.
drivers/s390/char/sclp_confmgm.c line 33
Quoted 3 lines
drivers/s390/char/sclp_confmgm.c new file +3
-0+static struct sclp_register sclp_conf_register = +{ + .receive_mask = EvTyp_ConfMgmData_Mask,
NoCamelCasePlease.
Quoted 9 lines
drivers/s390/char/sclp.h +1
-0@@ -27,6 +27,7 @@#define EvTyp_CntlProgIdent 0x0B#define EvTyp_SigQuiesce 0x1D#define EvTyp_VT220Msg 0x1A +#define EvTyp_ConfMgmData 0x04#define EvTyp_OpCmd_Mask 0x80000000#define EvTyp_Msg_Mask 0x40000000
drivers/s390/char/sclp.h line 43
Quoted 7 lines
drivers/s390/char/sclp.h +1
-0@@ -36,6 +37,7 @@#define EvTyp_CtlProgIdent_Mask 0x00200000#define EvTyp_SigQuiesce_Mask 0x00000008#define EvTyp_VT220Msg_Mask 0x00000040 +#define EvTyp_ConfMgmData_Mask 0x10000000#define GnrlMsgFlgs_DOM 0x8000#define GnrlMsgFlgs_SndAlrm 0x4000
Yep, you have more CamelCases to fix.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [patch 1/8] Processor degredation support.
Quoted 3 lines
Quoted 1 line
+++
linux-2.6/drivers/s390/char/sclp_confmgm.cCan we get less cyptic name?
Would you like to see sclp_configuration_management.c?
Quoted 11 lines
drivers/s390/char/sclp_confmgm.c line 29
Quoted 9 lines
drivers/s390/char/sclp_confmgm.c new file +9
-0+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 ) +/* Will be parsed. Don't change. */ +printk (KERN_WARNING "sclp: CPU capability changed.\n" ); +}What's that? I do not think printk provides guaranteed delivery.
True. But which generic interface is currently used to notify user space of state changes? Maybe a uevent for the cpu device..
Quoted 20 lines
drivers/s390/char/sclp_confmgm.c line 33
Quoted 3 lines
drivers/s390/char/sclp_confmgm.c new file +3
-0+static struct sclp_register sclp_conf_register = +{ + .receive_mask = EvTyp_ConfMgmData_Mask,NoCamelCasePlease.
Quoted 14 lines
drivers/s390/char/sclp.h +2
-0@@ -27,6 +27,7 @@#define EvTyp_CntlProgIdent 0x0B#define EvTyp_SigQuiesce 0x1D#define EvTyp_VT220Msg 0x1A +#define EvTyp_ConfMgmData 0x04#define EvTyp_OpCmd_Mask 0x80000000#define EvTyp_Msg_Mask 0x40000000@@ -36,6 +37,7 @@#define EvTyp_CtlProgIdent_Mask 0x00200000#define EvTyp_SigQuiesce_Mask 0x00000008#define EvTyp_VT220Msg_Mask 0x00000040 +#define EvTyp_ConfMgmData_Mask 0x10000000
Quoted 4 lines
drivers/s390/char/sclp.h line 43
Quoted 2 lines
drivers/s390/char/sclp.h +0
-0#define GnrlMsgFlgs_DOM 0x8000#define GnrlMsgFlgs_SndAlrm 0x4000Yep, you have more CamelCases to fix.
Yes, you're definately right. But I wanted to stick with the current coding style of the sclp device driver and didn't feel like generating a 1000+ line diff just to fix some coding style issues. Will fix this when I'm bored.
Re: [patch 1/8] Processor degredation support.
Quoted 5 lines · Heiko Carstens
Quoted 3 lines
Quoted 1 line
+++
linux-2.6/drivers/s390/char/sclp_confmgm.cCan we get less cyptic name?
Would you like to see
sclp_configuration_management.c?
No, but maybe sclp_manager.c or sclp_config.c?
Quoted 12 lines
Quoted 11 lines
drivers/s390/char/sclp_confmgm.c line 29
Quoted 9 lines
drivers/s390/char/sclp_confmgm.c new file +9
-0+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 ) +/* Will be parsed. Don't change. */ +printk (KERN_WARNING "sclp: CPU capability changed.\n" ); +}What's that? I do not think printk provides guaranteed delivery.
Quoted 2 lines
True. But which generic interface is currently used to notify user space of state changes? Maybe a uevent for the cpu device..
Maybe.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [patch 1/8] Processor degredation support.
Quoted 22 lines · Pavel Machek
Quoted 5 lines · Heiko Carstens
Quoted 3 lines
Quoted 1 line
+++
linux-2.6/drivers/s390/char/sclp_confmgm.cCan we get less cyptic name?
Would you like to see
sclp_configuration_management.c?No, but maybe
sclp_manager.corsclp_config.c?Quoted 12 lines
Quoted 11 lines
Review
Quoted 9 lines
(quoted diff) +9
-0+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) + /* Will be parsed. Don't change. */ + printk(KERN_WARNING "sclp: CPU capability changed.\n"); +}What's that? I do not think printk provides guaranteed delivery.
Quoted 4 lines
Quoted 2 lines
True. But which generic interface is currently used to notify user space of state changes? Maybe a uevent for the cpu device..
Maybe.
Thanks for reviewing and your comments!
So how about the patch below? I think it addresses all your objections.
Subject: [PATCH] Processor degredation support.
From: Heiko Carstens <[email protected]>
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.
---
arch/s390/kernel/smp.c | 48 +++++++++++++++++++++++-- drivers/s390/char/Makefile | 2 - drivers/s390/char/sclp.h | 2 + drivers/s390/char/sclp_config.c | 74 ++++++++++++++++++++++++++++++++++++++++ drivers/s390/sysinfo.c | 18 +++++++++ include/asm-s390/processor.h | 1 6 files changed, 139 insertions(+), 6 deletions(-)
arch/s390/kernel/smp.c +43 -5
@@ -821,19 +821,57 @@ int setup_profiling_timer(unsigned int m static DEFINE_PER_CPU(struct cpu, cpu_devices); +static ssize_t show_capability (struct sys_device *dev,char *buf) +{ +unsigned int capability; +int rc; + + rc =get_cpu_capability (&capability); +if (rc) +return rc; +return sprintf (buf,"%u\n" , capability); +} +static SYSDEV_ATTR(capability, 0444, show_capability, NULL); + +static int __cpuinit smp_cpu_notify (struct notifier_block *self, +unsigned long action,void *hcpu) +{ +unsigned int cpu = (unsigned int )(long )hcpu; +struct cpu *c = &per_cpu (cpu_devices, cpu); +struct sys_device *s = &c->sysdev; + +switch (action) { +case CPU_ONLINE : +if (sysdev_create_file (s, &attr_capability)) +return NOTIFY_BAD ; +break ; +case CPU_DEAD : +sysdev_remove_file (s, &attr_capability); +break ; + } +return NOTIFY_OK ; +} + +static struct notifier_block __cpuinitdata smp_cpu_nb = { + .notifier_call = smp_cpu_notify, +}; +static int __init topology_init (void ) {int cpu; -int ret; + +register_cpu_notifier (&smp_cpu_nb);for_each_possible_cpu (cpu) {struct cpu *c = &per_cpu (cpu_devices, cpu); +struct sys_device *s = &c->sysdev; c->hotpluggable =1 ; - ret =register_cpu (c, cpu); -if (ret) -printk (KERN_WARNING "topology_init: register_cpu %d " -"failed (%d)\n" , cpu, ret); +register_cpu (c, cpu); +if (!cpu_online (cpu)) +continue ; + s = &c->sysdev; +sysdev_create_file (s, &attr_capability); }return 0 ; }
drivers/s390/char/Makefile +1 -1
@@ -3,7 +3,7 @@ # obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \ - sclp_info.o sclp_chp.o + sclp_info.o sclp_config.o sclp_chp.o obj-$(CONFIG_TN3270) += raw3270.o obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
drivers/s390/char/sclp_config.c +74 -0
74 lines not on this page · raw message
drivers/s390/char/sclp.h +2 -0
@@ -27,6 +27,7 @@#define EVTYP_CNTLPROGIDENT 0x0B#define EVTYP_SIGQUIESCE 0x1D#define EVTYP_VT220MSG 0x1A +#define EVTYP_CONFMGMDATA 0x04#define EVTYP_SDIAS 0x1C#define EVTYP_OPCMD_MASK 0x80000000
@@ -37,6 +38,7 @@#define EVTYP_CTLPROGIDENT_MASK 0x00200000#define EVTYP_SIGQUIESCE_MASK 0x00000008#define EVTYP_VT220MSG_MASK 0x00000040 +#define EVTYP_CONFMGMDATA_MASK 0x10000000#define EVTYP_SDIAS_MASK 0x00000010#define GNRLMSGFLGS_DOM 0x8000
drivers/s390/sysinfo.c +18 -0
@@ -357,6 +357,24 @@ static __init int create_proc_sysinfo(vo__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. */
include/asm-s390/processor.h +1 -0
@@ -57,6 +57,7 @@ struct cpuinfo_S390extern void s390_adjust_jiffies (void );extern void print_cpu_info (struct cpuinfo_S390 *); +extern int get_cpu_capability (unsigned int *);/* Lazy FPU handling on uni-processor */ extern struct task_struct *last_task_used_math;
PATCH 2/8 Get rid of console setup functions.
In reply to Heiko CarstensFrom: Heiko Carstens <[email protected]>
We get this:
Section mismatch: reference to .init.text:con3270_consetup from .data
between 'con3270' (at offset 0x45c8) and 'con3270_fn' Section mismatch: reference to .init.text:con3215_consetup from .data between 'con3215' (at offset 0x4678) and 'raw3215_ccw_driver'
Since there is no difference between a non present console setup function and one that returns only 0 remove them.
---
drivers/s390/char/con3215.c | 7 ------- drivers/s390/char/con3270.c | 7 ------- 2 files changed, 14 deletions(-)
drivers/s390/char/con3215.c +0 -7
@@ -813,12 +813,6 @@ con3215_unblank(void)spin_unlock_irqrestore (get_ccwdev_lock (raw->cdev), flags); } -static int __init -con3215_consetup (struct console *co,char *options) -{ -return 0 ; -} -/* * The console structure for the 3215 console */
@@ -827,7 +821,6 @@ static struct console con3215 = { .write = con3215_write, .device = con3215_device, .unblank = con3215_unblank, - .setup = con3215_consetup, .flags = CON_PRINTBUFFER, };
drivers/s390/char/con3270.c +0 -7
@@ -555,12 +555,6 @@ con3270_unblank(void)spin_unlock_irqrestore (&cp->view.lock, flags); } -static int __init -con3270_consetup (struct console *co,char *options) -{ -return 0 ; -} -/* * The console structure for the 3270 console */
@@ -569,7 +563,6 @@ static struct console con3270 = { .write = con3270_write, .device = con3270_device, .unblank = con3270_unblank, - .setup = con3270_consetup, .flags = CON_PRINTBUFFER, };
PATCH 3/8 Improved kernel stack overflow checking.
In reply to Heiko CarstensFrom: Martin Schwidefsky <[email protected]>
Recent cvs versions of gcc have support for an improved stack overflow checking that calculates the size of the guard size for each function. If the compiler accepts -mstack-size without -mstack-guard then the new stack check is available. We always want to use the new stack checker.
---
arch/s390/Makefile | 2 ++ 1 files changed, 2 insertions(+)
arch/s390/Makefile +2 -0
@@ -67,8 +67,10 @@ endif ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) +ifneq ($(call cc-option-yn,-mstack-size=8192),y) cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) endif +endif ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) cflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
PATCH 4/8 cio: Clean up online_store.
In reply to Heiko CarstensFrom: Cornelia Huck <[email protected]>
Detangle the online_store code and make it more readable.
---
drivers/s390/cio/device.c | 109 ++++++++++++++++++++++++++-------------------- 1 files changed, 62 insertions(+), 47 deletions(-)
drivers/s390/cio/device.c +62 -47
@@ -413,11 +413,60 @@ ccw_device_set_online(struct ccw_devicereturn (ret ==0 ) ? -ENODEV : ret; } -static ssize_t -online_store (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) +static void online_store_handle_offline (struct ccw_device *cdev) +{ +if (cdev->private->state ==DEV_STATE_DISCONNECTED ) +ccw_device_remove_disconnected (cdev); +else if (cdev->drv && cdev->drv->set_offline) +ccw_device_set_offline (cdev); +} + +static int online_store_recog_and_online (struct ccw_device *cdev) +{ +int ret; + +/* Do device recognition, if needed. */ +if (cdev->id.cu_type ==0 ) { + ret =ccw_device_recognition (cdev); +if (ret) { +printk (KERN_WARNING "Couldn't start recognition " +"for device %s (ret=%d)\n" , + cdev->dev.bus_id, ret); +return ret; + } +wait_event (cdev->private->wait_q, + cdev->private->flags.recog_done); + } +if (cdev->drv && cdev->drv->set_online) +ccw_device_set_online (cdev); +return 0 ; +} +static void online_store_handle_online (struct ccw_device *cdev,int force) +{ +int ret; + + ret =online_store_recog_and_online (cdev); +if (ret) +return ; +if (force && cdev->private->state ==DEV_STATE_BOXED ) { + ret =ccw_device_stlck (cdev); +if (ret) { +printk (KERN_WARNING "ccw_device_stlck for device %s " +"returned %d!\n" , cdev->dev.bus_id, ret); +return ; + } +if (cdev->id.cu_type ==0 ) + cdev->private->state =DEV_STATE_NOT_OPER ; +online_store_recog_and_online (cdev); + } + +} + +static ssize_t online_store (struct device *dev,struct device_attribute *attr, +const char *buf,size_t count) {struct ccw_device *cdev =to_ccwdev (dev); -int i, force, ret; +int i, force;char *tmp;if (atomic_cmpxchg (&cdev->private->onoff,0 ,1 ) !=0 )
@@ -434,51 +483,17 @@ online_store (struct device *dev, struct force =0 ; i =simple_strtoul (buf, &tmp,16 ); } -if (i ==1 ) { -/* Do device recognition, if needed. */ -if (cdev->id.cu_type ==0 ) { - ret =ccw_device_recognition (cdev); -if (ret) { -printk (KERN_WARNING "Couldn't start recognition " -"for device %s (ret=%d)\n" , - cdev->dev.bus_id, ret); - goto out; - } -wait_event (cdev->private->wait_q, - cdev->private->flags.recog_done); - } -if (cdev->drv && cdev->drv->set_online) -ccw_device_set_online (cdev); - }else if (i ==0 ) { -if (cdev->private->state ==DEV_STATE_DISCONNECTED ) -ccw_device_remove_disconnected (cdev); -else if (cdev->drv && cdev->drv->set_offline) -ccw_device_set_offline (cdev); - } -if (force && cdev->private->state ==DEV_STATE_BOXED ) { - ret =ccw_device_stlck (cdev); -if (ret) { -printk (KERN_WARNING "ccw_device_stlck for device %s " -"returned %d!\n" , cdev->dev.bus_id, ret); - goto out; - } -/* Do device recognition, if needed. */ -if (cdev->id.cu_type ==0 ) { - cdev->private->state =DEV_STATE_NOT_OPER ; - ret =ccw_device_recognition (cdev); -if (ret) { -printk (KERN_WARNING "Couldn't start recognition " -"for device %s (ret=%d)\n" , - cdev->dev.bus_id, ret); - goto out; - } -wait_event (cdev->private->wait_q, - cdev->private->flags.recog_done); - } -if (cdev->drv && cdev->drv->set_online) -ccw_device_set_online (cdev); + +switch (i) { +case 0 : +online_store_handle_offline (cdev); +break ; +case 1 : +online_store_handle_online (cdev, force); +break ; +default : + count = -EINVAL ; } - out:if (cdev->drv)module_put (cdev->drv->owner);atomic_set (&cdev->private->onoff,0 );
PATCH 5/8 cio: Channel-path configure function.
In reply to Heiko CarstensFrom: Peter Oberparleiter <[email protected]>
Add a new attribute to the channel-path sysfs directory through which channel-path configure operations can be triggered. Also listen for hardware events requesting channel-path configure operations and process them accordingly.
---
drivers/s390/char/Makefile | 2 drivers/s390/char/sclp_chp.c | 196 +++++++++++++++++++++++++++++++++ drivers/s390/cio/chp.c | 249 +++++++++++++++++++++++++++++++++++++++++- drivers/s390/cio/chp.h | 20 +++ drivers/s390/cio/chpid.h | 51 -------- drivers/s390/cio/chsc.c | 44 +++++++ drivers/s390/cio/chsc.h | 2 drivers/s390/cio/cio.c | 1 drivers/s390/cio/cio.h | 1 drivers/s390/cio/css.h | 4 drivers/s390/cio/device_fsm.c | 2 drivers/s390/cio/device_ops.c | 2 drivers/s390/cio/ioasm.h | 2 include/asm-s390/chpid.h | 53 ++++++++ include/asm-s390/cio.h | 1 include/asm-s390/sclp.h | 12 ++ 16 files changed, 580 insertions(+), 62 deletions(-)
drivers/s390/char/Makefile +1 -1
@@ -3,7 +3,7 @@ # obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \ - sclp_info.o sclp_confmgm.o + sclp_info.o sclp_confmgm.o sclp_chp.o obj-$(CONFIG_TN3270) += raw3270.o obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
drivers/s390/char/sclp_chp.c new file +196 -0
196 lines not on this page · raw message
drivers/s390/cio/chp.c +248 -1
284 lines not on this page · raw message
drivers/s390/cio/chp.h +18 -2
@@ -10,10 +10,23 @@#include <linux/types.h> #include <linux/device.h> - -#include "chpid.h" +#include <asm/chpid.h> #include "chsc.h" +#define CHP_STATUS_STANDBY 0 +#define CHP_STATUS_CONFIGURED 1 +#define CHP_STATUS_RESERVED 2 +#define CHP_STATUS_NOT_RECOGNIZED 3 + +static inline int chp_test_bit (u8 *bitmap,int num) +{ +int byte = num >>3 ; +int mask =128 >> (num &7 ); + +return (bitmap[byte] & mask) ?1 :0 ; +} + +struct channel_path {struct chp_id chpid;int state;
@@ -33,5 +46,8 @@ int chp_process_crw(int id, int availablvoid chp_remove_cmg_attr (struct channel_path *chp);int chp_add_cmg_attr (struct channel_path *chp);int chp_new (struct chp_id chpid); +void chp_cfg_schedule (struct chp_id chpid,int configure); +void chp_cfg_cancel_deconfigure (struct chp_id chpid); +int chp_info_get_status (struct chp_id chpid);#endif /* S390_CHP_H */
drivers/s390/cio/chpid.h deleted +0 -51
51 lines not on this page · raw message
drivers/s390/cio/chsc.c +43 -1
67 lines not on this page · raw message
drivers/s390/cio/chsc.h +1 -1
@@ -3,7 +3,7 @@#include <linux/types.h> #include <linux/device.h> -#include "chpid.h" +#include <asm/chpid.h> #define CHSC_SDA_OC_MSS 0x2
drivers/s390/cio/cio.c +1 -0
@@ -22,6 +22,7 @@#include <asm/setup.h> #include <asm/reset.h> #include <asm/ipl.h> +#include <asm/chpid.h> #include "airq.h" #include "cio.h" #include "css.h"
drivers/s390/cio/cio.h +1 -0
@@ -3,6 +3,7 @@#include "schid.h" #include <linux/mutex.h> +#include <linux/device.h> /* * where we put the ssd info
drivers/s390/cio/css.h +2 -2
@@ -5,8 +5,10 @@#include <linux/wait.h> #include <linux/workqueue.h> #include <linux/device.h> +#include <linux/types.h> #include <asm/cio.h> +#include <asm/chpid.h> #include "schid.h"
@@ -149,8 +151,6 @@ extern void css_reiterate_subchannels(vo#define __MAX_SUBCHANNEL 65535#define __MAX_SSID 3 -#define __MAX_CHPID 255 -#define __MAX_CSSID 0struct channel_subsystem {u8 cssid;
drivers/s390/cio/device_fsm.c +1 -1
@@ -15,6 +15,7 @@#include <asm/ccwdev.h> #include <asm/cio.h> +#include <asm/chpid.h> #include "cio.h" #include "cio_debug.h"
@@ -22,7 +23,6 @@#include "device.h" #include "chsc.h" #include "ioasm.h" -#include "chpid.h" #include "chp.h" int
drivers/s390/cio/device_ops.c +1 -1
@@ -16,13 +16,13 @@#include <asm/ccwdev.h> #include <asm/idals.h> +#include <asm/chpid.h> #include "cio.h" #include "cio_debug.h" #include "css.h" #include "chsc.h" #include "device.h" -#include "chpid.h" #include "chp.h" int ccw_device_set_options_mask (struct ccw_device *cdev,unsigned long flags)
drivers/s390/cio/ioasm.h +1 -1
@@ -1,8 +1,8 @@#ifndef S390_CIO_IOASM_H #define S390_CIO_IOASM_H +#include <asm/chpid.h> #include "schid.h" -#include "chpid.h" /* * TPI info structure
include/asm-s390/chpid.h new file +53 -0
53 lines not on this page · raw message
include/asm-s390/cio.h +1 -0
@@ -13,6 +13,7 @@#ifdef __KERNEL__#define LPM_ANYPATH 0xff +#define __MAX_CSSID 0/* * subchannel status word
include/asm-s390/sclp.h +12 -0
@@ -9,6 +9,7 @@#define _ASM_S390_SCLP_H#include <linux/types.h> +#include <asm/chpid.h> struct sccb_header {u16 length;
@@ -33,7 +34,18 @@ struct sclp_readinfo_sccb {u8 _reserved3[4096 -112 ];/* 112-4095 */ } __attribute__((packed, aligned(4096))); +#define SCLP_CHP_INFO_MASK_SIZE 32 + +struct sclp_chp_info { +u8 recognized[SCLP_CHP_INFO_MASK_SIZE ]; +u8 standby[SCLP_CHP_INFO_MASK_SIZE ]; +u8 configured[SCLP_CHP_INFO_MASK_SIZE ]; +}; +extern struct sclp_readinfo_sccb s390_readinfo_sccb;extern void sclp_readinfo_early (void ); +extern int sclp_chp_configure (struct chp_id chpid); +extern int sclp_chp_deconfigure (struct chp_id chpid); +extern int sclp_chp_read_info (struct sclp_chp_info *info);#endif /* _ASM_S390_SCLP_H */
PATCH 6/8 dasd: Add sysfs attribute status and generate uevents.
In reply to Heiko CarstensFrom: Horst Hummel <[email protected]>
This patch adds a sysfs-attribute 'status' to make the DASD device-status accessible from user-space. In addition, the DASD driver generates an uevent(CHANGE) for the ccw-device on each device-status change. This enables user-space applications (e.g. udev) to do related processing.
---
drivers/s390/block/dasd.c | 3 ++ drivers/s390/block/dasd_devmap.c | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+)
drivers/s390/block/dasd.c +3 -0
@@ -398,6 +398,9 @@ dasd_change_state(struct dasd_device *deif (device->state == device->target)wake_up (&dasd_init_waitq); + +/* let user-space know that the device status changed */ +kobject_uevent (&device->cdev->dev.kobj,KOBJ_CHANGE ); }/*
drivers/s390/block/dasd_devmap.c +41 -0
53 lines not on this page · raw message
PATCH 7/8 dasd: Add ipldev parameter.
In reply to Heiko CarstensFrom: Peter Oberparleiter <[email protected]>
Specifying 'ipldev' in the dasd= kernel parameter will automatically activate the boot device for use by the dasd driver.
---
drivers/s390/block/dasd_devmap.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+)
drivers/s390/block/dasd_devmap.c +17 -0
@@ -19,6 +19,7 @@#include <asm/debug.h> #include <asm/uaccess.h> +#include <asm/ipl.h> /* This is ugly... */ #define PRINTK_HEADER "dasd_devmap:"
@@ -133,6 +134,8 @@ dasd_call_setup(char *str)__setup ("dasd=" , dasd_call_setup);#endif /* #ifndef MODULE */ +#define DASD_IPLDEV "ipldev" +/* * Read a device busid/devno from a string. */
@@ -141,6 +144,20 @@ dasd_busid(char **str, int *id0, int *id {int val, old_style; +/* Interpret ipldev busid */ +if (strncmp (DASD_IPLDEV , *str,strlen (DASD_IPLDEV )) ==0 ) { +if (ipl_info.type !=IPL_TYPE_CCW ) { +MESSAGE (KERN_ERR ,"%s" ,"ipl device is not a ccw " +"device" ); +return -EINVAL ; + } + *id0 =0 ; + *id1 = ipl_info.data.ccw.dev_id.ssid; + *devno = ipl_info.data.ccw.dev_id.devno; + *str +=strlen (DASD_IPLDEV ); + +return 0 ; + }/* check for leading '0x' */ old_style =0 ;if ((*str)[0 ] =='0' && (*str)[1 ] =='x' ) {
PATCH 8/8 zfcpdump support.
In reply to Heiko CarstensFrom: Michael Holzheu <[email protected]>
s390 machines provide hardware support for creating Linux dumps on SCSI disks. For creating a dump a special purpose dump Linux is used. The first 32 MB of memory are saved by the hardware before the dump Linux is booted. Via an SCLP interface, the saved memory can be accessed from Linux. This patch exports memory and registers of the crashed Linux to userspace via a debugfs file. For more information refer to Documentation/s390/zfcpdump.txt, which is included in this patch.
---
Documentation/s390/zfcpdump.txt | 87 +++++ arch/s390/Kconfig | 8 arch/s390/Makefile | 3 arch/s390/defconfig | 1 arch/s390/kernel/head64.S | 72 ++++ arch/s390/kernel/ipl.c | 232 +++++++++----- arch/s390/kernel/setup.c | 38 ++ arch/s390/kernel/smp.c | 62 +++ drivers/s390/char/Makefile | 3 drivers/s390/char/sclp.h | 2 drivers/s390/char/sclp_sdias.c | 255 +++++++++++++++ drivers/s390/char/zcore.c | 651 ++++++++++++++++++++++++++++++++++++++++ include/asm-s390/ipl.h | 32 + include/asm-s390/lowcore.h | 46 ++ include/asm-s390/sclp.h | 2 include/asm-s390/setup.h | 2 include/asm-s390/smp.h | 1 17 files changed, 1411 insertions(+), 86 deletions(-)
arch/s390/defconfig +1 -0
@@ -167,6 +167,7 @@ CONFIG_NO_IDLE_HZ=y CONFIG_NO_IDLE_HZ_INIT=y CONFIG_S390_HYPFS_FS=y CONFIG_KEXEC=y +# CONFIG_ZFCPDUMP is not set # # Networking
arch/s390/Kconfig +8 -0
@@ -519,6 +519,14 @@ config KEXEC current kernel, and to start another kernel. It is like a reboot but is independent of hardware/microcode support. +config ZFCPDUMP + tristate "zfcpdump support" + select SMP + default n + help + Select this option if you want to build an zfcpdump enabled kernel. + Refer to "Documentation/s390/zfcpdump.txt" for more details on this. + endmenu source "net/Kconfig"
arch/s390/kernel/head64.S +71 -1
84 lines not on this page · raw message
arch/s390/kernel/ipl.c +150 -82
450 lines not on this page · raw message
arch/s390/kernel/setup.c +35 -3
@@ -285,6 +285,26 @@ static void __init conmode_default(void) } } +#if defined(CONFIG_ZFCPDUMP ) || defined(CONFIG_ZFCPDUMP_MODULE ) +static void __init setup_zfcpdump (unsigned int console_devno) +{ +static char str[64 ]; + +if (ipl_info.type !=IPL_TYPE_FCP_DUMP ) +return ; +if (console_devno !=-1 ) +sprintf (str,"cio_ignore=all,!0.0.%04x,!0.0.%04x" , + ipl_info.data.fcp.dev_id.devno, console_devno); +else +sprintf (str,"cio_ignore=all,!0.0.%04x" , + ipl_info.data.fcp.dev_id.devno); +strcat (COMMAND_LINE , str); + console_loglevel =2 ; +} +#else +static inline void setup_zfcpdump (unsigned int console_devno) {} +#endif /* CONFIG_ZFCPDUMP */ +#ifdef CONFIG_SMP void (*_machine_restart)(char *command) = machine_restart_smp;void (*_machine_halt)(void ) = machine_halt_smp;
@@ -586,13 +606,20 @@ setup_resources(void) } } +unsigned long real_memory_size; +EXPORT_SYMBOL_GPL (real_memory_size); +static void __init setup_memory_end (void ) { -unsigned long real_size, memory_size; +unsigned long memory_size;unsigned long max_mem, max_phys;int i; - memory_size = real_size =0 ; +#if defined(CONFIG_ZFCPDUMP ) || defined(CONFIG_ZFCPDUMP_MODULE ) +if (ipl_info.type ==IPL_TYPE_FCP_DUMP ) + memory_end =ZFCPDUMP_HSA_SIZE ; +#endif + memory_size =0 ; max_phys =VMALLOC_END_INIT -VMALLOC_MIN_SIZE ; memory_end &=PAGE_MASK ;
@@ -601,7 +628,8 @@ static void __init setup_memory_end(voidfor (i =0 ; i <MEMORY_CHUNKS ; i++) {struct mem_chunk *chunk = &memory_chunk[i]; - real_size =max (real_size, chunk->addr + chunk->size); + real_memory_size =max (real_memory_size, + chunk->addr + chunk->size);if (chunk->addr >= max_mem) {memset (chunk,0 ,sizeof (*chunk));continue ;
@@ -765,6 +793,7 @@ setup_arch(char **cmdline_p)parse_early_param (); +setup_ipl_info ();setup_memory_end ();setup_addressing_mode ();setup_memory ();
@@ -782,6 +811,9 @@ setup_arch(char **cmdline_p)/* Setup default console */ conmode_default (); + +/* Setup zfcpdump support */ +setup_zfcpdump (console_devno); }void print_cpu_info (struct cpuinfo_S390 *cpuinfo)
arch/s390/kernel/smp.c +62 -0
86 lines not on this page · raw message
arch/s390/Makefile +3 -0
@@ -105,6 +105,9 @@ install: vmlinux image: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ +zfcpdump: + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ + archclean: $(Q)$(MAKE) $(clean)=$(boot)
Documentation/s390/zfcpdump.txt new file +87 -0
87 lines not on this page · raw message
drivers/s390/char/Makefile +3 -0
@@ -29,3 +29,6 @@ obj-$(CONFIG_S390_TAPE_34XX) += tape_34x obj-$(CONFIG_S390_TAPE_3590) += tape_3590.o obj-$(CONFIG_MONREADER) += monreader.o obj-$(CONFIG_MONWRITER) += monwriter.o + +zcore_mod-objs := sclp_sdias.o zcore.o +obj-$(CONFIG_ZFCPDUMP) += zcore_mod.o
drivers/s390/char/sclp.h +2 -0
@@ -28,6 +28,7 @@#define EvTyp_SigQuiesce 0x1D#define EvTyp_VT220Msg 0x1A#define EvTyp_ConfMgmData 0x04 +#define EvTyp_SDIAS 0x1C#define EvTyp_OpCmd_Mask 0x80000000#define EvTyp_Msg_Mask 0x40000000
@@ -38,6 +39,7 @@#define EvTyp_SigQuiesce_Mask 0x00000008#define EvTyp_VT220Msg_Mask 0x00000040#define EvTyp_ConfMgmData_Mask 0x10000000 +#define EvTyp_SDIAS_Mask 0x00000010#define GnrlMsgFlgs_DOM 0x8000#define GnrlMsgFlgs_SndAlrm 0x4000
drivers/s390/char/sclp_sdias.c new file +255 -0
255 lines not on this page · raw message
drivers/s390/char/zcore.c new file +651 -0
651 lines not on this page · raw message
include/asm-s390/ipl.h +32 -0
@@ -8,6 +8,8 @@#define _ASM_S390_IPL_H#include <asm/types.h> +#include <asm/cio.h> +#include <asm/setup.h> #define IPL_PARMBLOCK_ORIGIN 0x2000
@@ -79,6 +81,7 @@ struct ipl_parameter_block {extern u32 ipl_flags;extern u32 dump_prefix_page; +extern void do_reipl (void );extern void ipl_save_parameters (void );
@@ -88,6 +91,35 @@ enum { IPL_NSS_VALID = 4, }; +enum ipl_type { +IPL_TYPE_UNKNOWN =1 , +IPL_TYPE_CCW =2 , +IPL_TYPE_FCP =4 , +IPL_TYPE_FCP_DUMP =8 , +IPL_TYPE_NSS =16 , +}; + +struct ipl_info +{ +enum ipl_type type; +union { +struct { +struct ccw_dev_id dev_id; + } ccw; +struct { +struct ccw_dev_id dev_id; +u64 wwpn; +u64 lun; + } fcp; +struct { +char name[NSS_NAME_SIZE +1 ]; + } nss; + } data; +}; + +extern struct ipl_info ipl_info; +extern void setup_ipl_info (void ); +/* * DIAG 308 support */
include/asm-s390/lowcore.h +46 -0
52 lines not on this page · raw message
include/asm-s390/sclp.h +2 -0
@@ -44,6 +44,8 @@ struct sclp_chp_info {extern struct sclp_readinfo_sccb s390_readinfo_sccb;extern void sclp_readinfo_early (void ); +extern int sclp_sdias_blk_count (void ); +extern int sclp_sdias_copy (void *dest,int blk_num,int nr_blks);extern int sclp_chp_configure (struct chp_id chpid);extern int sclp_chp_deconfigure (struct chp_id chpid);extern int sclp_chp_read_info (struct sclp_chp_info *info);
include/asm-s390/setup.h +2 -0
@@ -40,6 +40,7 @@ struct mem_chunk { };extern struct mem_chunk memory_chunk[]; +extern unsigned long real_memory_size;#ifdef CONFIG_S390_SWITCH_AMODE extern unsigned int switch_amode;
@@ -77,6 +78,7 @@ extern unsigned long machine_flags;#endif /* __s390x__ */ #define MACHINE_HAS_SCLP (!MACHINE_IS_P390) +#define ZFCPDUMP_HSA_SIZE (32UL<<20)/* * Console mode. Override with conmode=
include/asm-s390/smp.h +1 -0
@@ -119,4 +119,5 @@ static inline void smp_send_stop(void)#define smp_setup_cpu_possible_map () do { } while (0)#endif +extern union save_area *zfcpdump_save_areas[NR_CPUS +1 ];#endif