[PATCH v6 0/4] ASoC: Intel: Fix MCLK leaks and clean up error

aravindanilraj0702@gmail.com posted 4 patches 2 months, 1 week ago
sound/soc/intel/boards/bytcr_rt5640.c   | 4 +++-
sound/soc/intel/boards/bytcr_rt5651.c   | 4 +++-
sound/soc/intel/boards/cht_bsw_rt5672.c | 6 +++++-
3 files changed, 11 insertions(+), 3 deletions(-)
[PATCH v6 0/4] ASoC: Intel: Fix MCLK leaks and clean up error
Posted by aravindanilraj0702@gmail.com 2 months, 1 week ago
From: Aravind Anilraj <aravindanilraj0702@gmail.com>

This series fixes MCLK resource leaks in the platform_clock_control()
implementations for bytcr_rt5640, bytcr_rt5651, and cht_bsw_rt5672.

In the SND_SOC_DAPM_EVENT_ON() path, clk_prepare_enable() is called to
enable MCLK, but subsequent failures in codec clock configuration (eg:
*_prepare_and_enable_pll1() or snd_soc_dai_set_sysclk()) return without
disabling the clock, leaking a reference.

Patches 1-3 fix this by adding the missing clk_disable_unprepare() calls
in the relevant error paths, ensuring proper symmetry between enable and
disable operations within the EVENT_ON scope.

Patch 4 moves unrelated logging changes into a separate patch and
standardizes error messages.

Changes in v6:
Place cleanup logic within SND_SOC_DAPM_EVENT_ON() scope
Avoid redundant condition checks in error paths
Split logging changes into a separate patch
Address review feedback from Mark Brown and Cezary Rojewski

Aravind Anilraj (4):
  ASoC: Intel: bytcr_rt5640: Fix MCLK leak on platform_clock_control
    error
  ASoC: Intel: bytcr_rt5651: Fix MCLK leak on platform_clock_control
    error
  ASoC: Intel: cht_bsw_rt5672: Fix MCLK leak on platform_clock_control
    error
  ASoC: Intel: Standardize MCLK error logs across RT boards

 sound/soc/intel/boards/bytcr_rt5640.c   | 4 +++-
 sound/soc/intel/boards/bytcr_rt5651.c   | 4 +++-
 sound/soc/intel/boards/cht_bsw_rt5672.c | 6 +++++-
 3 files changed, 11 insertions(+), 3 deletions(-)

-- 
2.47.3
Re: [PATCH v6 0/4] ASoC: Intel: Fix MCLK leaks and clean up error
Posted by Mark Brown 2 months, 1 week ago
On Wed, 01 Apr 2026 18:05:03 -0400, aravindanilraj0702@gmail.com wrote:
> ASoC: Intel: Fix MCLK leaks and clean up error
> 
> From: Aravind Anilraj <aravindanilraj0702@gmail.com>
> 
> This series fixes MCLK resource leaks in the platform_clock_control()
> implementations for bytcr_rt5640, bytcr_rt5651, and cht_bsw_rt5672.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1

Thanks!

[1/4] ASoC: Intel: bytcr_rt5640: Fix MCLK leak on platform_clock_control error
      https://git.kernel.org/broonie/sound/c/a02496a29463
[2/4] ASoC: Intel: bytcr_rt5651: Fix MCLK leak on platform_clock_control error
      https://git.kernel.org/broonie/sound/c/b022e5c142ef
[3/4] ASoC: Intel: cht_bsw_rt5672: Fix MCLK leak on platform_clock_control error
      https://git.kernel.org/broonie/sound/c/dced5a373a96
[4/4] ASoC: Intel: Standardize MCLK error logs across RT boards
      https://git.kernel.org/broonie/sound/c/85c38c2fa17d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: [PATCH v6 0/4] ASoC: Intel: Fix MCLK leaks and clean up error
Posted by Aravind 2 months, 1 week ago
Thanks Mark, appreciate it.

On Fri, Apr 3, 2026 at 12:53 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Wed, 01 Apr 2026 18:05:03 -0400, aravindanilraj0702@gmail.com wrote:
> > ASoC: Intel: Fix MCLK leaks and clean up error
> >
> > From: Aravind Anilraj <aravindanilraj0702@gmail.com>
> >
> > This series fixes MCLK resource leaks in the platform_clock_control()
> > implementations for bytcr_rt5640, bytcr_rt5651, and cht_bsw_rt5672.
> >
> > [...]
>
> Applied to
>
>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1
>
> Thanks!
>
> [1/4] ASoC: Intel: bytcr_rt5640: Fix MCLK leak on platform_clock_control error
>       https://git.kernel.org/broonie/sound/c/a02496a29463
> [2/4] ASoC: Intel: bytcr_rt5651: Fix MCLK leak on platform_clock_control error
>       https://git.kernel.org/broonie/sound/c/b022e5c142ef
> [3/4] ASoC: Intel: cht_bsw_rt5672: Fix MCLK leak on platform_clock_control error
>       https://git.kernel.org/broonie/sound/c/dced5a373a96
> [4/4] ASoC: Intel: Standardize MCLK error logs across RT boards
>       https://git.kernel.org/broonie/sound/c/85c38c2fa17d
>
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
>
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
>
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
>
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
>
> Thanks,
> Mark
>
Re: [PATCH v6 0/4] ASoC: Intel: Fix MCLK leaks and clean up error
Posted by Cezary Rojewski 2 months, 1 week ago
On 2026-04-02 12:05 AM, aravindanilraj0702@gmail.com wrote:
> From: Aravind Anilraj <aravindanilraj0702@gmail.com>
> 
> This series fixes MCLK resource leaks in the platform_clock_control()
> implementations for bytcr_rt5640, bytcr_rt5651, and cht_bsw_rt5672.
> 
> In the SND_SOC_DAPM_EVENT_ON() path, clk_prepare_enable() is called to
> enable MCLK, but subsequent failures in codec clock configuration (eg:
> *_prepare_and_enable_pll1() or snd_soc_dai_set_sysclk()) return without
> disabling the clock, leaking a reference.
> 
> Patches 1-3 fix this by adding the missing clk_disable_unprepare() calls
> in the relevant error paths, ensuring proper symmetry between enable and
> disable operations within the EVENT_ON scope.
> 
> Patch 4 moves unrelated logging changes into a separate patch and
> standardizes error messages.
> 
> Changes in v6:
> Place cleanup logic within SND_SOC_DAPM_EVENT_ON() scope
> Avoid redundant condition checks in error paths
> Split logging changes into a separate patch
> Address review feedback from Mark Brown and Cezary Rojewski
> 
> Aravind Anilraj (4):
>    ASoC: Intel: bytcr_rt5640: Fix MCLK leak on platform_clock_control
>      error
>    ASoC: Intel: bytcr_rt5651: Fix MCLK leak on platform_clock_control
>      error
>    ASoC: Intel: cht_bsw_rt5672: Fix MCLK leak on platform_clock_control
>      error
>    ASoC: Intel: Standardize MCLK error logs across RT boards
> 
>   sound/soc/intel/boards/bytcr_rt5640.c   | 4 +++-
>   sound/soc/intel/boards/bytcr_rt5651.c   | 4 +++-
>   sound/soc/intel/boards/cht_bsw_rt5672.c | 6 +++++-
>   3 files changed, 11 insertions(+), 3 deletions(-)
> 

Thank you for the update. For the series:

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>