Re: [PATCH] ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error

Cezary Rojewski
2026-04-28T08:25:23Z

On 2026-04-28 8:55 AM, Andy Shevchenko wrote:
> On Tue, Apr 28, 2026 at 5:38 AM Cássio Gabriel
> <cassiogabrielcontato@gmail.com> wrote:
>>
>> If byt_wm5102_prepare_and_enable_pll1() fails in the
>> SND_SOC_DAPM_EVENT_ON() path, platform_clock_control() returns after
>> clk_prepare_enable(priv->mclk) without disabling the clock again.
>>
>> This leaks an MCLK enable reference on failed power-up attempts. Add the
>> missing clk_disable_unprepare() on the error path, matching the unwind
>> used by the other Intel platform_clock_control() implementations.
>
> There are 6 drivers that do the same, why is only this one special?
> Have you checked the flow on the error path of the caller of this
> `platform_clock_control()`? Maybe there it calls with the opposite
> event to shut the clock down?
>
> ...
>
> TL;DR: If it's a real issue, it has to be fixed for all affected drivers.

There have been multiple reports regarding similar problem for all three
ATOM-based generations I believe. One of the more recent being "ASoC:
Intel: Fix MCLK leaks and clean up error" [1]. Does not look like there
is a single owner of that subject.

[1]:
https://lore.kernel.org/linux-sound/20260401220507.23557-1-aravindanilraj0702@gmail.com/

Kind regards,
Czarek