diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-06-16 04:30:20 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-16 04:31:08 -0400 |
commit | 823d494ac11111064cf39abd4178ce299414c771 (patch) | |
tree | ede15540ad89c3412f16c24770408a4c34cc032c /drivers/s390/cio/device_ops.c | |
parent | 03347e2592078a90df818670fddf97a33eec70fb (diff) |
[S390] pm: ccw bus power management callbacks
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device_ops.c')
-rw-r--r-- | drivers/s390/cio/device_ops.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index bf0a24af39a0..2d0efee8a290 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c | |||
@@ -1,10 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/s390/cio/device_ops.c | 2 | * Copyright IBM Corp. 2002, 2009 |
3 | * | 3 | * |
4 | * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, | 4 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) |
5 | * IBM Corporation | 5 | * Cornelia Huck (cornelia.huck@de.ibm.com) |
6 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) | ||
7 | * Cornelia Huck (cornelia.huck@de.ibm.com) | ||
8 | */ | 6 | */ |
9 | #include <linux/module.h> | 7 | #include <linux/module.h> |
10 | #include <linux/init.h> | 8 | #include <linux/init.h> |
@@ -116,12 +114,15 @@ int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) | |||
116 | 114 | ||
117 | if (!cdev || !cdev->dev.parent) | 115 | if (!cdev || !cdev->dev.parent) |
118 | return -ENODEV; | 116 | return -ENODEV; |
117 | sch = to_subchannel(cdev->dev.parent); | ||
118 | if (!sch->schib.pmcw.ena) | ||
119 | return -EINVAL; | ||
119 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 120 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
120 | return -ENODEV; | 121 | return -ENODEV; |
121 | if (cdev->private->state != DEV_STATE_ONLINE && | 122 | if (cdev->private->state != DEV_STATE_ONLINE && |
122 | cdev->private->state != DEV_STATE_W4SENSE) | 123 | cdev->private->state != DEV_STATE_W4SENSE) |
123 | return -EINVAL; | 124 | return -EINVAL; |
124 | sch = to_subchannel(cdev->dev.parent); | 125 | |
125 | ret = cio_clear(sch); | 126 | ret = cio_clear(sch); |
126 | if (ret == 0) | 127 | if (ret == 0) |
127 | cdev->private->intparm = intparm; | 128 | cdev->private->intparm = intparm; |
@@ -162,6 +163,8 @@ int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa, | |||
162 | if (!cdev || !cdev->dev.parent) | 163 | if (!cdev || !cdev->dev.parent) |
163 | return -ENODEV; | 164 | return -ENODEV; |
164 | sch = to_subchannel(cdev->dev.parent); | 165 | sch = to_subchannel(cdev->dev.parent); |
166 | if (!sch->schib.pmcw.ena) | ||
167 | return -EINVAL; | ||
165 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 168 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
166 | return -ENODEV; | 169 | return -ENODEV; |
167 | if (cdev->private->state == DEV_STATE_VERIFY || | 170 | if (cdev->private->state == DEV_STATE_VERIFY || |
@@ -337,12 +340,15 @@ int ccw_device_halt(struct ccw_device *cdev, unsigned long intparm) | |||
337 | 340 | ||
338 | if (!cdev || !cdev->dev.parent) | 341 | if (!cdev || !cdev->dev.parent) |
339 | return -ENODEV; | 342 | return -ENODEV; |
343 | sch = to_subchannel(cdev->dev.parent); | ||
344 | if (!sch->schib.pmcw.ena) | ||
345 | return -EINVAL; | ||
340 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 346 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
341 | return -ENODEV; | 347 | return -ENODEV; |
342 | if (cdev->private->state != DEV_STATE_ONLINE && | 348 | if (cdev->private->state != DEV_STATE_ONLINE && |
343 | cdev->private->state != DEV_STATE_W4SENSE) | 349 | cdev->private->state != DEV_STATE_W4SENSE) |
344 | return -EINVAL; | 350 | return -EINVAL; |
345 | sch = to_subchannel(cdev->dev.parent); | 351 | |
346 | ret = cio_halt(sch); | 352 | ret = cio_halt(sch); |
347 | if (ret == 0) | 353 | if (ret == 0) |
348 | cdev->private->intparm = intparm; | 354 | cdev->private->intparm = intparm; |
@@ -369,6 +375,8 @@ int ccw_device_resume(struct ccw_device *cdev) | |||
369 | if (!cdev || !cdev->dev.parent) | 375 | if (!cdev || !cdev->dev.parent) |
370 | return -ENODEV; | 376 | return -ENODEV; |
371 | sch = to_subchannel(cdev->dev.parent); | 377 | sch = to_subchannel(cdev->dev.parent); |
378 | if (!sch->schib.pmcw.ena) | ||
379 | return -EINVAL; | ||
372 | if (cdev->private->state == DEV_STATE_NOT_OPER) | 380 | if (cdev->private->state == DEV_STATE_NOT_OPER) |
373 | return -ENODEV; | 381 | return -ENODEV; |
374 | if (cdev->private->state != DEV_STATE_ONLINE || | 382 | if (cdev->private->state != DEV_STATE_ONLINE || |
@@ -580,6 +588,8 @@ int ccw_device_tm_start_key(struct ccw_device *cdev, struct tcw *tcw, | |||
580 | int rc; | 588 | int rc; |
581 | 589 | ||
582 | sch = to_subchannel(cdev->dev.parent); | 590 | sch = to_subchannel(cdev->dev.parent); |
591 | if (!sch->schib.pmcw.ena) | ||
592 | return -EINVAL; | ||
583 | if (cdev->private->state != DEV_STATE_ONLINE) | 593 | if (cdev->private->state != DEV_STATE_ONLINE) |
584 | return -EIO; | 594 | return -EIO; |
585 | /* Adjust requested path mask to excluded varied off paths. */ | 595 | /* Adjust requested path mask to excluded varied off paths. */ |
@@ -669,6 +679,8 @@ int ccw_device_tm_intrg(struct ccw_device *cdev) | |||
669 | { | 679 | { |
670 | struct subchannel *sch = to_subchannel(cdev->dev.parent); | 680 | struct subchannel *sch = to_subchannel(cdev->dev.parent); |
671 | 681 | ||
682 | if (!sch->schib.pmcw.ena) | ||
683 | return -EINVAL; | ||
672 | if (cdev->private->state != DEV_STATE_ONLINE) | 684 | if (cdev->private->state != DEV_STATE_ONLINE) |
673 | return -EIO; | 685 | return -EIO; |
674 | if (!scsw_is_tm(&sch->schib.scsw) || | 686 | if (!scsw_is_tm(&sch->schib.scsw) || |