From: Hans-Joachim Picht <hpicht@redhat.com> Date: Fri, 4 Apr 2008 19:51:55 +0200 Subject: [s390] qdio: change in timeout handling during establish Message-id: 20080404175155.GG9759@redhat.com O-Subject: [RHEL5 U3 PATCH 7/7] s390 - qdio: change in timeout handling during qdio establish Bugzilla: 440421 RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com> Description ============ If qdio establish runs in parallel with a channel error, ccw_device_start_timeout may not trigger the qdio_timeout_handler. In this case none of the states ESTABLISHED nor ERROR is reached and the following wait_event hangs forever. The problem is fixed not making use of the timeout option with ccw_device_start, but instead adding a timeout to the following wait_event. Bugzilla ========= BZ 440421 https://bugzilla.redhat.com/show_bug.cgi?id=440421 Upstream status of the patch: ============================= This patch is submitted upstream: http://lkml.org/lkml/2008/2/9/83 I'll reply to this message as soon as we have a git commit id Test status: ============ Kernel with patch was built and successfully tested Please ACK. With best regards, Hans diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 9b95742..8cfb11c 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -3183,13 +3183,11 @@ qdio_establish(struct qdio_initialize *init_data) spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); ccw_device_set_options(cdev, 0); - result=ccw_device_start_timeout(cdev,&irq_ptr->ccw, - QDIO_DOING_ESTABLISH,0, 0, - QDIO_ESTABLISH_TIMEOUT); + result = ccw_device_start(cdev, &irq_ptr->ccw, + QDIO_DOING_ESTABLISH, 0, 0); if (result) { - result2=ccw_device_start_timeout(cdev,&irq_ptr->ccw, - QDIO_DOING_ESTABLISH,0,0, - QDIO_ESTABLISH_TIMEOUT); + result2 = ccw_device_start(cdev, &irq_ptr->ccw, + QDIO_DOING_ESTABLISH, 0, 0); sprintf(dbf_text,"eq:io%4x",result); QDIO_DBF_TEXT2(1,setup,dbf_text); if (result2) { @@ -3214,9 +3212,10 @@ qdio_establish(struct qdio_initialize *init_data) } /* Timeout is cared for already by using ccw_device_start_timeout(). */ - wait_event_interruptible(cdev->private->wait_q, - irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED || - irq_ptr->state == QDIO_IRQ_STATE_ERR); + wait_event_interruptible_timeout(cdev->private->wait_q, + irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED || + irq_ptr->state == QDIO_IRQ_STATE_ERR, + QDIO_ESTABLISH_TIMEOUT); if (irq_ptr->state == QDIO_IRQ_STATE_ESTABLISHED) result = 0;