On Fri, 31 May 2019 17:43:53 +0200, Ranjani Sridharan wrote:
Hi Takashi,
No, this actually comes at the second step in the case of SOF (ie after the machine driver is unregistered).
Actually, I just found out what's causing the issue. It is the call to snd_hda_codec_dev_free() which calls put_device() when snd_card_free() is invoked. So, adding a get_device() in snd_hda_codec_device_new() would make the refcount balanced.
On the other hand, removing the put_device() in snd_hda_codec_dev_free() would also address the problem. I'm not sure which would be the preferred route.
The latter one, I'd say.
Actually the difference between ASoC and the legacy HDA bus is who releases the device object. For HDA legacy bus, it's supposed to be done via snd_device_free() chain, while ASoC bus releases explicitly as shown in my previous post.
So, if any, I'd paper over it like below.
OK, makes sense. Let me send a V2 with the change.
Also, should I also look into adding the change to make hdac_hdmi codec card managed as well?
Well, feel free to fix more bugs, of course ;)
BTW, I'll be on vacation from tomorrow for a week, so my reply will be delayed.
thanks,
Takashi