diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2009-06-16 04:30:24 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-16 04:31:10 -0400 |
commit | ad285ae9fc6b9c0058f2a558b43fe8817685ebfa (patch) | |
tree | 677a75b89e502c4ea4b9f64ec1af080fe6dd0919 /drivers/s390 | |
parent | 93a275921daf83e6e4efbafdd82712bcaa93f491 (diff) |
[S390] pm: chsc subchannel driver power management callbacks
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/cio/chsc_sch.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index 93eca1731b81..cc5144b6f9d9 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
@@ -1,7 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for s390 chsc subchannels | 2 | * Driver for s390 chsc subchannels |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008 | 4 | * Copyright IBM Corp. 2008, 2009 |
5 | * | ||
5 | * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> | 6 | * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> |
6 | * | 7 | * |
7 | */ | 8 | */ |
@@ -112,6 +113,31 @@ static void chsc_subchannel_shutdown(struct subchannel *sch) | |||
112 | cio_disable_subchannel(sch); | 113 | cio_disable_subchannel(sch); |
113 | } | 114 | } |
114 | 115 | ||
116 | static int chsc_subchannel_prepare(struct subchannel *sch) | ||
117 | { | ||
118 | int cc; | ||
119 | struct schib schib; | ||
120 | /* | ||
121 | * Don't allow suspend while the subchannel is not idle | ||
122 | * since we don't have a way to clear the subchannel and | ||
123 | * cannot disable it with a request running. | ||
124 | */ | ||
125 | cc = stsch(sch->schid, &schib); | ||
126 | if (!cc && scsw_stctl(&schib.scsw)) | ||
127 | return -EAGAIN; | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | static int chsc_subchannel_freeze(struct subchannel *sch) | ||
132 | { | ||
133 | return cio_disable_subchannel(sch); | ||
134 | } | ||
135 | |||
136 | static int chsc_subchannel_restore(struct subchannel *sch) | ||
137 | { | ||
138 | return cio_enable_subchannel(sch, (u32)(unsigned long)sch); | ||
139 | } | ||
140 | |||
115 | static struct css_device_id chsc_subchannel_ids[] = { | 141 | static struct css_device_id chsc_subchannel_ids[] = { |
116 | { .match_flags = 0x1, .type =SUBCHANNEL_TYPE_CHSC, }, | 142 | { .match_flags = 0x1, .type =SUBCHANNEL_TYPE_CHSC, }, |
117 | { /* end of list */ }, | 143 | { /* end of list */ }, |
@@ -125,6 +151,10 @@ static struct css_driver chsc_subchannel_driver = { | |||
125 | .probe = chsc_subchannel_probe, | 151 | .probe = chsc_subchannel_probe, |
126 | .remove = chsc_subchannel_remove, | 152 | .remove = chsc_subchannel_remove, |
127 | .shutdown = chsc_subchannel_shutdown, | 153 | .shutdown = chsc_subchannel_shutdown, |
154 | .prepare = chsc_subchannel_prepare, | ||
155 | .freeze = chsc_subchannel_freeze, | ||
156 | .thaw = chsc_subchannel_restore, | ||
157 | .restore = chsc_subchannel_restore, | ||
128 | .name = "chsc_subchannel", | 158 | .name = "chsc_subchannel", |
129 | }; | 159 | }; |
130 | 160 | ||