linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Himanshu Madhani <hmadhani@marvell.com>
To: <James.Bottomley@HansenPartnership.com>, <martin.petersen@oracle.com>
Cc: <hmadhani@marvell.com>, <linux-scsi@vger.kernel.org>
Subject: [PATCH 4/6] qla2xxx: Fix stuck login session
Date: Fri, 30 Aug 2019 15:24:00 -0700	[thread overview]
Message-ID: <20190830222402.23688-5-hmadhani@marvell.com> (raw)
In-Reply-To: <20190830222402.23688-1-hmadhani@marvell.com>

From: Quinn Tran <qutran@marvell.com>

Login session was stucked on cable pull. When FW is in the middle
PRLI PENDING + driver is in Initiator mode, driver fail to
check back with FW to see if the PRLI has completed. This patch
would re-check with FW again to make sure PRLI would complete before
pushing forward with relogin.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 8161f08f3a4d..2bbadcf60295 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -808,6 +808,15 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,
 			fcport->fw_login_state = current_login_state;
 			fcport->d_id = id;
 			switch (current_login_state) {
+			case DSC_LS_PRLI_PEND:
+				/*
+				 * In the middle of PRLI. Let it finish.
+				 * Allow relogin code to recheck state again
+				 * with GNL. Push disc_state back to DELETED
+				 * so GNL can go out again
+				 */
+				fcport->disc_state = DSC_DELETED;
+				break;
 			case DSC_LS_PRLI_COMP:
 				if ((e->prli_svc_param_word_3[0] & BIT_4) == 0)
 					fcport->port_type = FCT_INITIATOR;
@@ -1474,7 +1483,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
 	u64 wwn;
 	u16 sec;
 
-	ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x20d8,
+	ql_dbg(ql_dbg_disc, vha, 0x20d8,
 	    "%s %8phC DS %d LS %d P %d fl %x confl %p rscn %d|%d login %d lid %d scan %d\n",
 	    __func__, fcport->port_name, fcport->disc_state,
 	    fcport->fw_login_state, fcport->login_pause, fcport->flags,
@@ -1485,6 +1494,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
 		return 0;
 
 	if ((fcport->loop_id != FC_NO_LOOP_ID) &&
+	    qla_dual_mode_enabled(vha) &&
 	    ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
 	     (fcport->fw_login_state == DSC_LS_PRLI_PEND)))
 		return 0;
@@ -1674,17 +1684,6 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha,
 	    fcport->last_login_gen, fcport->login_gen,
 	    fcport->flags);
 
-	if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
-	    (fcport->fw_login_state == DSC_LS_PRLI_PEND))
-		return;
-
-	if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) {
-		if (time_before_eq(jiffies, fcport->plogi_nack_done_deadline)) {
-			set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
-			return;
-		}
-	}
-
 	if (fcport->last_rscn_gen != fcport->rscn_gen) {
 		ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gnl\n",
 		    __func__, __LINE__, fcport->port_name);
-- 
2.12.0


  parent reply	other threads:[~2019-08-30 22:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 22:23 [PATCH 0/6] qla2xxx: Bug fixes for the driver Himanshu Madhani
2019-08-30 22:23 ` [PATCH 1/6] qla2xxx: Fix message indicating vectors used by driver Himanshu Madhani
2019-09-03 14:46   ` Ewan D. Milne
2019-09-04 22:33   ` Lee Duncan
2019-08-30 22:23 ` [PATCH 2/6] qla2xxx: Fix flash read for Qlogic ISPs Himanshu Madhani
2019-09-03 14:48   ` Ewan D. Milne
2019-09-13 20:36   ` Martin Wilck
2019-09-13 22:37     ` Martin K. Petersen
2019-09-16 16:19       ` [EXT] " Himanshu Madhani
2019-08-30 22:23 ` [PATCH 3/6] qla2xxx: Fix driver reload for ISP82xx Himanshu Madhani
2019-09-03 14:49   ` Ewan D. Milne
2019-08-30 22:24 ` Himanshu Madhani [this message]
2019-09-03 14:50   ` [PATCH 4/6] qla2xxx: Fix stuck login session Ewan D. Milne
2019-08-30 22:24 ` [PATCH 5/6] qla2xxx: Fix stale session Himanshu Madhani
2019-09-03 14:52   ` Ewan D. Milne
2019-08-30 22:24 ` [PATCH 6/6] qla2xxx: Update driver version to 10.01.00.19-k Himanshu Madhani
2019-09-03 14:52   ` Ewan D. Milne
2019-09-07 19:39 ` [PATCH 0/6] qla2xxx: Bug fixes for the driver Martin K. Petersen

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=20190830222402.23688-5-hmadhani@marvell.com \
    --to=hmadhani@marvell.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).