public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>,
	James Bottomley <james.bottomley@steeleye.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Subject: [PATCH 7/8] qla2xxx: Stall mid-layer error handlers while rport is blocked.
Date: Mon,  2 Oct 2006 12:00:49 -0700	[thread overview]
Message-ID: <11598156511007-git-send-email-andrew.vasquez@qlogic.com> (raw)
In-Reply-To: <20061002185947.GF16536@andrew-vasquezs-computer.local>

Stall error handler if attempting recovery while an rport is
blocked.  This avoids device offline scenarios due to errors in
the error handler.

Reference implementation from lpfc/mptfc.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_os.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index cdc7fca..3ba8c23 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -589,6 +589,23 @@ qla2x00_wait_for_loop_ready(scsi_qla_hos
 	return (return_status);
 }
 
+static void
+qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
+{
+	struct Scsi_Host *shost = cmnd->device->host;
+	struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
+	unsigned long flags;
+
+	spin_lock_irqsave(shost->host_lock, flags);
+	while (rport->port_state == FC_PORTSTATE_BLOCKED) {
+		spin_unlock_irqrestore(shost->host_lock, flags);
+		msleep(1000);
+		spin_lock_irqsave(shost->host_lock, flags);
+	}
+	spin_unlock_irqrestore(shost->host_lock, flags);
+	return;
+}
+
 /**************************************************************************
 * qla2xxx_eh_abort
 *
@@ -615,6 +632,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	unsigned long flags;
 	int wait = 0;
 
+	qla2x00_block_error_handler(cmd);
+
 	if (!CMD_SP(cmd))
 		return SUCCESS;
 
@@ -748,6 +767,8 @@ qla2xxx_eh_device_reset(struct scsi_cmnd
 	unsigned int id, lun;
 	unsigned long serial;
 
+	qla2x00_block_error_handler(cmd);
+
 	ret = FAILED;
 
 	id = cmd->device->id;
@@ -877,6 +898,8 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *c
 	unsigned int id, lun;
 	unsigned long serial;
 
+	qla2x00_block_error_handler(cmd);
+
 	ret = FAILED;
 
 	id = cmd->device->id;
@@ -936,6 +959,8 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *
 	unsigned int id, lun;
 	unsigned long serial;
 
+	qla2x00_block_error_handler(cmd);
+
 	ret = FAILED;
 
 	id = cmd->device->id;
-- 
1.4.2.3.gf59615


  parent reply	other threads:[~2006-10-02 19:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-02 18:59 [PATCH 0/8] qla2xxx: driver update Andrew Vasquez
2006-10-02 19:00 ` [PATCH 1/8] qla2xxx: Add iIDMA support Andrew Vasquez
2006-10-10  9:29   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 2/8] qla2xxx: Add support for symbolic nodename FC transport attribute Andrew Vasquez
2006-10-10  9:30   ` Christoph Hellwig
2006-10-12 16:37     ` Andrew Vasquez
2006-10-02 19:00 ` [PATCH 3/8] qla2xxx: Add support for system hostname " Andrew Vasquez
2006-10-10  9:32   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 4/8] qla2xxx: Add support for fabric name " Andrew Vasquez
2006-10-10  9:32   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 5/8] qla2xxx: Add support for host port state " Andrew Vasquez
2006-10-10  9:33   ` Christoph Hellwig
2006-10-02 19:00 ` [PATCH 6/8] qla2xxx: Add MODULE_FIRMWARE tags Andrew Vasquez
2006-10-10  9:33   ` Christoph Hellwig
2006-10-02 19:00 ` Andrew Vasquez [this message]
2006-10-02 19:26   ` [PATCH 7/8] qla2xxx: Stall mid-layer error handlers while rport is blocked James Smart
2006-10-02 22:14     ` Matthew Wilcox
2006-10-02 23:05       ` Mike Anderson
2006-10-03 14:24         ` James Smart
2006-10-05 16:09     ` Mike Christie
2006-10-06 15:23       ` James Smart
2006-10-06 17:01         ` Mike Christie
2006-10-06 17:33           ` James Smart
2006-10-10 15:11             ` Patrick Mansfield
2006-10-02 19:00 ` [PATCH 8/8] qla2xxx: Update version number to 8.01.07-k2 Andrew Vasquez

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=11598156511007-git-send-email-andrew.vasquez@qlogic.com \
    --to=andrew.vasquez@qlogic.com \
    --cc=james.bottomley@steeleye.com \
    --cc=linux-scsi@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