[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7e37e951-17ad-4cac-a855-33c48ae0a283@sirena.org.uk>
Date: Wed, 12 Feb 2025 14:58:45 +0000
From: Mark Brown <broonie@...nel.org>
To: Shengjiu Wang <shengjiu.wang@....com>
Cc: shengjiu.wang@...il.com, Xiubo.Lee@...il.com, festevam@...il.com,
nicoleotsuka@...il.com, lgirdwood@...il.com, perex@...ex.cz,
tiwai@...e.com, linuxppc-dev@...ts.ozlabs.org,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: imx-audmix: release cpu_mclk clock at failure
On Wed, Feb 12, 2025 at 05:38:16PM +0800, Shengjiu Wang wrote:
> When defer probe happens, there may be below error:
>
> platform 59820000.sai: Resources present before probing
>
> The cpu_mclk clock is from the cpu dai device, if it is
> not released, then the cpu dai device probe will fail
> for the second time.
> ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
> if (ret) {
> + devm_clk_put(&cpu_pdev->dev, priv->cpu_mclk);
The driver shouldn't be using another driver's device to do devm_
requests (or really to look anything up), that's just going to lead to
trouble like this - if it's got to look up another device's clocks it
should do a regular clk_get(). There will also potentially be problems
if the other device unregisters first and frees our clock underneath us,
and this will request multiple copies of the clock if we unbind and
rebind the imx-audmix driver.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists