[alsa-devel] regarding references taken on platform and codec driver modules

Koul, Vinod vinod.koul at intel.com
Thu Jan 6 10:11:29 CET 2011

> During the testing codec driver probe was failing and this results in wrong
> reference of platform driver .
> On investigating the issue is in soc_bind_dai_link()
> It takes the reference of cpu_dai and adds the dai in the runtime structure.
> But since the codec was not found these references are kept and modules cant be
> unloaded.
> Now thinking on this and other reference patch recently applied, IMO we can
> instead of taking the module reference check if cpu_dai is probed.
> If probed then only go ahead otherwise return error
This won't work either as cpu_dai is probed after bind_dai_link()

This issue is on removal of soc_remove() it doesn't free up the reference if the card is not instantiated
So in case one of the probes fails we should handle this in soc_remove in else for instantated
		    if (rtd->codec->probed)
                if (rtd->platform->probed)
                for (i = 0; i < card->num_rtd; i++)

Would this be the correct way to solve this?


More information about the Alsa-devel mailing list