Commit bf3f8378 authored by Ursula Braun's avatar Ursula Braun Committed by Martin Schwidefsky

[S390] qdio: avoid hang when establishing qdio queues

If qdio establish runs in parallel with a channel error,
ccw_device_start_timeout may not trigger the qdio_timeout_handler.
In this case neither QDIO_IRQ_STATE_ESTABLISHED nor
QDIO_IRQ_STATE_ERR is reached and the following wait_event hangs
forever.
Solution: do not make use of the timeout option with
ccw_device_start, but add a timeout to the following wait_event.
Signed-off-by: default avatarUrsula Braun <braunu@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 522d8dc0
...@@ -3189,13 +3189,11 @@ qdio_establish(struct qdio_initialize *init_data) ...@@ -3189,13 +3189,11 @@ qdio_establish(struct qdio_initialize *init_data)
spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags);
ccw_device_set_options_mask(cdev, 0); ccw_device_set_options_mask(cdev, 0);
result=ccw_device_start_timeout(cdev,&irq_ptr->ccw, result = ccw_device_start(cdev, &irq_ptr->ccw,
QDIO_DOING_ESTABLISH,0, 0, QDIO_DOING_ESTABLISH, 0, 0);
QDIO_ESTABLISH_TIMEOUT);
if (result) { if (result) {
result2=ccw_device_start_timeout(cdev,&irq_ptr->ccw, result2 = ccw_device_start(cdev, &irq_ptr->ccw,
QDIO_DOING_ESTABLISH,0,0, QDIO_DOING_ESTABLISH, 0, 0);
QDIO_ESTABLISH_TIMEOUT);
sprintf(dbf_text,"eq:io%4x",result); sprintf(dbf_text,"eq:io%4x",result);
QDIO_DBF_TEXT2(1,setup,dbf_text); QDIO_DBF_TEXT2(1,setup,dbf_text);
if (result2) { if (result2) {
...@@ -3219,10 +3217,10 @@ qdio_establish(struct qdio_initialize *init_data) ...@@ -3219,10 +3217,10 @@ qdio_establish(struct qdio_initialize *init_data)
return result; return result;
} }
/* Timeout is cared for already by using ccw_device_start_timeout(). */ wait_event_interruptible_timeout(cdev->private->wait_q,
wait_event_interruptible(cdev->private->wait_q,
irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED || irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED ||
irq_ptr->state == QDIO_IRQ_STATE_ERR); irq_ptr->state == QDIO_IRQ_STATE_ERR,
QDIO_ESTABLISH_TIMEOUT);
if (irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED) if (irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED)
result = 0; result = 0;
......
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