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 07/11] qla2xxx: Fix WARN_ON in qla_nvme_register_hba
Date: Thu, 6 Aug 2020 04:10:10 -0700	[thread overview]
Message-ID: <20200806111014.28434-8-njavali@marvell.com> (raw)
In-Reply-To: <20200806111014.28434-1-njavali@marvell.com>

From: Arun Easi <aeasi@marvell.com>

qla_nvme_register_hba puts out a warning when there are not enough
queue pairs available for FC-NVME.
Just fail the NVME registration rather than a WARNING + Call Trace.

Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_def.h  |  1 +
 drivers/scsi/qla2xxx/qla_nvme.c | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 8c92af5e4390..1bc090d8a71b 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3880,6 +3880,7 @@ struct qla_hw_data {
 		uint32_t	scm_supported_f:1;
 				/* Enabled in Driver */
 		uint32_t	scm_enabled:1;
+		uint32_t	max_req_queue_warned:1;
 	} flags;
 
 	uint16_t max_exchg;
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index d66d47a0f958..be1d49f5c622 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -686,7 +686,15 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
 	tmpl = &qla_nvme_fc_transport;
 
 	WARN_ON(vha->nvme_local_port);
-	WARN_ON(ha->max_req_queues < 3);
+
+	if (ha->max_req_queues < 3) {
+		if (!ha->flags.max_req_queue_warned)
+			ql_log(ql_log_info, vha, 0x2120,
+			       "%s: Disabling FC-NVME due to lack of free queue pairs (%d).\n",
+			       __func__, ha->max_req_queues);
+		ha->flags.max_req_queue_warned = 1;
+		return ret;
+	}
 
 	qla_nvme_fc_transport.max_hw_queues =
 	    min((uint8_t)(qla_nvme_fc_transport.max_hw_queues),
-- 
2.19.0.rc0


  parent reply	other threads:[~2020-08-06 12:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 11:10 [PATCH v2 00/11] qla2xxx driver bug fixes Nilesh Javali
2020-08-06 11:10 ` [PATCH v2 01/11] qla2xxx: flush all sessions on zone disable Nilesh Javali
2020-08-12 19:38   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 02/11] qla2xxx: flush IO " Nilesh Javali
2020-08-12 19:39   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 03/11] qla2xxx: Indicate correct supported speeds for Mezz card Nilesh Javali
2020-08-12 19:40   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 04/11] qla2xxx: fix login timeout Nilesh Javali
2020-08-12 19:42   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 05/11] qla2xxx: reduce noisy debug message Nilesh Javali
2020-08-12 19:44   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 06/11] qla2xxx: Allow ql2xextended_error_logging special value 1 to be set anytime Nilesh Javali
2020-08-12 19:43   ` Himanshu Madhani
2020-08-06 11:10 ` Nilesh Javali [this message]
2020-08-12 19:46   ` [PATCH v2 07/11] qla2xxx: Fix WARN_ON in qla_nvme_register_hba Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 08/11] qla2xxx: Check if FW supports MQ before enabling Nilesh Javali
2020-08-12 19:46   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 09/11] qla2xxx: fix null pointer access while connections disconnect from subsystem Nilesh Javali
2020-08-12 19:47   ` Himanshu Madhani
2020-08-06 11:10 ` [PATCH v2 10/11] Revert "scsi: qla2xxx: Fix crash on qla2x00_mailbox_command" Nilesh Javali
2020-08-07  7:54   ` Daniel Wagner
2020-08-10  9:55     ` Saurav Kashyap
2020-08-12 19:31       ` Himanshu Madhani
2020-08-24  8:04         ` Daniel Wagner
2020-08-24 10:49           ` [EXT] " Saurav Kashyap
2020-08-06 11:10 ` [PATCH v2 11/11] qla2xxx: Revert: Disable T10-DIF feature with FC-NVMe during probe Nilesh Javali
2020-08-12 19:47   ` Himanshu Madhani
2020-08-18  3:12 ` [PATCH v2 00/11] qla2xxx driver bug fixes 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=20200806111014.28434-8-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.