diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2010-10-25 14:10:44 (GMT) |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-10-25 14:10:20 (GMT) |
commit | 376ae4752e3a387d41a2ba9c9ea45c2df625e6e4 (patch) | |
tree | de54c8315a5a5c2149131e22fac3daf6291ef9fa /drivers/s390/cio/device.c | |
parent | c9af3fa9e1e3e5154649991a14b74f3a2dee19ee (diff) | |
download | linux-fsl-qoriq-376ae4752e3a387d41a2ba9c9ea45c2df625e6e4.tar.xz |
[S390] cio: fix I/O cancel function
Function ccw_device_cancel_halt_clear may cause an unexpected kernel
panic if a clear function is currently active at the subchannel for
which it is called. In that case, the iretry counter used to determine
the number of retries is never initialized, leading to an immediate
failure of the function which results in a kernel panic.
Fix this by initializing the iretry counter when the function is
first called. Also replace the kernel panic with a return code: a
single malfunctioning I/O device should not automatically cause a
system-wide kernel panic.
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.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 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 881bdfd..2ff8a22 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1205,6 +1205,7 @@ static void io_subchannel_quiesce(struct subchannel *sch) cdev->handler(cdev, cdev->private->intparm, ERR_PTR(-EIO)); while (ret == -EBUSY) { cdev->private->state = DEV_STATE_QUIESCE; + cdev->private->iretry = 255; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, HZ/10); |