Commit da56009
spi: Check if transfer is mapped before calling DMA sync APIs
The resent update to remove the orig_nents checks revealed
that not all DMA sync backends can cope with the unallocated
SG list, while supplying orig_nents == 0 (the commit 861370f
("iommu/dma: force bouncing if the size is not cacheline-aligned"),
for example, makes that happen for the IOMMU case). It means
we have to check if the buffers are DMA mapped before trying
to sync them. Re-introduce that check in a form of calling
->can_dma() in the same way as it's done in the DMA mapping loop
for the SPI transfers.
Reported-by: Nícolas F. R. A. Prado <[email protected]>
Reported-by: Neil Armstrong <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]
Closes: https://lore.kernel.org/all/d3679496-2e4e-4a7c-97ed-f193bd53af1d@notapiano
Fixes: 8cc3bad ("spi: Remove unneded check for orig_nents")
Suggested-by: Nícolas F. R. A. Prado <[email protected]>
Tested-by: Nícolas F. R. A. Prado <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>1 parent 9f788ba commit da56009
1 file changed
+13
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1311 | 1311 | | |
1312 | 1312 | | |
1313 | 1313 | | |
1314 | | - | |
| 1314 | + | |
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
| |||
1320 | 1320 | | |
1321 | 1321 | | |
1322 | 1322 | | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1323 | 1326 | | |
1324 | 1327 | | |
1325 | 1328 | | |
1326 | 1329 | | |
1327 | | - | |
| 1330 | + | |
1328 | 1331 | | |
1329 | 1332 | | |
1330 | 1333 | | |
| |||
1333 | 1336 | | |
1334 | 1337 | | |
1335 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1336 | 1342 | | |
1337 | 1343 | | |
1338 | 1344 | | |
| |||
1350 | 1356 | | |
1351 | 1357 | | |
1352 | 1358 | | |
| 1359 | + | |
1353 | 1360 | | |
1354 | 1361 | | |
1355 | 1362 | | |
1356 | 1363 | | |
1357 | 1364 | | |
| 1365 | + | |
1358 | 1366 | | |
1359 | 1367 | | |
1360 | 1368 | | |
| |||
1626 | 1634 | | |
1627 | 1635 | | |
1628 | 1636 | | |
1629 | | - | |
| 1637 | + | |
1630 | 1638 | | |
1631 | 1639 | | |
1632 | | - | |
| 1640 | + | |
1633 | 1641 | | |
1634 | 1642 | | |
1635 | 1643 | | |
| |||
1654 | 1662 | | |
1655 | 1663 | | |
1656 | 1664 | | |
1657 | | - | |
| 1665 | + | |
1658 | 1666 | | |
1659 | 1667 | | |
1660 | 1668 | | |
| |||
0 commit comments