Commit f5a8a27
spi: tegra210-quad: Protect curr_xfer assignment in tegra_qspi_setup_transfer_one
[ Upstream commit f5a4d7f ]
When the timeout handler processes a completed transfer and signals
completion, the transfer thread can immediately set up the next transfer
and assign curr_xfer to point to it.
If a delayed ISR from the previous transfer then runs, it checks if
(!tqspi->curr_xfer) (currently without the lock also -- to be fixed
soon) to detect stale interrupts, but this check passes because
curr_xfer now points to the new transfer. The ISR then incorrectly
processes the new transfer's context.
Protect the curr_xfer assignment with the spinlock to ensure the ISR
either sees NULL (and bails out) or sees the new value only after the
assignment is complete.
Fixes: 921fc18 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Signed-off-by: Breno Leitao <leitao@debian.org>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260126-tegra_xfer-v2-3-6d2115e4f387@debian.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 62059d8 commit f5a8a27
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
817 | 818 | | |
818 | 819 | | |
819 | 820 | | |
820 | 821 | | |
821 | 822 | | |
822 | 823 | | |
823 | 824 | | |
| 825 | + | |
824 | 826 | | |
825 | 827 | | |
826 | 828 | | |
827 | 829 | | |
| 830 | + | |
828 | 831 | | |
829 | 832 | | |
830 | 833 | | |
| |||
0 commit comments