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 892B52750E6; Mon, 9 Feb 2026 14:56:20 +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=1770648980; cv=none; b=GNFQeRE6EEoy5Dm+L75YWFE6jWP9/M2qJIVtXSNZPvMTEolZPXx36nv9Glhml64VlROFhw6Myiza4IZH9co+eSSr/yPA4Fbz7QP9s+LgEdDguxW2ap98A6W6r8CuXTn/uNncWAWd7zT3qnzHCU8J2+Eu7HSHJIa3NnLPAiICVY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648980; c=relaxed/simple; bh=8JA4JWKj+ry5OPBDVE5oJrA53PNG0SCKPQSMsndm4es=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K63ma90lfqcAm2h4jW7ofDU/yPteNfoscBD7u3+/dq7jk0iLBmvT79NLYhhrYebYMDkAFw7XTl8WmtI744BvdnFZM7kop6Jh/rNt/Zh0tw37E/tZMl8BxplBGUcm63j8M/WQ99k0vefTMjjW2H34yf9tEieT+qH3yx0R9rhjC8k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uT5c0WQJ; 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="uT5c0WQJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6ADCC116C6; Mon, 9 Feb 2026 14:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770648980; bh=8JA4JWKj+ry5OPBDVE5oJrA53PNG0SCKPQSMsndm4es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uT5c0WQJdltqrN4svFtJsa6JHwxPdE0/lkRi7u3g+PYDCvNFdNajbL9ojnESUZ6HK 4pRNBFh6QbImIubGGES7ZwNkyNhP3W+B8lNUY0P9/gKFJFoLbpjsqte0UoSPFh9ARw IGTUN8F8f4N3Fpo7ZAblIOvmOS1UNH5keO79MKDI= 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 5.15 73/75] spi: tegra210-quad: Protect curr_xfer clearing in tegra_qspi_non_combined_seq_xfer Date: Mon, 9 Feb 2026 15:25:10 +0100 Message-ID: <20260209142304.484511409@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142301.830618238@linuxfoundation.org> References: <20260209142301.830618238@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 5.15-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 3a95788b6fd04..cb9679905682f 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -1178,6 +1178,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; @@ -1247,7 +1248,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