]> asedeno.scripts.mit.edu Git - linux.git/commit
ASoC: ti: davinci-i2s: Move the XSYNCERR workaround to .prepare callback
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 30 Aug 2019 10:38:39 +0000 (13:38 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 30 Aug 2019 11:21:20 +0000 (12:21 +0100)
commita2dc6f82fd86fa165222f6062e2478fd122f9f1c
treed19ab260e654790aff9b4a031efded45795df1bb
parentcc9bbb6cde6c321706f1eff79d077b4a91cd5d12
ASoC: ti: davinci-i2s: Move the XSYNCERR workaround to .prepare callback

Currently the driver uses snd_soc_rtdcom_lookup() in it's mcbsp_start
function to try to stop/restart the DMA as the initial XSYNCERR workaround
need to be done before the DMA is armed.

There are couple of things wrong with this:
- the driver crashes with NULL pointer dereference as the
  component->driver->ops is actually NULL
- the driver should not use snd_soc_rtdcom_lookup() in the first place
- Fiddling with DMA is never a good thing

Move the workaround handling to .prepare which is called before the DMA is
armed, so it complies with the requirements.

Reported-by (usage of snd_soc_rtdcom_lookup): Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190830103841.25128-3-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ti/davinci-i2s.c