[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260105213129.46096-1-jiashengjiangcool@gmail.com>
Date: Mon, 5 Jan 2026 21:31:29 +0000
From: Jiasheng Jiang <jiashengjiangcool@...il.com>
To: Nilesh Javali <njavali@...vell.com>,
"James E . J . Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>
Cc: GR-QLogic-Storage-Upstream@...vell.com,
Saurav Kashyap <saurav.kashyap@...gic.com>,
Quinn Tran <quinn.tran@...gic.com>,
linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiasheng Jiang <jiashengjiangcool@...il.com>
Subject: [PATCH] scsi: qla2xxx: Remove redundant and conflicting initialization in qlt_alloc_qfull_cmd
Remove the unconditional initialization of cmd->q_full = 1 at the
beginning of qlt_alloc_qfull_cmd().
Perform initialization of the q_full and term_exchg flags exclusively
within the conditional branches based on the qfull input parameter.
This change eliminates the redundant assignment when qfull is true and
avoids the unnecessary overwrite of the flag when qfull is false.
Ensure that the command state accurately and explicitly reflects its
intended purpose—either a "Queue Full" event or an "Exchange Termination"
—without relying on a conflicting default value.
Fixes: 33e799775593 ("qla2xxx: Add support for QFull throttling and Term Exchange retry")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
---
drivers/scsi/qla2xxx/qla_target.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index d772136984c9..560ff42ce3c7 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -6682,7 +6682,6 @@ qlt_alloc_qfull_cmd(struct scsi_qla_host *vha,
cmd->tgt = vha->vha_tgt.qla_tgt;
cmd->vha = vha;
cmd->reset_count = ha->base_qpair->chip_reset;
- cmd->q_full = 1;
cmd->qpair = ha->base_qpair;
cmd->cdb = &cmd->atio.u.isp24.fcp_cmnd.cdb[0];
cmd->cdb_len = 16;
@@ -6691,8 +6690,10 @@ qlt_alloc_qfull_cmd(struct scsi_qla_host *vha,
cmd->q_full = 1;
/* NOTE: borrowing the state field to carry the status */
cmd->state = status;
- } else
+ } else {
+ cmd->q_full = 0;
cmd->term_exchg = 1;
+ }
spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
list_add_tail(&cmd->cmd_list, &vha->hw->tgt.q_full_list);
--
2.25.1
Powered by blists - more mailing lists