diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-03-31 19:16:03 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-31 19:17:03 +0200 |
commit | 156013ffd1225ef862853a4340b46f76845f8db1 (patch) | |
tree | 0e6b202a111a483b9f44961508b3694dc0022df9 /drivers/s390/cio/device.c | |
parent | [S390] fix hypfs build failure (diff) | |
download | linux-156013ffd1225ef862853a4340b46f76845f8db1.tar.xz linux-156013ffd1225ef862853a4340b46f76845f8db1.zip |
[S390] cio: wake up on failed recognition
Wake up even on failed device recognition, since this may be triggered
from a user trying to force a device online. With this patch a write
to the online sysfs attribute will not block for ever but return with
-EAGAIN in this case.
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.c')
-rw-r--r-- | drivers/s390/cio/device.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index c4d2f667a2f6..9f016fef6101 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -482,17 +482,21 @@ static int online_store_recog_and_online(struct ccw_device *cdev) } wait_event(cdev->private->wait_q, cdev->private->flags.recog_done); + if (cdev->private->state != DEV_STATE_OFFLINE) + /* recognition failed */ + return -EAGAIN; } if (cdev->drv && cdev->drv->set_online) ccw_device_set_online(cdev); return 0; } + static int online_store_handle_online(struct ccw_device *cdev, int force) { int ret; ret = online_store_recog_and_online(cdev); - if (ret) + if (ret && !force) return ret; if (force && cdev->private->state == DEV_STATE_BOXED) { ret = ccw_device_stlck(cdev); @@ -500,7 +504,9 @@ static int online_store_handle_online(struct ccw_device *cdev, int force) return ret; if (cdev->id.cu_type == 0) cdev->private->state = DEV_STATE_NOT_OPER; - online_store_recog_and_online(cdev); + ret = online_store_recog_and_online(cdev); + if (ret) + return ret; } return 0; } |