diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2010-02-26 22:37:27 +0100 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-02-26 22:37:29 +0100 |
commit | b4c707214c987da021d4d5c4ed54612cf73d80d6 (patch) | |
tree | d31dffc6de708a7069e59925a6fa4080138c90e6 /drivers/s390/cio/css.c | |
parent | b4563e891a043fe521e62f6f621b928641474ff3 (diff) | |
download | blackbird-op-linux-b4c707214c987da021d4d5c4ed54612cf73d80d6.tar.gz blackbird-op-linux-b4c707214c987da021d4d5c4ed54612cf73d80d6.zip |
[S390] cio: make wait_events interruptible
Make the potentially long blocking wait_event's used by the cio
settle mechanism interruptible.
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/css.c')
-rw-r--r-- | drivers/s390/cio/css.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 366affcd9bbf..169a27723c4f 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -1016,19 +1016,22 @@ static int css_settle(struct device_driver *drv, void *unused) struct css_driver *cssdrv = to_cssdriver(drv); if (cssdrv->settle) - cssdrv->settle(); + return cssdrv->settle(); return 0; } -static inline void css_complete_work(void) +static inline int css_complete_work(void) { int ret; /* Wait for the evaluation of subchannels to finish. */ - wait_event(css_eval_wq, atomic_read(&css_eval_scheduled) == 0); + ret = wait_event_interruptible(css_eval_wq, + atomic_read(&css_eval_scheduled) == 0); + if (ret) + return -EINTR; flush_workqueue(cio_work_q); /* Wait for the subchannel type specific initialization to finish */ - ret = bus_for_each_drv(&css_bus_type, NULL, NULL, css_settle); + return bus_for_each_drv(&css_bus_type, NULL, NULL, css_settle); } @@ -1049,10 +1052,13 @@ subsys_initcall_sync(channel_subsystem_init_sync); static ssize_t cio_settle_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { + int ret; + /* Handle pending CRW's. */ crw_wait_for_channel_report(); - css_complete_work(); - return count; + ret = css_complete_work(); + + return ret ? ret : count; } static const struct file_operations cio_settle_proc_fops = { |