Skip to content

Commit 897d68e

Browse files
Arun Easimartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix WARN_ON in qla_nvme_register_hba
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. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Arun Easi <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4903000 commit 897d68e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

drivers/scsi/qla2xxx/qla_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3880,6 +3880,7 @@ struct qla_hw_data {
38803880
uint32_t scm_supported_f:1;
38813881
/* Enabled in Driver */
38823882
uint32_t scm_enabled:1;
3883+
uint32_t max_req_queue_warned:1;
38833884
} flags;
38843885

38853886
uint16_t max_exchg;

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,15 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
687687
tmpl = &qla_nvme_fc_transport;
688688

689689
WARN_ON(vha->nvme_local_port);
690-
WARN_ON(ha->max_req_queues < 3);
690+
691+
if (ha->max_req_queues < 3) {
692+
if (!ha->flags.max_req_queue_warned)
693+
ql_log(ql_log_info, vha, 0x2120,
694+
"%s: Disabling FC-NVME due to lack of free queue pairs (%d).\n",
695+
__func__, ha->max_req_queues);
696+
ha->flags.max_req_queue_warned = 1;
697+
return ret;
698+
}
691699

692700
qla_nvme_fc_transport.max_hw_queues =
693701
min((uint8_t)(qla_nvme_fc_transport.max_hw_queues),

0 commit comments

Comments
 (0)