Commit 1888e8f2f55c40656d8eff68572abb3748068b96

Authored by Nicolas Ferre
Committed by Mark Brown
1 parent 97ed465b4d

spi/spi-atmel: call unmapping on transfers buffers

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Showing 1 changed file with 5 additions and 3 deletions Side-by-side Diff

drivers/spi/spi-atmel.c
... ... @@ -1047,6 +1047,7 @@
1047 1047 struct spi_master *master = platform_get_drvdata(pdev);
1048 1048 struct atmel_spi *as = spi_master_get_devdata(master);
1049 1049 struct spi_message *msg;
  1050 + struct spi_transfer *xfer;
1050 1051  
1051 1052 /* reset the hardware and block queue progress */
1052 1053 spin_lock_irq(&as->lock);
... ... @@ -1058,9 +1059,10 @@
1058 1059  
1059 1060 /* Terminate remaining queued transfers */
1060 1061 list_for_each_entry(msg, &as->queue, queue) {
1061   - /* REVISIT unmapping the dma is a NOP on ARM and AVR32
1062   - * but we shouldn't depend on that...
1063   - */
  1062 + list_for_each_entry(xfer, &msg->transfers, transfer_list) {
  1063 + if (!msg->is_dma_mapped)
  1064 + atmel_spi_dma_unmap_xfer(master, xfer);
  1065 + }
1064 1066 msg->status = -ESHUTDOWN;
1065 1067 msg->complete(msg->context);
1066 1068 }