From 551216f0da924b856e17d045b6455eb9e4471f37 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Tue, 16 Jun 2009 10:30:24 +0200 Subject: [PATCH] --- yaml --- r: 151100 b: refs/heads/master c: ad285ae9fc6b9c0058f2a558b43fe8817685ebfa h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/s390/cio/chsc_sch.c | 32 ++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 8d19512b8a32..17fa51acb0a6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 93a275921daf83e6e4efbafdd82712bcaa93f491 +refs/heads/master: ad285ae9fc6b9c0058f2a558b43fe8817685ebfa diff --git a/trunk/drivers/s390/cio/chsc_sch.c b/trunk/drivers/s390/cio/chsc_sch.c index 93eca1731b81..cc5144b6f9d9 100644 --- a/trunk/drivers/s390/cio/chsc_sch.c +++ b/trunk/drivers/s390/cio/chsc_sch.c @@ -1,7 +1,8 @@ /* * Driver for s390 chsc subchannels * - * Copyright IBM Corp. 2008 + * Copyright IBM Corp. 2008, 2009 + * * Author(s): Cornelia Huck * */ @@ -112,6 +113,31 @@ static void chsc_subchannel_shutdown(struct subchannel *sch) cio_disable_subchannel(sch); } +static int chsc_subchannel_prepare(struct subchannel *sch) +{ + int cc; + struct schib schib; + /* + * Don't allow suspend while the subchannel is not idle + * since we don't have a way to clear the subchannel and + * cannot disable it with a request running. + */ + cc = stsch(sch->schid, &schib); + if (!cc && scsw_stctl(&schib.scsw)) + return -EAGAIN; + return 0; +} + +static int chsc_subchannel_freeze(struct subchannel *sch) +{ + return cio_disable_subchannel(sch); +} + +static int chsc_subchannel_restore(struct subchannel *sch) +{ + return cio_enable_subchannel(sch, (u32)(unsigned long)sch); +} + static struct css_device_id chsc_subchannel_ids[] = { { .match_flags = 0x1, .type =SUBCHANNEL_TYPE_CHSC, }, { /* end of list */ }, @@ -125,6 +151,10 @@ static struct css_driver chsc_subchannel_driver = { .probe = chsc_subchannel_probe, .remove = chsc_subchannel_remove, .shutdown = chsc_subchannel_shutdown, + .prepare = chsc_subchannel_prepare, + .freeze = chsc_subchannel_freeze, + .thaw = chsc_subchannel_restore, + .restore = chsc_subchannel_restore, .name = "chsc_subchannel", };