Skip to content

Commit

Permalink
[S390] pm: chsc subchannel driver power management callbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Cornelia Huck <[email protected]>
Signed-off-by: Sebastian Ott <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
cohuck authored and Martin Schwidefsky committed Jun 16, 2009
1 parent 93a2759 commit ad285ae
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion drivers/s390/cio/chsc_sch.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
* Driver for s390 chsc subchannels
*
* Copyright IBM Corp. 2008
* Copyright IBM Corp. 2008, 2009
*
* Author(s): Cornelia Huck <[email protected]>
*
*/
Expand Down Expand Up @@ -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 */ },
Expand All @@ -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",
};

Expand Down

0 comments on commit ad285ae

Please sign in to comment.