]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: trace: Use proper DMA direction for the trace data buffer
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 10 Mar 2022 17:16:49 +0000 (11:16 -0600)
committerMark Brown <broonie@kernel.org>
Fri, 11 Mar 2022 13:40:55 +0000 (13:40 +0000)
commitab4a0c72b45c19534b6f88e0c7fa44ef0cc79fea
tree74a7fef3e536a9be29f96700a1574a03d84ba883
parentfe839d33be6ebf2ac1991be73029e25746a9e7a9
ASoC: SOF: trace: Use proper DMA direction for the trace data buffer

Buffers allocated with snd_dma_alloc_pages() will have DMA direction
DMA_BIDIRECTIONAL. The trace data memory is only used for one DMA
direction: DMA_FROM_DEVICE, DMA only writes there, never reads.

We also need to do a sync before accessing (reading with CPU) from the
trace data buffer to copy it to user space.

Note: snd_dma_buffer_sync() is also used for normal playback and capture
streams to make sure that the data is available for the DMA or CPU.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220310171651.249385-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/trace.c