]> git.baikalelectronics.ru Git - kernel.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)
commitb29d243c9ef617bda844a5a4e347cd2dddf9409d
treed19ab260e654790aff9b4a031efded45795df1bb
parentbd3e44d381e2f84d68faea77bd0ea48982c9c773
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