Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Bhanu Prakash Gollapudi" <bprakash@broadcom.com>
To: linux-scsi@vger.kernel.org, devel@open-fcoe.org
Cc: Nithin Nayak Sujir <nsujir@broadcom.com>,
	Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Subject: [PATCH 3/5] bnx2fc: call scsi_done if session goes to not ready from ready
Date: Mon, 25 Apr 2011 12:30:08 -0700	[thread overview]
Message-ID: <1303759810-22570-3-git-send-email-bprakash@broadcom.com> (raw)
In-Reply-To: <1303759810-22570-1-git-send-email-bprakash@broadcom.com>

From: Nithin Nayak Sujir <nsujir@broadcom.com>

If the session is not ready yet, we ask the SCSI-ml to retry. However, if the
session is just uploaded, we should not retry, but instead call scsi_done to
fail the IO.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
---
 drivers/scsi/bnx2fc/bnx2fc_io.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 96013a9..f9cb535 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1663,6 +1663,12 @@ int bnx2fc_queuecommand(struct Scsi_Host *host,
 	tgt = (struct bnx2fc_rport *)&rp[1];
 
 	if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) {
+		if (test_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags))  {
+			sc_cmd->result = DID_NO_CONNECT << 16;
+			sc_cmd->scsi_done(sc_cmd);
+			return 0;
+
+		}
 		/*
 		 * Session is not offloaded yet. Let SCSI-ml retry
 		 * the command.
-- 
1.7.0.6



  parent reply	other threads:[~2011-04-25 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-25 19:30 [PATCH 1/5] scsi_transport_fc: Fix deadlock during fc_remove_host Bhanu Prakash Gollapudi
2011-04-25 19:30 ` [PATCH 2/5] bnx2fc: Release the reference to hba only after the interface is destroyed Bhanu Prakash Gollapudi
2011-04-25 22:49   ` Shyam_Iyer
2011-04-25 23:15     ` Bhanu Prakash Gollapudi
2011-04-26  4:09       ` Shyam_Iyer
2011-04-26  4:10   ` Shyam_Iyer
2011-04-25 19:30 ` Bhanu Prakash Gollapudi [this message]
2011-04-25 19:30 ` [PATCH 4/5] bnx2fc: Do not use HBA_DBG macro when lport is not available Bhanu Prakash Gollapudi
2011-04-25 19:30 ` [PATCH 5/5] bnx2fc: increase cleanup wait time Bhanu Prakash Gollapudi

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=1303759810-22570-3-git-send-email-bprakash@broadcom.com \
    --to=bprakash@broadcom.com \
    --cc=devel@open-fcoe.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nsujir@broadcom.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