Skip to content

Commit 9ba333d

Browse files
stefan-haberlandMartin Schwidefsky
authored andcommitted
s390/dasd: fix hanging device after clear subchannel
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: Stefan Haberland <[email protected]> Reviewed-by: Sebastian Ott <[email protected]> Cc: [email protected] Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent 9bce8b2 commit 9ba333d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/s390/block/dasd.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,9 +1643,18 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
16431643
u8 *sense = NULL;
16441644
int expires;
16451645

1646+
cqr = (struct dasd_ccw_req *) intparm;
16461647
if (IS_ERR(irb)) {
16471648
switch (PTR_ERR(irb)) {
16481649
case -EIO:
1650+
if (cqr && cqr->status == DASD_CQR_CLEAR_PENDING) {
1651+
device = (struct dasd_device *) cqr->startdev;
1652+
cqr->status = DASD_CQR_CLEARED;
1653+
dasd_device_clear_timer(device);
1654+
wake_up(&dasd_flush_wq);
1655+
dasd_schedule_device_bh(device);
1656+
return;
1657+
}
16491658
break;
16501659
case -ETIMEDOUT:
16511660
DBF_EVENT_DEVID(DBF_WARNING, cdev, "%s: "
@@ -1661,7 +1670,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
16611670
}
16621671

16631672
now = get_tod_clock();
1664-
cqr = (struct dasd_ccw_req *) intparm;
16651673
/* check for conditions that should be handled immediately */
16661674
if (!cqr ||
16671675
!(scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&

0 commit comments

Comments
 (0)