aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/fpga-mgr.c
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2024-05-22 17:09:50 +0000
committerMark Brown <[email protected]>2024-05-23 11:32:54 +0000
commitda560097c05612f8d360f86528f6213629b9c395 (patch)
tree842b0b073f684f20612b128b0251563adc0fb270 /drivers/fpga/fpga-mgr.c
parentspi: Don't mark message DMA mapped when no transfer in it is (diff)
downloadkernel-da560097c05612f8d360f86528f6213629b9c395.tar.gz
kernel-da560097c05612f8d360f86528f6213629b9c395.zip
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 861370f49ce4 ("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: 8cc3bad9d9d6 ("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]>
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions