Commit 75e33c55 authored by Ville Baillie's avatar Ville Baillie Committed by Mark Brown

spi: atmel: Fix PDC transfer setup bug

atmel_spi_dma_map_xfer to never be called in PDC mode. This causes the
driver to silently fail.

This patch changes the conditional to match the behaviour of the
previous commit before the refactor.

Fixes: 5fa5e6de ("spi: atmel: Switch to transfer_one transfer method")
Signed-off-by: default avatarVille Baillie <villeb@bytesnap.co.uk>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210921072132.21831-1-villeb@bytesnap.co.ukSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 59c4e190
...@@ -1301,7 +1301,7 @@ static int atmel_spi_one_transfer(struct spi_master *master, ...@@ -1301,7 +1301,7 @@ static int atmel_spi_one_transfer(struct spi_master *master,
* DMA map early, for performance (empties dcache ASAP) and * DMA map early, for performance (empties dcache ASAP) and
* better fault reporting. * better fault reporting.
*/ */
if ((!master->cur_msg_mapped) if ((!master->cur_msg->is_dma_mapped)
&& as->use_pdc) { && as->use_pdc) {
if (atmel_spi_dma_map_xfer(as, xfer) < 0) if (atmel_spi_dma_map_xfer(as, xfer) < 0)
return -ENOMEM; return -ENOMEM;
...@@ -1381,7 +1381,7 @@ static int atmel_spi_one_transfer(struct spi_master *master, ...@@ -1381,7 +1381,7 @@ static int atmel_spi_one_transfer(struct spi_master *master,
} }
} }
if (!master->cur_msg_mapped if (!master->cur_msg->is_dma_mapped
&& as->use_pdc) && as->use_pdc)
atmel_spi_dma_unmap_xfer(master, xfer); atmel_spi_dma_unmap_xfer(master, xfer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment