Commit 5101306
spi: tegra210-quad: Move curr_xfer read inside spinlock
[ Upstream commit ef13ba3 ]
Move the assignment of the transfer pointer from curr_xfer inside the
spinlock critical section in both handle_cpu_based_xfer() and
handle_dma_based_xfer().
Previously, curr_xfer was read before acquiring the lock, creating a
window where the timeout path could clear curr_xfer between reading it
and using it. By moving the read inside the lock, the handlers are
guaranteed to see a consistent value that cannot be modified by the
timeout path.
Fixes: 921fc18 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Signed-off-by: Breno Leitao <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Tested-by: Jon Hunter <[email protected]>
Acked-by: Jon Hunter <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent e1777c4 commit 5101306
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1376 | 1376 | | |
1377 | 1377 | | |
1378 | 1378 | | |
1379 | | - | |
| 1379 | + | |
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
| 1383 | + | |
1383 | 1384 | | |
1384 | 1385 | | |
1385 | 1386 | | |
| |||
1410 | 1411 | | |
1411 | 1412 | | |
1412 | 1413 | | |
1413 | | - | |
| 1414 | + | |
1414 | 1415 | | |
1415 | 1416 | | |
1416 | 1417 | | |
| |||
1449 | 1450 | | |
1450 | 1451 | | |
1451 | 1452 | | |
| 1453 | + | |
1452 | 1454 | | |
1453 | 1455 | | |
1454 | 1456 | | |
| |||
0 commit comments