From 818c272bd74b834c3ca9347c6a540c2ec880afdc Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Thu, 22 Apr 2010 17:17:03 +0200 Subject: [S390] cio: allow enable_facility from outside init functions Prepare chsc_enable_facility to be used from outside init functions. Use static memory for the chsc call and protect its access by a spinlock (although there is no concurrent usage). Cc: Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/css.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'drivers/s390/cio/css.c') diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 2769da54f2b..19635d47ded 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -870,15 +870,10 @@ static int __init css_bus_init(void) /* Try to enable MSS. */ ret = chsc_enable_facility(CHSC_SDA_OC_MSS); - switch (ret) { - case 0: /* Success. */ - max_ssid = __MAX_SSID; - break; - case -ENOMEM: - goto out; - default: + if (ret) max_ssid = 0; - } + else /* Success. */ + max_ssid = __MAX_SSID; ret = slow_subchannel_init(); if (ret) -- cgit v1.2.3-70-g09d2 From 889ee9556c89a877b8343b6bbe6ac8dc5d57e433 Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Thu, 22 Apr 2010 17:17:04 +0200 Subject: [S390] add hook to reenable mss after hibernation Reenable multiple subchannel sets after hibernation, prior to the device callbacks. Cc: Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/swsusp_asm64.S | 3 +++ drivers/s390/cio/css.c | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'drivers/s390/cio/css.c') diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S index b354427e03b..c56d3f56d02 100644 --- a/arch/s390/kernel/swsusp_asm64.S +++ b/arch/s390/kernel/swsusp_asm64.S @@ -256,6 +256,9 @@ restore_registers: lghi %r2,0 brasl %r14,arch_set_page_states + /* Reinitialize the channel subsystem */ + brasl %r14,channel_subsystem_reinit + /* Return 0 */ lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15) lghi %r2,0 diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 19635d47ded..511649115bd 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -1043,6 +1043,11 @@ static int __init channel_subsystem_init_sync(void) } subsys_initcall_sync(channel_subsystem_init_sync); +void channel_subsystem_reinit(void) +{ + chsc_enable_facility(CHSC_SDA_OC_MSS); +} + #ifdef CONFIG_PROC_FS static ssize_t cio_settle_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) -- cgit v1.2.3-70-g09d2