All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilesh Javali <njavali@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <GR-QLogic-Storage-Upstream@marvell.com>
Subject: [PATCH v2 09/11] qla2xxx: Fix losing FCP-2 targets on long port disable with IOs
Date: Wed, 15 Jun 2022 22:35:06 -0700	[thread overview]
Message-ID: <20220616053508.27186-10-njavali@marvell.com> (raw)
In-Reply-To: <20220616053508.27186-1-njavali@marvell.com>

From: Arun Easi <aeasi@marvell.com>

FCP-2 devices were not coming back online once it was
lost, login retries exhausted and then came back up.
Fix this by accepting RSCN when the device is
not online.

Fixes: 44c57f205876 ("scsi: qla2xxx: Changes to support FCP2 Target")
Cc: stable@vger.kernel.org
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 7860cf4319ef..41ffad65d29e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1832,7 +1832,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
 	case RSCN_PORT_ADDR:
 		fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
 		if (fcport) {
-			if (fcport->flags & FCF_FCP2_DEVICE) {
+			if (fcport->flags & FCF_FCP2_DEVICE &&
+			    atomic_read(&fcport->state) == FCS_ONLINE) {
 				ql_dbg(ql_dbg_disc, vha, 0x2115,
 				       "Delaying session delete for FCP2 portid=%06x %8phC ",
 					fcport->d_id.b24, fcport->port_name);
@@ -1864,7 +1865,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
 		break;
 	case RSCN_AREA_ADDR:
 		list_for_each_entry(fcport, &vha->vp_fcports, list) {
-			if (fcport->flags & FCF_FCP2_DEVICE)
+			if (fcport->flags & FCF_FCP2_DEVICE &&
+			    atomic_read(&fcport->state) == FCS_ONLINE)
 				continue;
 
 			if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) {
@@ -1875,7 +1877,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
 		break;
 	case RSCN_DOM_ADDR:
 		list_for_each_entry(fcport, &vha->vp_fcports, list) {
-			if (fcport->flags & FCF_FCP2_DEVICE)
+			if (fcport->flags & FCF_FCP2_DEVICE &&
+			    atomic_read(&fcport->state) == FCS_ONLINE)
 				continue;
 
 			if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) {
@@ -1887,7 +1890,8 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
 	case RSCN_FAB_ADDR:
 	default:
 		list_for_each_entry(fcport, &vha->vp_fcports, list) {
-			if (fcport->flags & FCF_FCP2_DEVICE)
+			if (fcport->flags & FCF_FCP2_DEVICE &&
+			    atomic_read(&fcport->state) == FCS_ONLINE)
 				continue;
 
 			fcport->scan_needed = 1;
-- 
2.19.0.rc0


  parent reply	other threads:[~2022-06-16  5:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  5:34 [PATCH v2 00/11] qla2xxx bug fixes Nilesh Javali
2022-06-16  5:34 ` [PATCH v2 01/11] qla2xxx: Fix excessive IO error messages by default Nilesh Javali
2022-06-16  5:34 ` [PATCH v2 02/11] qla2xxx: Add a new v2 dport diagnostic feature Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 03/11] qla2xxx: Wind down adapter after pcie error Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 04/11] qla2xxx: Turn off multi-queue for 8G adapter Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 05/11] qla2xxx: Fix crash due to stale srb access around IO timeouts Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 06/11] qla2xxx: Fix losing FCP-2 targets during port perturbation tests Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 07/11] qla2xxx: Fix losing target when it reappears during delete Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 08/11] qla2xxx: Add debug prints in the device remove path Nilesh Javali
2022-06-16  5:35 ` Nilesh Javali [this message]
2022-06-16  5:35 ` [PATCH v2 10/11] qla2xxx: Fix erroneous mailbox timeout after pci error inject Nilesh Javali
2022-06-16  5:35 ` [PATCH v2 11/11] qla2xxx: Update version to 10.02.07.700-k Nilesh Javali
2022-06-17  2:00 ` [PATCH v2 00/11] qla2xxx bug fixes Martin K. Petersen
2022-06-22  2:10 ` 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=20220616053508.27186-10-njavali@marvell.com \
    --to=njavali@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.