public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: christof.schmitt@de.ibm.com
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
	Swen Schillig <swen@vnet.ibm.com>,
	Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 03/11] zfcp: Adapter reopen for large number of unsolicited status
Date: Mon, 30 Jun 2008 12:52:39 +0200	[thread overview]
Message-ID: <20080630110056.334608000@de.ibm.com> (raw)
In-Reply-To: 20080630105236.960064000@de.ibm.com

[-- Attachment #1: zfcp_aux_cleanup_avoid_mini_race.diff --]
[-- Type: text/plain, Size: 2216 bytes --]

From: Swen Schillig <swen@vnet.ibm.com>

When zfcp receives 16 unsolicited status messages, this could trigger
an adapter reopen. In this case, first try to send a new status read,
and only if this fails, go through the recovery.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
 drivers/s390/scsi/zfcp_aux.c |   15 +++++++--------
 drivers/s390/scsi/zfcp_def.h |    3 +--
 2 files changed, 8 insertions(+), 10 deletions(-)

--- a/drivers/s390/scsi/zfcp_aux.c	2008-06-27 18:06:59.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_aux.c	2008-06-27 18:07:57.000000000 +0200
@@ -550,15 +550,14 @@ static void zfcp_dummy_release(struct de
 int zfcp_status_read_refill(struct zfcp_adapter *adapter)
 {
 	while (atomic_read(&adapter->stat_miss) > 0)
-		if (zfcp_fsf_status_read(adapter, ZFCP_WAIT_FOR_SBAL))
+		if (zfcp_fsf_status_read(adapter, ZFCP_WAIT_FOR_SBAL)) {
+			if (atomic_read(&adapter->stat_miss) >= 16) {
+				zfcp_erp_adapter_reopen(adapter, 0, 103, NULL);
+				return 1;
+			}
 			break;
-	else
-		atomic_dec(&adapter->stat_miss);
-
-	if (ZFCP_STATUS_READS_RECOM <= atomic_read(&adapter->stat_miss)) {
-		zfcp_erp_adapter_reopen(adapter, 0, 103, NULL);
-		return 1;
-	}
+		} else
+			atomic_dec(&adapter->stat_miss);
 	return 0;
 }
 
--- a/drivers/s390/scsi/zfcp_def.h	2008-06-27 18:06:59.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_def.h	2008-06-27 18:07:57.000000000 +0200
@@ -108,7 +108,6 @@ zfcp_address_to_sg(void *address, struct
 #define ZFCP_QTCB_VERSION	FSF_QTCB_CURRENT_VERSION
 /* ATTENTION: value must not be used by hardware */
 #define FSF_QTCB_UNSOLICITED_STATUS		0x6305
-#define ZFCP_STATUS_READS_RECOM		        FSF_STATUS_READS_RECOM
 
 /* Do 1st retry in 1 second, then double the timeout for each following retry */
 #define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP	1
@@ -743,7 +742,7 @@ struct zfcp_data {
 #define ZFCP_POOL_FSF_REQ_ERP_NR	1
 #define ZFCP_POOL_FSF_REQ_SCSI_NR	1
 #define ZFCP_POOL_FSF_REQ_ABORT_NR	1
-#define ZFCP_POOL_STATUS_READ_NR	ZFCP_STATUS_READS_RECOM
+#define ZFCP_POOL_STATUS_READ_NR	FSF_STATUS_READS_RECOM
 #define ZFCP_POOL_DATA_GID_PN_NR	1
 
 /* struct used by memory pools for fsf_requests */

-- 

  parent reply	other threads:[~2008-06-30 10:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-30 10:52 [patch 00/11] zfcp updates for 2.6.27 christof.schmitt
2008-06-30 10:52 ` [patch 01/11] zfcp: wait until adapter is finished with ERP during auto-port christof.schmitt
2008-06-30 10:52 ` [patch 02/11] zfcp: Fix error checking for ELS ADISC requests christof.schmitt
2008-06-30 10:52 ` christof.schmitt [this message]
2008-06-30 10:52 ` [patch 04/11] zfcp: Small QDIO cleanups christof.schmitt
2008-06-30 10:52 ` [patch 05/11] zfcp: Move status accessors from zfcp to SCSI include file christof.schmitt
2008-06-30 10:52 ` [patch 06/11] zfcp: Cleanup of code in zfcp_scsi.c christof.schmitt
2008-06-30 10:52 ` [patch 07/11] zfcp: Cleanup of code in zfcp_aux.c christof.schmitt
2008-06-30 22:52   ` Heiko Carstens
2008-07-01 13:44     ` Swen Schillig
2008-07-02  7:03       ` Christof Schmitt
2008-06-30 10:52 ` [patch 08/11] zfcp: consolidate sysfs things into one file christof.schmitt
2008-06-30 10:52 ` [patch 09/11] zfcp: zfcp_fsf cleanup christof.schmitt
2008-06-30 10:52 ` [patch 10/11] zfcp: Cleanup code in zfcp_erp.c christof.schmitt
2008-06-30 10:52 ` [patch 11/11] zfcp: Cleanup external header file christof.schmitt
  -- strict thread matches above, loose matches on Subject: below --
2008-07-02  8:56 [patch 00/11] Updated zfcp patches for 2.6.27 Christof Schmitt
2008-07-02  8:56 ` [patch 03/11] zfcp: Adapter reopen for large number of unsolicited status Christof Schmitt

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=20080630110056.334608000@de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=swen@vnet.ibm.com \
    /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