summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/qdio_main.c
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2021-06-01 08:20:09 +0200
committerHeiko Carstens <hca@linux.ibm.com>2021-07-27 09:39:18 +0200
commitd1ea9b58c8fbdc280f06b48469b4d056bd69f142 (patch)
tree0a865cbb4a091b27c3fad13187f4bf0a729860cd /drivers/s390/cio/qdio_main.c
parents390/qdio: improve roll-back after error on ESTABLISH ccw (diff)
downloadlinux-d1ea9b58c8fbdc280f06b48469b4d056bd69f142.tar.xz
linux-d1ea9b58c8fbdc280f06b48469b4d056bd69f142.zip
s390/qdio: propagate error when cancelling a ccw fails
If qdio_cancel_ccw() times out (or is interrupted) before the interrupt for the {halt,clear} action arrives, report this back to the caller as an error. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/cio/qdio_main.c')
-rw-r--r--drivers/s390/cio/qdio_main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index 167653037b52..99f34bdb267b 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -893,6 +893,7 @@ static void qdio_shutdown_queues(struct qdio_irq *irq_ptr)
static int qdio_cancel_ccw(struct qdio_irq *irq, int how)
{
struct ccw_device *cdev = irq->cdev;
+ long timeout;
int rc;
spin_lock_irq(get_ccwdev_lock(cdev));
@@ -909,12 +910,14 @@ static int qdio_cancel_ccw(struct qdio_irq *irq, int how)
return rc;
}
- wait_event_interruptible_timeout(cdev->private->wait_q,
- irq->state == QDIO_IRQ_STATE_INACTIVE ||
- irq->state == QDIO_IRQ_STATE_ERR,
- 10 * HZ);
+ timeout = wait_event_interruptible_timeout(cdev->private->wait_q,
+ irq->state == QDIO_IRQ_STATE_INACTIVE ||
+ irq->state == QDIO_IRQ_STATE_ERR,
+ 10 * HZ);
+ if (timeout <= 0)
+ rc = (timeout == -ERESTARTSYS) ? -EINTR : -ETIME;
- return 0;
+ return rc;
}
/**