This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI DMA Cache Flush issue

Other Parts Discussed in Thread: DM3730

Hi,

 

Tryign to use DMA to offload SPI trabnsfers for a project and have run to an issue which looks liek a cache flush related problem. 

 

I have used  kmalloc(sizeof( RxPackets), GFP_KERNEL ); to allocate a buffer and then usign the spi driver to manage the transfer, this will often work at low data rates but as data rates increase I find that data is invalid and a test pattern written to memory (before the aysnch transfer request) is not overqritten despiote completion of the spi request.

 

Its not clear to me if I have requested the right type of memory, or if I shoudl eb using the dma_alloc_coherent( ) interface to allocate the buffre needed and then passing in the physical address as part of the spi message.

 

I have seen reference to dma_alloc_coherent( ) and have trioed this but get a warning that the  "spi4.0: coherent DMA mask is unset" when the driver attemtps to allocate I assume that I need to set the dma mask for the driver.

 

Uisng ti-dvsdk_dm3730-evm_4_01_00_09 at the monent, contemplatign updatign to the newer version but not usre it will help with this.

 

Questions I guess are:

 

1) What is the correct approach?

2) Are there any example sof this in drivers for the OMAP I can use a referebnce, can;t seem to find a good refercne to use.

 

All help welcome.

 

David