From: Tony Battersby <tonyb@cybernetics.com>
To: Nilesh Javali <njavali@marvell.com>,
GR-QLogic-Storage-Upstream@marvell.com,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
target-devel@vger.kernel.org, scst-devel@lists.sourceforge.net,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Dmitry Bogdanov <d.bogdanov@yadro.com>,
Xose Vazquez Perez <xose.vazquez@gmail.com>
Subject: [PATCH v2 04/16] scsi: qla2xxx: use reinit_completion on mbx_intr_comp
Date: Mon, 29 Sep 2025 10:34:12 -0400 [thread overview]
Message-ID: <5bfdcedd-9bff-4de8-98a8-aa5ec87ca96e@cybernetics.com> (raw)
In-Reply-To: <e95ee7d0-3580-4124-b854-7f73ca3a3a84@cybernetics.com>
If a mailbox command completes immediately after
wait_for_completion_timeout() times out, ha->mbx_intr_comp could be left
in an inconsistent state, causing the next mailbox command not to wait
for the hardware. Fix by reinitializing the completion before use.
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
---
v1 -> v2: no changes
drivers/scsi/qla2xxx/qla_mbx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 32eb0ce8b170..1f01576f044b 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -253,6 +253,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
/* Issue set host interrupt command to send cmd out. */
ha->flags.mbox_int = 0;
clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
+ reinit_completion(&ha->mbx_intr_comp);
/* Unlock mbx registers and wait for interrupt */
ql_dbg(ql_dbg_mbx, vha, 0x100f,
@@ -279,6 +280,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
"cmd=%x Timeout.\n", command);
spin_lock_irqsave(&ha->hardware_lock, flags);
clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
+ reinit_completion(&ha->mbx_intr_comp);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
if (chip_reset != ha->chip_reset) {
--
2.43.0
next prev parent reply other threads:[~2025-09-29 14:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 14:28 [PATCH v2 00/16] qla2xxx target mode improvements Tony Battersby
2025-09-29 14:30 ` [PATCH v2 01/16] Revert "scsi: qla2xxx: Perform lockless command completion in abort path" Tony Battersby
2025-09-29 14:32 ` [PATCH v2 02/16] scsi: qla2xxx: fix initiator mode with qlini_mode=exclusive Tony Battersby
2025-09-29 14:33 ` [PATCH v2 03/16] scsi: qla2xxx: fix lost interrupts with qlini_mode=disabled Tony Battersby
2025-09-29 14:34 ` Tony Battersby [this message]
2025-09-29 14:35 ` [PATCH v2 05/16] scsi: qla2xxx: remove code for unsupported hardware Tony Battersby
2025-09-29 14:36 ` [PATCH v2 06/16] scsi: qla2xxx: improve debug output for term exchange Tony Battersby
2025-09-29 14:37 ` [PATCH v2 07/16] scsi: qla2xxx: fix term exchange when cmd_sent_to_fw == 1 Tony Battersby
2025-09-29 14:38 ` [PATCH v2 08/16] scsi: qla2xxx: clear cmds after chip reset Tony Battersby
2025-09-29 14:39 ` [PATCH v2 09/16] scsi: qla2xxx: fix races with aborting commands Tony Battersby
2025-09-29 14:41 ` [SCST PATCH " Tony Battersby
2025-09-29 14:42 ` [PATCH v2 10/16] scsi: qla2xxx: improve checks in qlt_xmit_response / qlt_rdy_to_xfer Tony Battersby
2025-09-29 14:43 ` [PATCH v2 11/16] scsi: qla2xxx: fix TMR failure handling Tony Battersby
2025-10-03 8:40 ` Dan Carpenter
2025-10-03 14:38 ` [PATCH v3 " Tony Battersby
2025-09-29 14:44 ` [PATCH v2 12/16] scsi: qla2xxx: fix invalid memory access with big CDBs Tony Battersby
2025-09-29 14:45 ` [SCST PATCH " Tony Battersby
2025-09-29 14:47 ` [PATCH v2 13/16] scsi: qla2xxx: add cmd->rsp_sent Tony Battersby
2025-09-29 14:48 ` [SCST PATCH " Tony Battersby
2025-09-29 14:49 ` [PATCH v2 14/16] scsi: qla2xxx: improve cmd logging Tony Battersby
2025-09-29 14:50 ` [PATCH v2 15/16] scsi: qla2xxx: add back SRR support Tony Battersby
2025-09-29 14:51 ` [SCST PATCH " Tony Battersby
2025-09-29 14:53 ` [PATCH v2 16/16] scsi: qla2xxx: improve safety of cmd lookup by handle Tony Battersby
2025-09-29 14:54 ` [SCST PATCH v2] qla2x00t-32gbit: add on_abort_cmd callback Tony Battersby
2025-11-03 15:44 ` [PATCH v2 00/16] qla2xxx target mode improvements Tony Battersby
2025-11-08 17:03 ` 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=5bfdcedd-9bff-4de8-98a8-aa5ec87ca96e@cybernetics.com \
--to=tonyb@cybernetics.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=d.bogdanov@yadro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=scst-devel@lists.sourceforge.net \
--cc=target-devel@vger.kernel.org \
--cc=xose.vazquez@gmail.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