Commit c68f2d57 authored by Stefan Haberland's avatar Stefan Haberland Committed by Sasha Levin

s390/dasd: fix hanging device after clear subchannel

[ Upstream commit 9ba333dc ]

When a device is in a status where CIO has killed all I/O by itself the
interrupt for a clear request may not contain an irb to determine the
clear function. Instead it contains an error pointer -EIO.
This was ignored by the DASD int_handler leading to a hanging device
waiting for a clear interrupt.

Handle -EIO error pointer correctly for requests that are clear pending and
treat the clear as successful.
Signed-off-by: default avatarStefan Haberland <sth@linux.vnet.ibm.com>
Reviewed-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 64a45a08
...@@ -1621,9 +1621,18 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1621,9 +1621,18 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
unsigned long long now; unsigned long long now;
int expires; int expires;
cqr = (struct dasd_ccw_req *) intparm;
if (IS_ERR(irb)) { if (IS_ERR(irb)) {
switch (PTR_ERR(irb)) { switch (PTR_ERR(irb)) {
case -EIO: case -EIO:
if (cqr && cqr->status == DASD_CQR_CLEAR_PENDING) {
device = (struct dasd_device *) cqr->startdev;
cqr->status = DASD_CQR_CLEARED;
dasd_device_clear_timer(device);
wake_up(&dasd_flush_wq);
dasd_schedule_device_bh(device);
return;
}
break; break;
case -ETIMEDOUT: case -ETIMEDOUT:
DBF_EVENT_DEVID(DBF_WARNING, cdev, "%s: " DBF_EVENT_DEVID(DBF_WARNING, cdev, "%s: "
...@@ -1639,7 +1648,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1639,7 +1648,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
} }
now = get_tod_clock(); now = get_tod_clock();
cqr = (struct dasd_ccw_req *) intparm;
/* check for conditions that should be handled immediately */ /* check for conditions that should be handled immediately */
if (!cqr || if (!cqr ||
!(scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) && !(scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment