Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758071AbYBIMFs (ORCPT ); Sat, 9 Feb 2008 07:05:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755485AbYBIMDV (ORCPT ); Sat, 9 Feb 2008 07:03:21 -0500 Received: from mtagate7.de.ibm.com ([195.212.29.156]:4369 "EHLO mtagate7.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753560AbYBIMDN (ORCPT ); Sat, 9 Feb 2008 07:03:13 -0500 Message-Id: <20080209120309.506643477@de.ibm.com> References: <20080209120157.885371603@de.ibm.com> User-Agent: quilt/0.46-1 Date: Sat, 09 Feb 2008 13:02:03 +0100 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Ursula Braun , Martin Schwidefsky Subject: [patch 06/11] qdio: avoid hang when establishing qdio queues Content-Disposition: inline; filename=006-qdio-hang.diff Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2373 Lines: 66 From: Ursula Braun 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: Ursula Braun Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/qdio.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) Index: quilt-2.6/drivers/s390/cio/qdio.c =================================================================== --- quilt-2.6.orig/drivers/s390/cio/qdio.c +++ quilt-2.6/drivers/s390/cio/qdio.c @@ -3189,13 +3189,11 @@ qdio_establish(struct qdio_initialize *i spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); ccw_device_set_options_mask(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) { @@ -3219,10 +3217,10 @@ qdio_establish(struct qdio_initialize *i return result; } - /* 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; -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/