LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Ursula Braun <braunu@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 06/11] qdio: avoid hang when establishing qdio queues
Date: Sat, 09 Feb 2008 13:02:03 +0100	[thread overview]
Message-ID: <20080209120309.506643477@de.ibm.com> (raw)
In-Reply-To: <20080209120157.885371603@de.ibm.com>

[-- Attachment #1: 006-qdio-hang.diff --]
[-- Type: text/plain, Size: 2128 bytes --]

From: Ursula Braun <braunu@de.ibm.com>

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 <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 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.


  parent reply	other threads:[~2008-02-09 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 12:01 [patch 00/11] s390 patch set #3 for 2.6.25 Martin Schwidefsky
2008-02-09 12:01 ` [patch 01/11] Update default configuration Martin Schwidefsky
2008-02-09 12:01 ` [patch 02/11] Wire up new timerfd syscalls Martin Schwidefsky
2008-02-09 12:02 ` [patch 03/11] Fix __ffs_word_loop/__ffz_word_loop inlnie assembly Martin Schwidefsky
2008-02-09 12:02 ` [patch 04/11] zcrypt: Do not start ap poll thread per default Martin Schwidefsky
2008-02-09 12:02 ` [patch 05/11] VMEM_MAX_PHYS overflow on 31 bit Martin Schwidefsky
2008-02-09 12:02 ` Martin Schwidefsky [this message]
2008-02-09 12:02 ` [patch 07/11] sclp_vt220: Fix vt220 initialization Martin Schwidefsky
2008-02-09 12:02 ` [patch 08/11] Remove a.out header file Martin Schwidefsky
2008-02-09 12:02 ` [patch 09/11] 1K/2K page table pages Martin Schwidefsky
2008-02-09 12:02 ` [patch 10/11] Add four level page tables for CONFIG_64BIT=y Martin Schwidefsky
2008-02-09 12:02 ` [patch 11/11] dynamic page tables Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080209120309.506643477@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=braunu@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --subject='Re: [patch 06/11] qdio: avoid hang when establishing qdio queues' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).