提交 d1ea9b58 编写于 作者: J Julian Wiedmann 提交者: Heiko Carstens

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: NJulian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: NBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
上级 d06314e0
......@@ -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;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册