mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
spi: davinci: do not use DMA for vmalloc'ed buffers
Using vmalloc'ed buffers will fail since daVinci has VIVT cache and only the kernel lowmem virtual address is invalidated/flushed when performing DMA. The virtual address returned from vmalloc() is not invalidated/flushed and may contain stale data when returning from spi_sync(). Fixes errors when running UBIFS over SPI NOR. Revert this when all upper layer users of vmalloc'ed buffers sent to SPI handles cache flushing/invalidating. Signed-off-by: Frode Isaksen <fisaksen@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0718b76488
commit
4dd9becbce
1 changed files with 3 additions and 1 deletions
|
@ -482,7 +482,9 @@ static bool davinci_spi_can_dma(struct spi_master *master,
|
|||
|
||||
if (spicfg)
|
||||
can_dma = (spicfg->io_type == SPI_IO_TYPE_DMA) &&
|
||||
(xfer->len >= DMA_MIN_BYTES);
|
||||
(xfer->len >= DMA_MIN_BYTES) &&
|
||||
!is_vmalloc_addr(xfer->rx_buf) &&
|
||||
!is_vmalloc_addr(xfer->tx_buf);
|
||||
|
||||
return can_dma;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue