diff options
author | 2021-09-16 11:50:08 +0300 | |
---|---|---|
committer | 2021-09-16 14:01:54 +0100 | |
commit | 8a8e1813ffc35111fc0b6db49968ceb0e1615ced (patch) | |
tree | 0f5085c9930ce432bc6550d72dee09ed04cc81dc /sound/soc/sof/core.c | |
parent | ASoC: SOF: imx: imx8m: Bar index is only valid for IRAM and SRAM types (diff) | |
download | linux-8a8e1813ffc35111fc0b6db49968ceb0e1615ced.tar.gz linux-8a8e1813ffc35111fc0b6db49968ceb0e1615ced.tar.bz2 linux-8a8e1813ffc35111fc0b6db49968ceb0e1615ced.zip |
ASoC: SOF: loader: release_firmware() on load failure to avoid batching
Invoke release_firmware() when the firmware fails to boot in
sof_probe_continue().
The request_firmware() framework must be informed of failures in
sof_probe_continue() otherwise its internal "batching"
feature (different from caching) cached the firmware image
forever. Attempts to correct the file in /lib/firmware/ were then
silently and confusingly ignored until the next reboot. Unloading the
drivers did not help because from their disconnected perspective the
firmware had failed so there was nothing to release.
Also leverage the new snd_sof_fw_unload() function to simplify the
snd_sof_device_remove() function.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210916085008.28929-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/core.c')
-rw-r--r-- | sound/soc/sof/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 3e4dd4a86363..59d0d7b2b55c 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -371,7 +371,6 @@ int snd_sof_device_remove(struct device *dev) dev_warn(dev, "error: %d failed to prepare DSP for device removal", ret); - snd_sof_fw_unload(sdev); snd_sof_ipc_free(sdev); snd_sof_free_debug(sdev); snd_sof_free_trace(sdev); @@ -394,8 +393,7 @@ int snd_sof_device_remove(struct device *dev) snd_sof_remove(sdev); /* release firmware */ - release_firmware(pdata->fw); - pdata->fw = NULL; + snd_sof_fw_unload(sdev); return 0; } |