From: Takashi Iwai <tiwai@suse.de>
To: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: alsa-devel@alsa-project.org,
"\"Amadeusz Sławiński\"" <amadeuszx.slawinski@linux.intel.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Cezary Rojewski" <cezary.rojewski@intel.com>,
"Mark Brown" <broonie@kernel.org>,
"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
"Jie Yang" <yang.jie@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH v2 09/11] ASoC: Intel: hdac_hdmi: Set ops to NULL on remove
Date: Tue, 18 Jun 2019 07:16:28 +0200 [thread overview]
Message-ID: <s5h4l4nbhhv.wl-tiwai@suse.de> (raw)
In-Reply-To: <1fd4af8e1b4bad5eda6f1e2f747b7988c74408fb.camel@linux.intel.com>
On Tue, 18 Jun 2019 06:19:15 +0200,
Ranjani Sridharan wrote:
>
> On Mon, 2019-06-17 at 23:36 +0200, Takashi Iwai wrote:
> > On Mon, 17 Jun 2019 22:51:42 +0200,
> > Ranjani Sridharan wrote:
> > >
> > > On Mon, 2019-06-17 at 13:36 +0200, Amadeusz Sławiński wrote:
> > > > When we unload Skylake driver we may end up calling
> > > > hdac_component_master_unbind(), it uses acomp->audio_ops, which
> > > > we
> > > > set
> > > > in hdmi_codec_probe(), so we need to set it to NULL in
> > > > hdmi_codec_remove(),
> > > > otherwise we will dereference no longer existing pointer.
> > >
> > > Hi Amadeusz,
> > >
> > > It looks like the audio_ops should be deleted
> > > snd_hdac_acomp_exit().
> >
> > It's a different one. The codec driver registers / de-registers the
> > notifier at its probe/remove, while the controller driver takes care
> > of snd_hdac_acomp_init(). snd_hdac_acomp_exit() is usually not
> > needed
> > to be called explicitly, as it's managed via devres.
>
> Makes sense, thanks Takashi. But I am still wondering why we havent
> seen this issue with SOF yet. We run the module unload/reload stress
> test as well and havent seen this yet.
Usually this isn't a problem as the controller is removed at first.
But if the codec is unbound at first by some reason, it can be a
problem without unregistering, I guess.
Takashi
>
> Thanks,
> Ranjani
> >
> >
> > Takashi
> >
> > > Also, this doesnt seem to be the case with when the SOF driver is
> > > removed.
> > > Could you please give a bit more context on what error you see when
> > > this happens?
> > >
> > > Thanks,
> > > Ranjani
> > > >
> > > > Signed-off-by: Amadeusz Sławiński <
> > > > amadeuszx.slawinski@linux.intel.com>
> > > > ---
> > > > sound/soc/codecs/hdac_hdmi.c | 6 ++++++
> > > > 1 file changed, 6 insertions(+)
> > > >
> > > > diff --git a/sound/soc/codecs/hdac_hdmi.c
> > > > b/sound/soc/codecs/hdac_hdmi.c
> > > > index 911bb6e2a1ac..9ee1bff548d8 100644
> > > > --- a/sound/soc/codecs/hdac_hdmi.c
> > > > +++ b/sound/soc/codecs/hdac_hdmi.c
> > > > @@ -1890,6 +1890,12 @@ static void hdmi_codec_remove(struct
> > > > snd_soc_component *component)
> > > > {
> > > > struct hdac_hdmi_priv *hdmi =
> > > > snd_soc_component_get_drvdata(component);
> > > > struct hdac_device *hdev = hdmi->hdev;
> > > > + int ret;
> > > > +
> > > > + ret = snd_hdac_acomp_register_notifier(hdev->bus, NULL);
> > > > + if (ret < 0)
> > > > + dev_err(&hdev->dev, "notifier unregister failed: err:
> > > > %d\n",
> > > > + ret);
> > > >
> > > > pm_runtime_disable(&hdev->dev);
> > > > }
> > >
> > >
>
next prev parent reply other threads:[~2019-06-18 7:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 11:36 [PATCH v2 00/11] Fix driver reload issues Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 01/11] ASoC: Intel: Skylake: Initialize lists before access so they are safe to use Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 02/11] ALSA: hdac: Fix codec name after machine driver is unloaded and reloaded Amadeusz Sławiński
2019-06-17 15:29 ` Takashi Iwai
2019-06-17 11:36 ` [PATCH v2 03/11] ASoC: compress: Fix memory leak from snd_soc_new_compress Amadeusz Sławiński
2019-06-25 12:01 ` Mark Brown
2019-06-17 11:36 ` [PATCH v2 04/11] ASoC: Intel: Skylake: Don't return failure on machine driver reload Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 05/11] ASoC: Intel: Skylake: Remove static table index when parsing topology Amadeusz Sławiński
2019-06-26 12:26 ` Mark Brown
2019-06-17 11:36 ` [PATCH v2 06/11] ASoC: Intel: Skylake: Add function to cleanup debugfs interface Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 07/11] ASoC: Intel: Skylake: Properly cleanup on component removal Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 08/11] ASoC: Intel: Skylake: Fix NULL ptr dereference when unloading clk dev Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 09/11] ASoC: Intel: hdac_hdmi: Set ops to NULL on remove Amadeusz Sławiński
2019-06-17 20:51 ` [alsa-devel] " Ranjani Sridharan
2019-06-17 21:36 ` Takashi Iwai
2019-06-18 4:19 ` Ranjani Sridharan
2019-06-18 5:16 ` Takashi Iwai [this message]
2019-06-18 11:00 ` Amadeusz Sławiński
2019-06-18 15:58 ` Ranjani Sridharan
2019-06-19 8:38 ` Amadeusz Sławiński
2019-06-19 21:09 ` Ranjani Sridharan
2019-06-20 6:17 ` Pierre-Louis Bossart
2019-06-24 7:50 ` Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 10/11] ASoC: topology: Consolidate how dtexts and dvalues are freed Amadeusz Sławiński
2019-06-17 11:36 ` [PATCH v2 11/11] ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow Amadeusz Sławiński
2019-06-25 1:17 ` [alsa-devel] " Ranjani Sridharan
2019-06-25 12:04 ` [PATCH v2 00/11] Fix driver reload issues Mark Brown
2019-06-25 13:02 ` [alsa-devel] " Pierre-Louis Bossart
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=s5h4l4nbhhv.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=yang.jie@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).