[PATCH v6 0/4] ASoC: Intel: Fix MCLK leaks and clean up error
From: aravindanilraj0702
Date: Wed Apr 01 2026 - 18:10:24 EST
From: Aravind Anilraj <aravindanilraj0702@xxxxxxxxx>
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