From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C74234EF00; Tue, 6 Jan 2026 17:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767720084; cv=none; b=DCwY8JV0AEoItv8C4X5DpLDWH0eO0Yj1GYlB+vYyBvEzDV0mMDac5w5XDBmDUMZE6bsuwTZx7lPQh5oUVLVb7VIxNd6NvfDwygnr41RcRnu5ab4/mIDIYNY0JLmX9OiKq8YdmkLvSuufvc04tamuDPvvhA6f12O+UTHjtStxJps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767720084; c=relaxed/simple; bh=Sob3AN0l6Pex+RKnVDtE19JRD1/Bo+/N9K9TKDDxxfs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W0c99KAdUTJefKJq0k5LR0c3+4MqN6rvUM0WfVszUq3n29hG61upnAvcdkgkuOl6X857+ZOICmbgpbK5TymFvmN3O+p5A1LZyh6b6OVgvDdRk0n1YOyO3BukzgHPLCY47khGnWIIq3mmTfRl6gzpXadKRQJy5pPRZt4BA0iWuRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hVcUvbfo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hVcUvbfo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A603C116C6; Tue, 6 Jan 2026 17:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767720084; bh=Sob3AN0l6Pex+RKnVDtE19JRD1/Bo+/N9K9TKDDxxfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hVcUvbfof1UR24hT8Gciz/mhlMP4HgnInqAcOxwQ7/Y6eMbzRY2My8U7w/Ue5tLqp pGDlbqoXEXCxJEqYwZn5aZVq6W4aSkTEu+Tajc+3pLBJXkqgJ1GuflnLXXS1ES/vTn g2ZS1TfVBcjDDOSNQjpKnyhFOHN1bsQyo5XFIwZ4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tony Battersby , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.12 129/567] scsi: qla2xxx: Use reinit_completion on mbx_intr_comp Date: Tue, 6 Jan 2026 17:58:31 +0100 Message-ID: <20260106170456.101973737@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260106170451.332875001@linuxfoundation.org> References: <20260106170451.332875001@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Battersby [ Upstream commit 957aa5974989fba4ae4f807ebcb27f12796edd4d ] 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 Link: https://patch.msgid.link/11b6485e-0bfd-4784-8f99-c06a196dad94@cybernetics.com Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 13b6cb1b93ac..41435e98092a 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.51.0