s390: path grouping and path verifications fixes.
Subsystems (2)
PATCH 1/1 s390: path grouping and path verifications fixes.
From: Cornelia Huck <[email protected]>
[S390] path grouping and path verifications fixes.
1. Multipath devices for which SetPGID is not supported are not handled well. Use NOP ccws for path verification (sans path grouping) when SetPGID is not supported.
2. Check for PGIDs already set with SensePGID on _all_ paths (not just the first one) and try to find a common one. Moan if no common PGID can be found (and use NOP verification). If no PGIDs have been set, use the css global PGID (as before). (Rationale: SetPGID will get a command reject if the PGID it tries to set does not match the already set PGID.)
3. Immediately before reboot, issue RESET CHANNEL PATH (rcp) on all chpids. This will remove the old PGIDs. rcp will generate solicited CRWs which can be savely ignored by the machine check handler (all other actions create unsolicited CRWs).
---
arch/s390/kernel/machine_kexec.c | 1 drivers/s390/cio/chsc.c | 34 ++++++++++ drivers/s390/cio/cio.c | 1 drivers/s390/cio/css.c | 12 ++- drivers/s390/cio/css.h | 2 drivers/s390/cio/device_fsm.c | 85 +++++++++++++++++++++------ drivers/s390/cio/device_pgid.c | 122 +++++++++++++++++++++++++++++++-------- drivers/s390/cio/device_status.c | 7 -- drivers/s390/s390mach.c | 10 +++ include/asm-s390/cio.h | 2 10 files changed, 228 insertions(+), 48 deletions(-)
arch/s390/kernel/machine_kexec.c +1 -0
@@ -63,6 +63,7 @@ NORET_TYPE void machine_kexec(struct kimage *image) {clear_all_subchannels (); +cio_reset_channel_paths ();/* Disable lowcore protection */ ctl_clear_bit (0 ,28 );
drivers/s390/cio/chsc.c +34 -0
@@ -1464,6 +1464,40 @@ chsc_get_chp_desc(struct subchannel *schreturn desc; } +static int reset_channel_path (struct channel_path *chp) +{ +int cc; + + cc =rchp (chp->id); +switch (cc) { +case 0 : +return 0 ; +case 2 : +return -EBUSY ; +default : +return -ENODEV ; + } +} + +static void reset_channel_paths_css (struct channel_subsystem *css) +{ +int i; + +for (i =0 ; i <= __MAX_CHPID; i++) { +if (css->chps[i]) +reset_channel_path (css->chps[i]); + } +} + +void cio_reset_channel_paths (void ) +{ +int i; + +for (i =0 ; i <= __MAX_CSSID; i++) { +if (css[i] && css[i]->valid) +reset_channel_paths_css (css[i]); + } +}static int __init chsc_alloc_sei_area (void )
drivers/s390/cio/cio.c +1 -0
@@ -876,5 +876,6 @@ void reipl(unsigned long devno) {clear_all_subchannels (); +cio_reset_channel_paths ();do_reipl (devno); }
drivers/s390/cio/css.c +9 -3
@@ -623,9 +623,13 @@ init_channel_subsystem (void) ret =device_register (&css[i]->device);if (ret) goto out_free; -if (css_characteristics_avail && css_chsc_characteristics.secm) -device_create_file (&css[i]->device, - &dev_attr_cm_enable); +if (css_characteristics_avail && + css_chsc_characteristics.secm) { + ret =device_create_file (&css[i]->device, + &dev_attr_cm_enable); +if (ret) + goto out_device; + } } css_init_done =1 ;
@@ -633,6 +637,8 @@ init_channel_subsystem (void)for_each_subchannel (__init_channel_subsystem,NULL );return 0 ; +out_device: +device_unregister (&css[i]->device); out_free:kfree (css[i]); out_unregister:
drivers/s390/cio/css.h +1 -1
@@ -100,7 +100,7 @@ struct ccw_device_private {struct qdio_irq *qdio_data;struct irb irb;/* device status */ struct senseid senseid;/* SenseID info */ -struct pgid pgid;/* path group ID */ +struct pgid pgid[8 ];/* path group IDs per chpid*/ struct ccw1 iccws[2 ];/* ccws for SNID/SID/SPGID commands */ struct work_struct kick_work;wait_queue_head_t wait_q;
drivers/s390/cio/device_fsm.c +68 -17
128 lines not on this page · raw message
drivers/s390/cio/device_pgid.c +99 -23
228 lines not on this page · raw message
drivers/s390/cio/device_status.c +3 -4
@@ -67,8 +67,7 @@ ccw_device_path_notoper(struct ccw_devic sch->schib.pmcw.pnom); sch->lpm &= ~sch->schib.pmcw.pnom; -if (cdev->private->options.pgroup) - cdev->private->flags.doverify =1 ; + cdev->private->flags.doverify =1 ; }/*
@@ -180,7 +179,7 @@ ccw_device_accumulate_esw(struct ccw_dev cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth;/* Copy path verification required flag. */ cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf; -if (irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) +if (irb->esw.esw0.erw.pvrf) cdev->private->flags.doverify =1 ;/* Copy concurrent sense bit. */ cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons;
@@ -354,7 +353,7 @@ ccw_device_accumulate_basic_sense(struct }/* Check if path verification is required. */ if (ccw_device_accumulate_esw_valid (irb) && - irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) + irb->esw.esw0.erw.pvrf) cdev->private->flags.doverify =1 ; }
drivers/s390/s390mach.c +10 -0
@@ -111,6 +111,16 @@ repeat:break ;case CRW_RSC_CPATH :pr_debug ("source is channel path %02X\n" , crw[0 ].rsid); +/* +* Check for solicited machine checks. These are +* created by reset channel path and need not be +* reported to the common I/O layer. +*/ +if (crw[chain].slct) { +DBG (KERN_INFO "solicited machine check for " +"channel path %02X\n" , crw[0 ].rsid); +break ; + }switch (crw[0 ].erc) {case CRW_ERC_IPARM :/* Path has come. */ ret =chp_process_crw (crw[0 ].rsid,1 );
include/asm-s390/cio.h +2 -0
@@ -276,6 +276,8 @@ extern void wait_cons_dev(void);extern void clear_all_subchannels (void ); +extern void cio_reset_channel_paths (void ); +extern void css_schedule_reprobe (void );#endif