Skip to content

Commit 76a01ed

Browse files
committed
ASoC: SOF: core: Unregister machine driver before IPC and debugfs
To ensure clean unload of the machine driver, components and topology, do the unregister before we free IPC and debugfs. It is a possibility that part of the unregister we would have IPC communication with the firmware. Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent ec639e6 commit 76a01ed

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

sound/soc/sof/core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,13 @@ int snd_sof_device_remove(struct device *dev)
362362
if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
363363
cancel_work_sync(&sdev->probe_work);
364364

365+
/*
366+
* Unregister machine driver. This will unbind the snd_card which
367+
* will remove the component driver and unload the topology
368+
* before freeing the snd_card.
369+
*/
370+
snd_sof_machine_unregister(sdev, pdata);
371+
365372
if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) {
366373
ret = snd_sof_dsp_power_down_notify(sdev);
367374
if (ret < 0)
@@ -373,13 +380,6 @@ int snd_sof_device_remove(struct device *dev)
373380
snd_sof_free_trace(sdev);
374381
}
375382

376-
/*
377-
* Unregister machine driver. This will unbind the snd_card which
378-
* will remove the component driver and unload the topology
379-
* before freeing the snd_card.
380-
*/
381-
snd_sof_machine_unregister(sdev, pdata);
382-
383383
/*
384384
* Unregistering the machine driver results in unloading the topology.
385385
* Some widgets, ex: scheduler, attempt to power down the core they are

0 commit comments

Comments
 (0)