Commit 551060e
spi: tegra210-quad: Fix timeout handling
[ Upstream commit b4e002d ]
When the CPU that the QSPI interrupt handler runs on (typically CPU 0)
is excessively busy, it can lead to rare cases of the IRQ thread not
running before the transfer timeout is reached.
While handling the timeouts, any pending transfers are cleaned up and
the message that they correspond to is marked as failed, which leaves
the curr_xfer field pointing at stale memory.
To avoid this, clear curr_xfer to NULL upon timeout and check for this
condition when the IRQ thread is finally run.
While at it, also make sure to clear interrupts on failure so that new
interrupts can be run.
A better, more involved, fix would move the interrupt clearing into a
hard IRQ handler. Ideally we would also want to signal that the IRQ
thread no longer needs to be run after the timeout is hit to avoid the
extra check for a valid transfer.
Fixes: 921fc18 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Vishwaroop A <va@nvidia.com>
Link: https://patch.msgid.link/20251028155703.4151791-2-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 5a0060d commit 551060e
1 file changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
999 | 999 | | |
1000 | 1000 | | |
1001 | 1001 | | |
1002 | | - | |
| 1002 | + | |
1003 | 1003 | | |
| 1004 | + | |
| 1005 | + | |
1004 | 1006 | | |
1005 | 1007 | | |
1006 | 1008 | | |
| |||
1145 | 1147 | | |
1146 | 1148 | | |
1147 | 1149 | | |
1148 | | - | |
| 1150 | + | |
1149 | 1151 | | |
1150 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
1151 | 1155 | | |
1152 | 1156 | | |
1153 | 1157 | | |
| |||
1169 | 1173 | | |
1170 | 1174 | | |
1171 | 1175 | | |
| 1176 | + | |
1172 | 1177 | | |
1173 | 1178 | | |
1174 | 1179 | | |
1175 | 1180 | | |
1176 | 1181 | | |
| 1182 | + | |
1177 | 1183 | | |
1178 | 1184 | | |
1179 | 1185 | | |
| |||
1257 | 1263 | | |
1258 | 1264 | | |
1259 | 1265 | | |
| 1266 | + | |
| 1267 | + | |
1260 | 1268 | | |
1261 | 1269 | | |
1262 | 1270 | | |
| |||
1353 | 1361 | | |
1354 | 1362 | | |
1355 | 1363 | | |
| 1364 | + | |
1356 | 1365 | | |
1357 | 1366 | | |
1358 | 1367 | | |
| |||
1436 | 1445 | | |
1437 | 1446 | | |
1438 | 1447 | | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1439 | 1457 | | |
1440 | 1458 | | |
1441 | 1459 | | |
| |||
0 commit comments