[PATCH v3 00/12] ASoC: mediatek: mt8189: Improve error handling

phucduc.bui@gmail.com posted 12 patches 1 week, 2 days ago
sound/soc/mediatek/mt8189/mt8189-afe-clk.c | 134 +++++++++++++++------
sound/soc/mediatek/mt8189/mt8189-afe-pcm.c |  45 ++++---
sound/soc/mediatek/mt8189/mt8189-dai-i2s.c |  18 ++-
sound/soc/mediatek/mt8189/mt8189-dai-tdm.c |  19 ++-
4 files changed, 154 insertions(+), 62 deletions(-)
[PATCH v3 00/12] ASoC: mediatek: mt8189: Improve error handling
Posted by phucduc.bui@gmail.com 1 week, 2 days ago
From: bui duc phuc <phucduc.bui@gmail.com>

Hi all,

This series addresses part of the error handling in the MT8189 AFE driver.

It propagates errors from clock operations and runtime resume, validates
clock parameters, and removes redundant error messages.

In v2, there was discussion about checking the return value of 
regmap_update_bits(). While opinions differed, the existing driver already 
checks it in mt8189_afe_enable_top_cg(), which is used by 
mt8189_apll1_enable() and mt8189_apll2_enable() touched by this series.

Therefore, I keep these checks and add the corresponding error paths for 
consistency.

Compile-tested only.

Link v1 : 
https://lore.kernel.org/all/20260910125742.150902-1-phucduc.bui@gmail.com/
Link v2:
https://lore.kernel.org/all/20260914072842.24420-1-phucduc.bui@gmail.com/

Changes in v2:
 - Update the names of the goto labels.
 - Check for zero frequency since freq is unsigned. 
Changes in v3:
 - Add Angelo's Reviewed-by tag.
 - Restore the existing afe->regmap checks, 
   making the separate patch for missing regmap unnecessary.
 - Do not pre-initialize ret; set ret = 0 in the default case throughout 
   the series.

Best regards,
Phuc

bui duc phuc (12):
  ASoC: mediatek: mt8189: Propagate APLL enable errors
  ASoC: mediatek: mt8189: Propagate MCK enable errors
  ASoC: mediatek: mt8189: Validate MCK ID
  ASoC: mediatek: mt8189: Propagate reg_rw clock errors
  ASoC: mediatek: mt8189: Use dev_err_probe() for clock errors
  ASoC: mediatek: mt8189: Propagate runtime resume errors
  ASoC: mediatek: mt8189: Remove redundant error message
  ASoC: mediatek: mt8189: Propagate APLL errors
  ASoC: mediatek: mt8189: Propagate MCLK errors
  ASoC: mediatek: mt8189: Validate sysclk frequency
  ASoC: mediatek: mt8189: Propagate TDM clock errors
  ASoC: mediatek: mt8189: Validate TDM MCLK frequency

 sound/soc/mediatek/mt8189/mt8189-afe-clk.c | 134 +++++++++++++++------
 sound/soc/mediatek/mt8189/mt8189-afe-pcm.c |  45 ++++---
 sound/soc/mediatek/mt8189/mt8189-dai-i2s.c |  18 ++-
 sound/soc/mediatek/mt8189/mt8189-dai-tdm.c |  19 ++-
 4 files changed, 154 insertions(+), 62 deletions(-)

-- 
2.43.0
Re: [PATCH v3 00/12] ASoC: mediatek: mt8189: Improve error handling
Posted by AngeloGioacchino Del Regno 1 week, 1 day ago
On 9/16/26 07:00, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> Hi all,
> 
> This series addresses part of the error handling in the MT8189 AFE driver.
> 
> It propagates errors from clock operations and runtime resume, validates
> clock parameters, and removes redundant error messages.
> 
> In v2, there was discussion about checking the return value of
> regmap_update_bits(). While opinions differed, the existing driver already
> checks it in mt8189_afe_enable_top_cg(), which is used by
> mt8189_apll1_enable() and mt8189_apll2_enable() touched by this series.
> 
> Therefore, I keep these checks and add the corresponding error paths for
> consistency.
> 
> Compile-tested only.

Series is

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Cheers,
Angelo

