diff options
author | Frank Munzert <munzert@de.ibm.com> | 2009-06-16 04:30:37 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-16 04:31:15 -0400 |
commit | b241f7bcc603babd3de903fa855d418ee7c4751d (patch) | |
tree | 6902ccad5d5e6a3bce3194d17bf703133797afe5 /drivers/s390/char/vmur.c | |
parent | 524dbcdad7a84a054b4458aa94e152ffb2bfabbd (diff) |
[S390] pm: vmur driver power management callbacks
Signed-off-by: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/vmur.c')
-rw-r--r-- | drivers/s390/char/vmur.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 5dcef81fc9d9..92458219a9e9 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Linux driver for System z and s390 unit record devices | 2 | * Linux driver for System z and s390 unit record devices |
3 | * (z/VM virtual punch, reader, printer) | 3 | * (z/VM virtual punch, reader, printer) |
4 | * | 4 | * |
5 | * Copyright IBM Corp. 2001, 2007 | 5 | * Copyright IBM Corp. 2001, 2009 |
6 | * Authors: Malcolm Beattie <beattiem@uk.ibm.com> | 6 | * Authors: Malcolm Beattie <beattiem@uk.ibm.com> |
7 | * Michael Holzheu <holzheu@de.ibm.com> | 7 | * Michael Holzheu <holzheu@de.ibm.com> |
8 | * Frank Munzert <munzert@de.ibm.com> | 8 | * Frank Munzert <munzert@de.ibm.com> |
@@ -60,6 +60,7 @@ static int ur_probe(struct ccw_device *cdev); | |||
60 | static void ur_remove(struct ccw_device *cdev); | 60 | static void ur_remove(struct ccw_device *cdev); |
61 | static int ur_set_online(struct ccw_device *cdev); | 61 | static int ur_set_online(struct ccw_device *cdev); |
62 | static int ur_set_offline(struct ccw_device *cdev); | 62 | static int ur_set_offline(struct ccw_device *cdev); |
63 | static int ur_pm_suspend(struct ccw_device *cdev); | ||
63 | 64 | ||
64 | static struct ccw_driver ur_driver = { | 65 | static struct ccw_driver ur_driver = { |
65 | .name = "vmur", | 66 | .name = "vmur", |
@@ -69,6 +70,7 @@ static struct ccw_driver ur_driver = { | |||
69 | .remove = ur_remove, | 70 | .remove = ur_remove, |
70 | .set_online = ur_set_online, | 71 | .set_online = ur_set_online, |
71 | .set_offline = ur_set_offline, | 72 | .set_offline = ur_set_offline, |
73 | .freeze = ur_pm_suspend, | ||
72 | }; | 74 | }; |
73 | 75 | ||
74 | static DEFINE_MUTEX(vmur_mutex); | 76 | static DEFINE_MUTEX(vmur_mutex); |
@@ -158,6 +160,28 @@ static void urdev_put(struct urdev *urd) | |||
158 | } | 160 | } |
159 | 161 | ||
160 | /* | 162 | /* |
163 | * State and contents of ur devices can be changed by class D users issuing | ||
164 | * CP commands such as PURGE or TRANSFER, while the Linux guest is suspended. | ||
165 | * Also the Linux guest might be logged off, which causes all active spool | ||
166 | * files to be closed. | ||
167 | * So we cannot guarantee that spool files are still the same when the Linux | ||
168 | * guest is resumed. In order to avoid unpredictable results at resume time | ||
169 | * we simply refuse to suspend if a ur device node is open. | ||
170 | */ | ||
171 | static int ur_pm_suspend(struct ccw_device *cdev) | ||
172 | { | ||
173 | struct urdev *urd = cdev->dev.driver_data; | ||
174 | |||
175 | TRACE("ur_pm_suspend: cdev=%p\n", cdev); | ||
176 | if (urd->open_flag) { | ||
177 | pr_err("Unit record device %s is busy, %s refusing to " | ||
178 | "suspend.\n", dev_name(&cdev->dev), ur_banner); | ||
179 | return -EBUSY; | ||
180 | } | ||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | /* | ||
161 | * Low-level functions to do I/O to a ur device. | 185 | * Low-level functions to do I/O to a ur device. |
162 | * alloc_chan_prog | 186 | * alloc_chan_prog |
163 | * free_chan_prog | 187 | * free_chan_prog |