Skip to content
Unverified Commit 1da53d23 authored by Ivan Bornyakov's avatar Ivan Bornyakov Committed by Xu Yilun
Browse files

fpga: microchip-spi: move SPI I/O buffers out of stack



As spi-summary doc says:
 > I/O buffers use the usual Linux rules, and must be DMA-safe.
 > You'd normally allocate them from the heap or free page pool.
 > Don't use the stack, or anything that's declared "static".

Replace spi_write() with spi_write_then_read(), which is dma-safe for
on-stack buffers. Use cacheline aligned buffers for transfers used in
spi_sync_transfer().

Although everything works OK with stack-located I/O buffers, better
follow the doc to be safe.

Fixes: 5f8d4a90 ("fpga: microchip-spi: add Microchip MPF FPGA manager")
Signed-off-by: default avatarIvan Bornyakov <i.bornyakov@metrotek.ru>
Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
Acked-by: default avatarXu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20221230092922.18822-2-i.bornyakov@metrotek.ru


Signed-off-by: default avatarXu Yilun <yilun.xu@intel.com>
parent 1b929c02
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment