linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ursula Braun <braunu@de.ibm.com>
To: davem@davemloft.net, netdev@vger.kernel.org, linux-s390@vger.kernel.org
Cc: "Klaus D. Wacker" <kdwacker@de.ibm.com>
Subject: [patch 4/5] lcs: Channel errors drive lcs_recovery which leads to kernel panic.
Date: Fri, 05 Oct 2007 16:45:47 +0200	[thread overview]
Message-ID: <20071005144824.199472000@linux.vnet.ibm.com> (raw)
In-Reply-To: 20071005144543.448852000@linux.vnet.ibm.com

[-- Attachment #1: 710-lcs-panic.diff --]
[-- Type: text/plain, Size: 2164 bytes --]

From: Klaus D. Wacker <kdwacker@de.ibm.com>

When the lcs irq routine detects channel failures it drives device recovery.
After this event the device is no longer usable for shutdown requests,
because the lcs_irq routine may get wrong channel status information.
In such a case the lcs_irq routine marks the channel in 'error' state.
The channel state comes back to 'running' after restarting the channels.

Signed-off-by: Klaus D. Wacker <kdwacker@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---

 drivers/s390/net/lcs.c |   11 ++++++++---
 drivers/s390/net/lcs.h |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

Index: linux-2.6-uschi/drivers/s390/net/lcs.c
===================================================================
--- linux-2.6-uschi.orig/drivers/s390/net/lcs.c
+++ linux-2.6-uschi/drivers/s390/net/lcs.c
@@ -1400,11 +1400,14 @@ lcs_irq(struct ccw_device *cdev, unsigne
 		PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n",
 			    cdev->dev.bus_id, dstat, cstat);
 		if (rc) {
-			lcs_schedule_recovery(card);
-			wake_up(&card->wait_q);
-			return;
+			channel->state = LCS_CH_STATE_ERROR;
 		}
 	}
+	if (channel->state == LCS_CH_STATE_ERROR) {
+		lcs_schedule_recovery(card);
+		wake_up(&card->wait_q);
+		return;
+	}
 	/* How far in the ccw chain have we processed? */
 	if ((channel->state != LCS_CH_STATE_INIT) &&
 	    (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
@@ -1708,6 +1711,8 @@ lcs_stopcard(struct lcs_card *card)
 
 	if (card->read.state != LCS_CH_STATE_STOPPED &&
 	    card->write.state != LCS_CH_STATE_STOPPED &&
+	    card->read.state != LCS_CH_STATE_ERROR &&
+	    card->write.state != LCS_CH_STATE_ERROR &&
 	    card->state == DEV_STATE_UP) {
 		lcs_clear_multicast_list(card);
 		rc = lcs_send_stoplan(card,LCS_INITIATOR_TCPIP);
Index: linux-2.6-uschi/drivers/s390/net/lcs.h
===================================================================
--- linux-2.6-uschi.orig/drivers/s390/net/lcs.h
+++ linux-2.6-uschi/drivers/s390/net/lcs.h
@@ -138,6 +138,7 @@ enum lcs_channel_states {
 	LCS_CH_STATE_RUNNING,
 	LCS_CH_STATE_SUSPENDED,
 	LCS_CH_STATE_CLEARED,
+	LCS_CH_STATE_ERROR,
 };
 
 /**

-- 

  parent reply	other threads:[~2007-10-05 14:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-05 14:45 [patch 0/5] s390: qeth and lcs patches for 2.6.24 - RESEND Ursula Braun
2007-10-05 14:45 ` [patch 1/5] qeth: HiperSockets layer-3 interface drop non IPv4 or non IPv6 packets Ursula Braun
2007-10-05 17:55   ` Jeff Garzik
2007-10-05 14:45 ` [patch 2/5] qeth: EDDP does not work on large MTUs Ursula Braun
2007-10-05 14:45 ` [patch 3/5] qeth: avoid duplicate deletion of multicast addresses Ursula Braun
2007-10-05 14:45 ` Ursula Braun [this message]
2007-10-05 14:45 ` [patch 5/5] qeth: discard inbound packets with unknown header id Ursula Braun
2007-10-05 15:07 ` [patch 0/5] s390: qeth and lcs patches for 2.6.24 - RESEND Jeff Garzik
2007-10-05 15:35   ` Ursula Braun1
  -- strict thread matches above, loose matches on Subject: below --
2007-10-05  7:38 [patch 0/5] s390: qeth and lcs patches for 2.6.24 Ursula Braun
2007-10-05  7:38 ` [patch 4/5] lcs: Channel errors drive lcs_recovery which leads to kernel panic Ursula Braun

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=20071005144824.199472000@linux.vnet.ibm.com \
    --to=braunu@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=kdwacker@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).