mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Johan Hovold <johan+linaro@kernel.org>,
	Mark Brown <broonie@kernel.org>, Vinod Koul <vkoul@kernel.org>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Sanyog Kale <sanyog.r.kale@intel.com>,
	Banajit Goswami <bgoswami@quicinc.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 5/8] ASoC: codecs: wcd934x: fix resource leaks on component remove
Date: Thu, 6 Jul 2023 12:09:34 +0100	[thread overview]
Message-ID: <af3ea27a-5940-5279-5590-fe7a42bdfdfa@linaro.org> (raw)
In-Reply-To: <20230705123018.30903-6-johan+linaro@kernel.org>



On 05/07/2023 13:30, Johan Hovold wrote:
> Make sure to release allocated MBHC resources also on component remove.
> 
> This is specifically needed to allow probe deferrals of the sound card
> which otherwise fails when reprobing the codec component.
> 
> Fixes: 9fb9b1690f0b ("ASoC: codecs: wcd934x: add mbhc support")
> Cc: stable@vger.kernel.org      # 5.14
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

>   sound/soc/codecs/wcd934x.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
> index a17cd75b969b..1b6e376f3833 100644
> --- a/sound/soc/codecs/wcd934x.c
> +++ b/sound/soc/codecs/wcd934x.c
> @@ -3044,6 +3044,17 @@ static int wcd934x_mbhc_init(struct snd_soc_component *component)
>   
>   	return 0;
>   }
> +
> +static void wcd934x_mbhc_deinit(struct snd_soc_component *component)
> +{
> +	struct wcd934x_codec *wcd = snd_soc_component_get_drvdata(component);
> +
> +	if (!wcd->mbhc)
> +		return;
> +
> +	wcd_mbhc_deinit(wcd->mbhc);
> +}
> +
>   static int wcd934x_comp_probe(struct snd_soc_component *component)
>   {
>   	struct wcd934x_codec *wcd = dev_get_drvdata(component->dev);
> @@ -3077,6 +3088,7 @@ static void wcd934x_comp_remove(struct snd_soc_component *comp)
>   {
>   	struct wcd934x_codec *wcd = dev_get_drvdata(comp->dev);
>   
> +	wcd934x_mbhc_deinit(comp);
>   	wcd_clsh_ctrl_free(wcd->clsh_ctrl);
>   }
>   

  reply	other threads:[~2023-07-06 11:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 12:30 [PATCH 0/8] ASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral Johan Hovold
2023-07-05 12:30 ` [PATCH 1/8] soundwire: fix enumeration completion Johan Hovold
2023-07-05 12:53   ` Pierre-Louis Bossart
2023-07-05 14:30     ` Johan Hovold
2023-07-05 14:44       ` Pierre-Louis Bossart
2023-07-05 12:30 ` [PATCH 2/8] ASoC: qdsp6: audioreach: fix topology probe deferral Johan Hovold
2023-07-06 11:09   ` Srinivas Kandagatla
2023-07-05 12:30 ` [PATCH 3/8] ASoC: codecs: wcd938x: fix missing clsh ctrl error handling Johan Hovold
2023-07-06 11:09   ` Srinivas Kandagatla
2023-07-05 12:30 ` [PATCH 4/8] ASoC: codecs: wcd938x: fix resource leaks on component remove Johan Hovold
2023-07-06 11:09   ` Srinivas Kandagatla
2023-07-05 12:30 ` [PATCH 5/8] ASoC: codecs: wcd934x: " Johan Hovold
2023-07-06 11:09   ` Srinivas Kandagatla [this message]
2023-07-05 12:30 ` [PATCH 6/8] ASoC: codecs: wcd-mbhc-v2: " Johan Hovold
2023-07-06 11:09   ` Srinivas Kandagatla
2023-07-05 12:30 ` [PATCH 7/8] ASoC: topology: suppress probe deferral errors Johan Hovold
2023-07-05 15:07   ` Amadeusz Sławiński
2023-07-06  6:14     ` Johan Hovold
2023-07-06  7:25       ` Amadeusz Sławiński
2023-07-10 12:01         ` Johan Hovold
2023-07-05 12:30 ` [PATCH 8/8] ASoC: core: " Johan Hovold
2023-07-10  8:53 ` (subset) [PATCH 0/8] ASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral Vinod Koul
2023-07-11 20:44 ` Mark Brown

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=af3ea27a-5940-5279-5590-fe7a42bdfdfa@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@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

all inboxes | Powered by JetHome®