Repository navigation
More module unload fixes - #788
Conversation
plbossart
left a comment
There was a problem hiding this comment.
Some styles issues and one fundamental doubt on the unbind_card() changes.
There was a problem hiding this comment.
remove line, run checkpatch.pl --strict!
There was a problem hiding this comment.
not sure if the comment adds any value.
There was a problem hiding this comment.
this patch is the one I am most scared of. I don't see a moral equivalent in snd_soc_bind_card that would add link components and don't know the internals of the ASoC code enough to judge if this is legit or not. Either you find a self-explanatory way of doing this or you have to run this by Mark Brown.
There was a problem hiding this comment.
@plbossart let me submit a RFC patchset to the mailing list to get some feedback. What I did find was as far as I could tell none of the component drivers implement the remove() callback. So I doubt this will break anything. But I'll check with him anyway.
There was a problem hiding this comment.
@plbossart that was easy. the most controversial one was the first one to be accepted. I'll clean up this PR based on Mark's feedback. I'll drop the first one and keep the rest.
|
@xiulipan this looks like an across-the-board CI fail. No activity in 1 hour? |
|
I've submitted the first 3 patches upstream for comments and I will update the PR based on feedback. |
Topology is not unloaded in the core during unregister_component() anymore. So, add the remove() callback that will unload the topology. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When the card is registered by the machine driver, dai link components are probed after the snd_card is created. This is done in snd_soc_bind_card() which calls snd_soc_instantiate_card() to first create the snd_card and then probes the link components by calling soc_probe_link_components(). The snd_card is used by the component driver to add the kcontrols associated with dapm widgets to the card. When the machine driver is unregistered, the snd_card is freed when the card resources are cleaned up. But the snd_card needs to be valid while unloading the topology dapm widgets in order to remove the kcontrols from the card. Since, unloading topology is done when the component driver is removed, the link components should be removed in snd_soc_unbind_card(). This will ensure that the kcontrols are removed before the card resources are cleaned up and the snd_card itself is freed. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Topology should be removed when the link components are removed when the machine driver is unregistered. This will prevent the NULL pointer derefernce encountered when removing widget kcontrol's from the sound card. So, remove the topology in the remove() callback for the SOF component driver. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Previously, we couldn't make the component driver resource-managed because topology unloading was done by the core when the component driver was unregistered. But this has been fixed to allow topology removal during the component driver remove() callback and there aren't any NULL pointer dereferences anymore. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
|
This looks clean and Mark seems to have applied the complex one already. Nice! |
|
@plbossart |
No description provided.