From: Takashi Iwai <tiwai@suse.de>
To: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: Re: [PATCH] ASoC: hda: increment codec device refcount when it is added to the card
Date: Fri, 31 May 2019 17:45:53 +0200 [thread overview]
Message-ID: <s5hy32mr5ji.wl-tiwai@suse.de> (raw)
In-Reply-To: <d62f5761b8fb4c156dc775fb0e0426c262d6bdcc.camel@linux.intel.com>
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
prev parent reply other threads:[~2019-05-31 15:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 20:18 [PATCH] ASoC: hda: increment codec device refcount when it is added to the card Ranjani Sridharan
2019-05-30 21:00 ` Pierre-Louis Bossart
2019-05-31 6:11 ` Takashi Iwai
2019-05-31 13:18 ` Ranjani Sridharan
2019-05-31 13:25 ` Takashi Iwai
2019-05-31 13:52 ` Ranjani Sridharan
2019-05-31 14:02 ` Takashi Iwai
2019-05-31 14:28 ` Takashi Iwai
2019-05-31 15:20 ` Ranjani Sridharan
2019-05-31 15:37 ` Takashi Iwai
2019-05-31 15:43 ` Ranjani Sridharan
2019-05-31 15:45 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hy32mr5ji.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.