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 E53023793BF; Mon, 9 Feb 2026 14:41:02 +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=1770648063; cv=none; b=J/vxpq/bbrUVaMQiSXD1Eva2TL6Bhe+IVqDIzPhYDpeAMUWQWhnrIJGPCImQLSTMVDEGyERyRN/VbauJAv93aUigDZaZwshF94eRjvI60sagw56TB5T80sSpr1gYBxpW+SFxk7fOPg5QAQbSLzEcegYNArycS4ytIpJZ7tmgW10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648063; c=relaxed/simple; bh=xJsx0CLiG5GPzhzKjoYx2b8ulVioLB7bQ0v8pgNvDU8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CPRu2+q1DElFClpvlFCLNPJcr02Kh3rjBVDR7Kkf3IXbOYc8zeeWoJmNXo1KnWAGXBi76voi9xJU10rmYE7TR4QJ13su0O5wSQorYmWmwukbvNwcq8BaolJGzUb/HsxPJg6FxFlKsLl99rwzevnQEGTz9IqnCfE3pjibApn+Owc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dAancYoX; 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="dAancYoX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8A97C116C6; Mon, 9 Feb 2026 14:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770648062; bh=xJsx0CLiG5GPzhzKjoYx2b8ulVioLB7bQ0v8pgNvDU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dAancYoX5y8H+cAr9J44UNDV8X3SgpZstWeRiqNI7vIiMnHssLDkKUdVPO5M5LHUx neXZnD9CV4wAszrGYTcMI1xUXf49hnuU3LM1cqPk/GhRVysKOcKPoe7A7H5Ywtc+Nu 7hQE7ty5BuvY4fQtR0FdwoTQ4r1yvYPAN4h88boI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Breno Leitao , Jon Hunter , Thierry Reding , Mark Brown , Sasha Levin Subject: [PATCH 6.12 110/113] spi: tegra210-quad: Protect curr_xfer clearing in tegra_qspi_non_combined_seq_xfer Date: Mon, 9 Feb 2026 15:24:19 +0100 Message-ID: <20260209142314.123101925@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142310.204833231@linuxfoundation.org> References: <20260209142310.204833231@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: Breno Leitao [ Upstream commit 6d7723e8161f3c3f14125557e19dd080e9d882be ] Protect the curr_xfer clearing in tegra_qspi_non_combined_seq_xfer() with the spinlock to prevent a race with the interrupt handler that reads this field to check if a transfer is in progress. Fixes: b4e002d8a7ce ("spi: tegra210-quad: Fix timeout handling") Signed-off-by: Breno Leitao Tested-by: Jon Hunter Acked-by: Jon Hunter Acked-by: Thierry Reding Link: https://patch.msgid.link/20260126-tegra_xfer-v2-5-6d2115e4f387@debian.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-tegra210-quad.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index 28552a8f27c14..edc9d400728a1 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -1200,6 +1200,7 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi, struct spi_transfer *transfer; bool is_first_msg = true; int ret = 0, val = 0; + unsigned long flags; msg->status = 0; msg->actual_length = 0; @@ -1271,7 +1272,9 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi, msg->actual_length += xfer->len + dummy_bytes; complete_xfer: + spin_lock_irqsave(&tqspi->lock, flags); tqspi->curr_xfer = NULL; + spin_unlock_irqrestore(&tqspi->lock, flags); if (ret < 0) { tegra_qspi_transfer_end(spi); -- 2.51.0