]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: core: remove DSP after unregistering machine driver
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Fri, 24 May 2019 19:09:17 +0000 (14:09 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 28 May 2019 14:46:37 +0000 (15:46 +0100)
commit95c43438bc6bb424128fc516679acf6ad32c0430
tree286bb29274f4629b3d0dfa7d75bcdab0f255e099
parent831367d45c938bf06c7a2af565b7fe95e3f85a8b
ASoC: SOF: core: remove DSP after unregistering machine driver

snd_sof_remove() disables the DSP and unmaps the DSP BAR.
Removing topology after disabling the DSP results in a
kernel panic while unloading the pipeline widget. This is
because pipeline widget unload attempts to power down
the core it is scheduled on by accessing the DSP registers.

So, the suggested fix here is to unregister the machine driver
first to remove the topology and then disable the DSP
to avoid the situation described above.

Note that the kernel panic only happens in cases where the
HDaudio link is not managed by the hdac library,
e.g. no codec or when HDMI is not supported.
When the hdac library is used, snd_sof_remove() calls
snd_hdac_ext_bus_device_remove() to remove the codec which
unregisters the component driver thereby also removing the
topology before the DSP is disabled.

Fixes: 0aafc1dc38e ("ASoC: SOF: Add Sound Open Firmware driver core")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/core.c