> 
> Link v1 :
> https://lore.kernel.org/all/20260910125742.150902-1-phucduc.bui@gmail.com/
> Link v2:
> https://lore.kernel.org/all/20260914072842.24420-1-phucduc.bui@gmail.com/
> 
> Changes in v2:
>   - Update the names of the goto labels.
>   - Check for zero frequency since freq is unsigned.
> Changes in v3:
>   - Add Angelo's Reviewed-by tag.
>   - Restore the existing afe->regmap checks,
>     making the separate patch for missing regmap unnecessary.
>   - Do not pre-initialize ret; set ret = 0 in the default case throughout
>     the series.
> 
> Best regards,
> Phuc
> 
> bui duc phuc (12):
>    ASoC: mediatek: mt8189: Propagate APLL enable errors
>    ASoC: mediatek: mt8189: Propagate MCK enable errors
>    ASoC: mediatek: mt8189: Validate MCK ID
>    ASoC: mediatek: mt8189: Propagate reg_rw clock errors
>    ASoC: mediatek: mt8189: Use dev_err_probe() for clock errors
>    ASoC: mediatek: mt8189: Propagate runtime resume errors
>    ASoC: mediatek: mt8189: Remove redundant error message
>    ASoC: mediatek: mt8189: Propagate APLL errors
>    ASoC: mediatek: mt8189: Propagate MCLK errors
>    ASoC: mediatek: mt8189: Validate sysclk frequency
>    ASoC: mediatek: mt8189: Propagate TDM clock errors
>    ASoC: mediatek: mt8189: Validate TDM MCLK frequency
> 
>   sound/soc/mediatek/mt8189/mt8189-afe-clk.c | 134 +++++++++++++++------
>   sound/soc/mediatek/mt8189/mt8189-afe-pcm.c |  45 ++++---
>   sound/soc/mediatek/mt8189/mt8189-dai-i2s.c |  18 ++-
>   sound/soc/mediatek/mt8189/mt8189-dai-tdm.c |  19 ++-
>   4 files changed, 154 insertions(+), 62 deletions(-)
>
Re: [PATCH v3 00/12] ASoC: mediatek: mt8189: Improve error handling
Posted by Mark Brown 1 week ago
On Wed, 16 Sep 2026 12:00:07 +0700, phucduc.bui@gmail.com wrote:
> ASoC: mediatek: mt8189: Improve error handling
> 
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> Hi all,
> 
> This series addresses part of the error handling in the MT8189 AFE driver.
> 
> [...]

Applied to

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

Thanks!

[01/12] ASoC: mediatek: mt8189: Propagate APLL enable errors
        https://git.kernel.org/broonie/sound/c/5a3c23d4aa89
[02/12] ASoC: mediatek: mt8189: Propagate MCK enable errors
        https://git.kernel.org/broonie/sound/c/bd9a8d9def20
[03/12] ASoC: mediatek: mt8189: Validate MCK ID
        https://git.kernel.org/broonie/sound/c/b6b47040e897
[04/12] ASoC: mediatek: mt8189: Propagate reg_rw clock errors
        https://git.kernel.org/broonie/sound/c/29de66668799
[05/12] ASoC: mediatek: mt8189: Use dev_err_probe() for clock errors
        https://git.kernel.org/broonie/sound/c/ea8c96a05da7
[06/12] ASoC: mediatek: mt8189: Propagate runtime resume errors
        https://git.kernel.org/broonie/sound/c/483e827b005f
[07/12] ASoC: mediatek: mt8189: Remove redundant error message
        https://git.kernel.org/broonie/sound/c/e9e9e514eeef
[08/12] ASoC: mediatek: mt8189: Propagate APLL errors
        https://git.kernel.org/broonie/sound/c/6347f276da8c
[09/12] ASoC: mediatek: mt8189: Propagate MCLK errors
        https://git.kernel.org/broonie/sound/c/65b9d4a783cc
[10/12] ASoC: mediatek: mt8189: Validate sysclk frequency
        https://git.kernel.org/broonie/sound/c/9c73b5a43c99
[11/12] ASoC: mediatek: mt8189: Propagate TDM clock errors
        https://git.kernel.org/broonie/sound/c/242d0280eabb
[12/12] ASoC: mediatek: mt8189: Validate TDM MCLK frequency
        https://git.kernel.org/broonie/sound/c/197ec30e1b60

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