ASoC: mediatek: mt8188: Improve error handling
Subsystems (3)
cover ASoC: mediatek: mt8188: Improve error handling
From: bui duc phuc <[email protected]>
Hi all,
This series improves error handling in several parts of the MT8188 AFE driver.
Propagate errors from clock, regmap, and runtime resume operations, remove redundant probe error messages, and fix clock cleanup on registration failure.
Compile-tested only.
Best regards,
Phuc
bui duc phuc (7):
ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate clock initialization
errors
ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable
errors
ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors
ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors
ASoC: mediatek: mt8188: mt8188-afe-pcm: Drop redundant probe error
messages
ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 115 +++++++++++++----- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 34 ++++-- sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +- 3 files changed, 113 insertions(+), 48 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/7 ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate clock initialization errors
From: bui duc phuc <[email protected]>
Use dev_err_probe() to handle clock lookup errors without printing redundant messages for deferred probe.
Propagate the original error from tuner initialization instead of returning -EINVAL.
--- sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
sound/soc/mediatek/mt8188/mt8188-afe-clk.c +4 -7
@@ -416,12 +416,9 @@ int mt8188_afe_init_clock(struct mtk_base_afe *afe)for (i =0 ; i <MT8188_CLK_NUM ; i++) { afe_priv->clk[i] =devm_clk_get (afe->dev, aud_clks[i]); -if (IS_ERR (afe_priv->clk[i])) { -dev_err (afe->dev,"%s(), devm_clk_get %s fail, ret %ld\n" , - __func__, aud_clks[i], -PTR_ERR (afe_priv->clk[i])); -return PTR_ERR (afe_priv->clk[i]); - } +if (IS_ERR (afe_priv->clk[i])) +return dev_err_probe (afe->dev,PTR_ERR (afe_priv->clk[i]), +"failed to get clock %s\n" , aud_clks[i]); }/* initial tuner */
@@ -430,7 +427,7 @@ int mt8188_afe_init_clock(struct mtk_base_afe *afe)if (ret) {dev_info (afe->dev,"%s(), init apll_tuner%d failed" , __func__, (i +1 )); -return -EINVAL ; +return ret; } }
Signature · 1 line
2.43.0
PATCH 2/7 ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors
In reply to [email protected]From: bui duc phuc <[email protected]>
Clock enable errors are currently ignored when enabling the APLL and tuner clocks.
Check the return values and roll back the APLL clock if the tuner clock fails to enable.
--- sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
sound/soc/mediatek/mt8188/mt8188-afe-clk.c +17 -4
@@ -260,15 +260,28 @@ static int mt8188_afe_enable_tuner_clk(struct mtk_base_afe *afe, unsigned int id) {struct mt8188_afe_private *afe_priv = afe->platform_priv; +int ret;switch (id) {case MT8188_AUD_PLL1 : -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL ]); -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL1_TUNER ]); + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL ]); +if (ret) +return ret; + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL1_TUNER ]); +if (ret) { +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL ]); +return ret; + }break ;case MT8188_AUD_PLL2 : -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL2 ]); -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL2_TUNER ]); + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL2 ]); +if (ret) +return ret; + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL2_TUNER ]); +if (ret) { +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_APLL2 ]); +return ret; + }break ;default :return -EINVAL ;
Signature · 1 line
2.43.0
PATCH 3/7 ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
In reply to [email protected]From: bui duc phuc <[email protected]>
The return values from regmap_update_bits() are currently ignored by the clock and AFE control functions.
Propagate the errors to allow callers to handle regmap update failures.
--- sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
sound/soc/mediatek/mt8188/mt8188-afe-clk.c +4 -10
@@ -564,9 +564,7 @@ static int mt8188_afe_enable_top_cg(struct mtk_base_afe *afe, unsigned int cg_tyunsigned int mask =get_top_cg_mask (cg_type);unsigned int val =get_top_cg_on_val (cg_type); -regmap_update_bits (afe->regmap, reg, mask, val); - -return 0 ; +return regmap_update_bits (afe->regmap, reg, mask, val); }static int mt8188_afe_disable_top_cg (struct mtk_base_afe *afe,unsigned int cg_type)
@@ -575,9 +573,7 @@ static int mt8188_afe_disable_top_cg(struct mtk_base_afe *afe, unsigned int cg_tunsigned int mask =get_top_cg_mask (cg_type);unsigned int val =get_top_cg_off_val (cg_type); -regmap_update_bits (afe->regmap, reg, mask, val); - -return 0 ; +return regmap_update_bits (afe->regmap, reg, mask, val); }int mt8188_afe_enable_reg_rw_clk (struct mtk_base_afe *afe)
@@ -617,14 +613,12 @@ int mt8188_afe_disable_reg_rw_clk(struct mtk_base_afe *afe)static int mt8188_afe_enable_afe_on (struct mtk_base_afe *afe) { -regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x1 ); -return 0 ; +return regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x1 ); }static int mt8188_afe_disable_afe_on (struct mtk_base_afe *afe) { -regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x0 ); -return 0 ; +return regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x0 ); }static int mt8188_afe_enable_a1sys (struct mtk_base_afe *afe)
Signature · 1 line
2.43.0
Re: [PATCH 3/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
Quoted 46 lines · On 9/7/2026 2:03 PM, [email protected] wrote:
From: bui duc phuc <[email protected]>
The return values from
regmap_update_bits()are currently ignored by the clock and AFE control functions.
Propagate the errors to allow callers to handle regmap update failures.Fixes f6b026479b13 ("ASoC: mediatek: mt8188: support audio clock control")Signed-off-by bui duc phuc <[email protected]>--- sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)sound/soc/mediatek/mt8188/mt8188-afe-clk.c +3
-8@@ -564,9 +564,7 @@ static int mt8188_afe_enable_top_cg(struct mtk_base_afe *afe, unsigned int cg_tyunsigned int mask =get_top_cg_mask (cg_type);unsigned int val =get_top_cg_on_val (cg_type); -regmap_update_bits (afe->regmap, reg, mask, val); - -return 0 ; +return regmap_update_bits (afe->regmap, reg, mask, val); }static int mt8188_afe_disable_top_cg (struct mtk_base_afe *afe,unsigned int cg_type)@@ -575,9 +573,7 @@ static int mt8188_afe_disable_top_cg(struct mtk_base_afe *afe, unsigned int cg_tunsigned int mask =get_top_cg_mask (cg_type);unsigned int val =get_top_cg_off_val (cg_type); -regmap_update_bits (afe->regmap, reg, mask, val); - -return 0 ; +return regmap_update_bits (afe->regmap, reg, mask, val); }int mt8188_afe_enable_reg_rw_clk (struct mtk_base_afe *afe)@@ -617,14 +613,12 @@ int mt8188_afe_disable_reg_rw_clk(struct mtk_base_afe *afe)static int mt8188_afe_enable_afe_on (struct mtk_base_afe *afe) { -regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x1 ); -return 0 ; +return regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x1 );
sound/soc/mediatek/mt8188/mt8188-afe-clk.c int mt8188_afe_disable_reg_rw_clk(struct mtk_base_afe *afe) · line 624
Quoted 10 lines
sound/soc/mediatek/mt8188/mt8188-afe-clk.c +1
-2}static int mt8188_afe_disable_afe_on (struct mtk_base_afe *afe) { -regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x0 ); -return 0 ; +return regmap_update_bits (afe->regmap,AFE_DAC_CON0 ,0x1 ,0x0 ); }static int mt8188_afe_enable_a1sys (struct mtk_base_afe *afe)
I'd expect someone from Mediatek to verify this. While I agree with the change, some drivers follow "ignore register update result" arch and, what was previously ignored will now cause basic operations to fail.
Mark Brown
maintainerRe: [PATCH 3/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
Quoted 3 lines · Cezary Rojewski
I'd expect someone from Mediatek to verify this. While I agree with the change, some drivers follow "ignore register update result" arch and, what was previously ignored will now cause basic operations to fail.
We don't really get any review from Mediatek, AngeloGioacchino used to try to cover things but it seems he got busy recently :(
AngeloGioacchino Del Regno
maintainerRe: [PATCH 3/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
Quoted 8 lines · Mark Brown
Quoted 3 lines · Cezary Rojewski
I'd expect someone from Mediatek to verify this. While I agree with the change, some drivers follow "ignore register update result" arch and, what was previously ignored will now cause basic operations to fail.
We don't really get any review from Mediatek, AngeloGioacchino used to try to cover things but it seems he got busy recently :(
Yeah, sorry about that, it's busy-busy-busy days here. Also I had a summer break, so 1+1=ouch :-)
The changes are fine, those regmap updates always succeed, that's why it works, and ignoring an error there would actually break things.
Cheers,
Angelo
PATCH 4/7 ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors
In reply to [email protected]From: bui duc phuc <[email protected]>
Clock enable errors are currently ignored by several AFE clock control functions.
Check the return values and roll back previously enabled clocks when a subsequent clock enable fails.
--- sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 69 ++++++++++++++++++---- 1 file changed, 58 insertions(+), 11 deletions(-)
sound/soc/mediatek/mt8188/mt8188-afe-clk.c +58 -11
@@ -579,22 +579,47 @@ static int mt8188_afe_disable_top_cg(struct mtk_base_afe *afe, unsigned int cg_tint mt8188_afe_enable_reg_rw_clk (struct mtk_base_afe *afe) {struct mt8188_afe_private *afe_priv = afe->platform_priv; - +int ret;/* bus clock for AFE external access, like DRAM */ -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_TOP_AUDIO_LOCAL_BUS_SEL ]); + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_TOP_AUDIO_LOCAL_BUS_SEL ]); +if (ret) + goto err_local_bus;/* bus clock for AFE internal access, like AFE SRAM */ -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_TOP_AUD_INTBUS_SEL ]); + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_TOP_AUD_INTBUS_SEL ]); +if (ret) + goto err_intbus;/* audio 26m clock source */ -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_ADSP_AUDIO_26M ]); + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_ADSP_AUDIO_26M ]); +if (ret) + goto err_26m;/* AFE hw clock */ -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_AFE ]); -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS_HP ]); -mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS ]); + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_AFE ]); +if (ret) + goto err_afe; + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS_HP ]); +if (ret) + goto err_a1sys_hp; + ret =mt8188_afe_enable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS ]); +if (ret) + goto err_a1sys;return 0 ; + +err_a1sys: +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS_HP ]); +err_a1sys_hp: +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_AFE ]); +err_afe: +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_ADSP_AUDIO_26M ]); +err_26m: +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_TOP_AUD_INTBUS_SEL ]); +err_intbus: +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_TOP_AUDIO_LOCAL_BUS_SEL ]); +err_local_bus: +return ret; }int mt8188_afe_disable_reg_rw_clk (struct mtk_base_afe *afe)
@@ -630,7 +655,13 @@ static int mt8188_afe_enable_a1sys(struct mtk_base_afe *afe)if (ret)return ret; -return mt8188_afe_enable_top_cg (afe,MT8188_TOP_CG_A1SYS_TIMING ); + ret =mt8188_afe_enable_top_cg (afe,MT8188_TOP_CG_A1SYS_TIMING ); +if (ret) { +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS ]); +return ret; + } + +return 0 ; }static int mt8188_afe_disable_a1sys (struct mtk_base_afe *afe)
@@ -651,7 +682,13 @@ static int mt8188_afe_enable_a2sys(struct mtk_base_afe *afe)if (ret)return ret; -return mt8188_afe_enable_top_cg (afe,MT8188_TOP_CG_A2SYS_TIMING ); + ret =mt8188_afe_enable_top_cg (afe,MT8188_TOP_CG_A2SYS_TIMING ); +if (ret) { +mt8188_afe_disable_clk (afe, afe_priv->clk[MT8188_CLK_AUD_A2SYS ]); +return ret; + } + +return 0 ; }static int mt8188_afe_disable_a2sys (struct mtk_base_afe *afe)
@@ -739,8 +776,18 @@ int mt8188_apll2_disable(struct mtk_base_afe *afe)int mt8188_afe_enable_main_clock (struct mtk_base_afe *afe) { -mt8188_afe_enable_top_cg (afe,MT8188_TOP_CG_26M_TIMING ); -mt8188_afe_enable_afe_on (afe); +int ret; + + ret =mt8188_afe_enable_top_cg (afe,MT8188_TOP_CG_26M_TIMING ); +if (ret) +return ret; + + ret =mt8188_afe_enable_afe_on (afe); +if (ret) { +mt8188_afe_disable_top_cg (afe,MT8188_TOP_CG_26M_TIMING ); +return ret; + } +return 0 ; }
Signature · 1 line
2.43.0
PATCH 5/7 ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors
In reply to [email protected]From: bui duc phuc <[email protected]>
Errors from clock enable and regcache synchronization are currently ignored during runtime resume.
Check the return values from mt8188_afe_enable_reg_rw_clk(), regcache_sync(), and mt8188_afe_enable_main_clock(), and abort the runtime resume if any of them fails.
On failure, disable the previously enabled reg_rw clocks and restore the regmap to cache-only mode.
--- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +16 -5
@@ -3030,22 +3030,33 @@ static int mt8188_afe_runtime_resume(struct device *dev)struct mtk_base_afe *afe =dev_get_drvdata (dev);struct mt8188_afe_private *afe_priv = afe->platform_priv;struct arm_smccc_res res; +int ret;arm_smccc_smc (MTK_SIP_AUDIO_CONTROL ,MTK_AUDIO_SMC_OP_DOMAIN_SIDEBANDS ,0 ,0 ,0 ,0 ,0 ,0 , &res); -mt8188_afe_enable_reg_rw_clk (afe); + ret =mt8188_afe_enable_reg_rw_clk (afe); +if (ret) +return ret;if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl) - goto skip_regmap; +return 0 ;regcache_cache_only (afe->regmap, false); -regcache_sync (afe->regmap); + ret =regcache_sync (afe->regmap); +if (ret) + goto err; + + ret =mt8188_afe_enable_main_clock (afe); +if (ret) + goto err; -mt8188_afe_enable_main_clock (afe); -skip_regmap:return 0 ; +err: +mt8188_afe_disable_reg_rw_clk (afe); +regcache_cache_only (afe->regmap, true); +return ret; }static int init_memif_priv_data (struct mtk_base_afe *afe)
Signature · 1 line
2.43.0
PATCH 6/7 ASoC: mediatek: mt8188: mt8188-afe-pcm: Drop redundant probe error messages
In reply to [email protected]From: bui duc phuc <[email protected]>
Several probe error paths print error messages that are already reported by the called functions.
Return the original error directly for devm_platform_ioremap_resource(), mt8188_afe_init_clock(), platform_get_irq(), and devm_request_irq() instead of wrapping the errors with dev_err_probe().
Also remove the redundant "err_platform" warning from the component registration error path.
--- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +5 -8
@@ -3232,8 +3232,7 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev) afe->base_addr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (afe->base_addr)) -return dev_err_probe (dev,PTR_ERR (afe->base_addr), -"AFE base_addr not found\n" ); +return PTR_ERR (afe->base_addr); infra_ao =syscon_regmap_lookup_by_phandle (dev->of_node,"mediatek,infracfg" );
@@ -3269,7 +3268,7 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)/* initial audio related clock */ ret =mt8188_afe_init_clock (afe);if (ret) -return dev_err_probe (dev, ret,"init clock error" ); +return ret;spin_lock_init (&afe_priv->afe_ctrl_lock);
@@ -3302,12 +3301,12 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)/* request irq */ irq_id =platform_get_irq (pdev,0 );if (irq_id <0 ) -return dev_err_probe (dev, irq_id,"no irq found" ); +return irq_id; ret =devm_request_irq (dev, irq_id, mt8188_afe_irq_handler,IRQF_TRIGGER_NONE ,"asys-isr" , (void *)afe);if (ret) -return dev_err_probe (dev, ret,"could not request_irq for asys-isr\n" ); +return ret;/* init sub_dais */ INIT_LIST_HEAD (&afe->sub_dais);
@@ -3363,10 +3362,8 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)/* register component */ ret =devm_snd_soc_register_component (dev, &mtk_afe_pcm_platform, afe->dai_drivers, afe->num_dai_drivers); -if (ret) { -dev_warn (dev,"err_platform\n" ); +if (ret) goto err_pm_put; - }mt8188_afe_init_registers (afe);
Signature · 1 line
2.43.0
PATCH 7/7 ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
In reply to [email protected]From: bui duc phuc <[email protected]>
devm_add_action_or_reset() is called after the loop that registers gate clocks. If kzalloc() fails mid-loop, the function returns -ENOMEM before that call, so cleanup is never registered and all previously registered clocks leak permanently.
Move devm_add_action_or_reset() before the loop so cleanup is always scheduled. The clock from the current (failing) iteration is not yet stored in afe_priv->lookup[i], so it still needs an explicit clk_unregister_gate() call.
--- sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
sound/soc/mediatek/mt8188/mt8188-audsys-clk.c +9 -3
@@ -170,7 +170,7 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)struct mt8188_afe_private *afe_priv = afe->platform_priv;struct clk *clk;struct clk_lookup *cl; -int i; +int i, ret; afe_priv->lookup = devm_kcalloc(afe->dev, CLK_AUD_NR_CLK, sizeof(*afe_priv->lookup),
@@ -179,6 +179,10 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)if (!afe_priv->lookup)return -ENOMEM ; + ret =devm_add_action_or_reset (afe->dev, mt8188_audsys_clk_unregister, afe); +if (ret) +return ret; +for (i =0 ; i <ARRAY_SIZE (aud_clks); i++) {const struct afe_gate *gate = &aud_clks[i];
@@ -194,8 +198,10 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)/* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */ cl =kzalloc_obj (*cl); -if (!cl) +if (!cl) { +clk_unregister_gate (clk);return -ENOMEM ; + } cl->clk = clk; cl->con_id = gate->name;
@@ -206,5 +212,5 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe) afe_priv->lookup[i] = cl; } -return devm_add_action_or_reset (afe->dev, mt8188_audsys_clk_unregister, afe); +return 0 ; }
Signature · 1 line
2.43.0
Quoted 27 lines · On 9/7/2026 2:03 PM, [email protected] wrote:
From: bui duc phuc <[email protected]>
Hi all,
This series improves error handling in several parts of the MT8188 AFE driver.
Propagate errors from clock, regmap, and runtime resume operations, remove redundant probe error messages, and fix clock cleanup on registration failure.Compile-tested only.
Best regards,
Phucbui duc phuc (7):
ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate clock initialization
errors
ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable
errors
ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors
ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors
ASoC: mediatek: mt8188: mt8188-afe-pcm: Drop redundant probe error
messages
ASoC: mediatek: mt8188: fix clk leak on error inaudsys_clk_register
Quoted 5 lines
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 115 +++++++++++++----- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 34 ++++-- sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +- 3 files changed, 113 insertions(+), 48 deletions(-)
Yet another bunch of welcomed changes though at this point I'd expect someone from Mediatek to participate and start testing the error paths. Some permissiveness might have been intentional but we won't know until someone from their dev team ACKs or NAKs.
Quoted 10 lines · On 9/7/26 14:03, [email protected] wrote:
From: bui duc phuc <[email protected]>
Hi all,
This series improves error handling in several parts of the MT8188 AFE driver.
Propagate errors from clock, regmap, and runtime resume operations, remove redundant probe error messages, and fix clock cleanup on registration failure.
Quoted 4 lines
Compile-tested only.
Best regards,
Phuc
Series is
Hi Cezary, AngeloGioacchino
Thanks to both of you for reviewing the series.
Best regards,
Phuc
Mark Brown
maintainerQuoted 6 lines · On Mon, 07 Sep 2026 19:03:03 +0700, [email protected] wrote:
ASoC: mediatek: mt8188: Improve error handling
From: bui duc phuc <[email protected]>
Hi all,
Quoted 7 lines
This series improves error handling in several parts of the MT8188 AFE driver.
Propagate errors from clock, regmap, and runtime resume operations, remove redundant probe error messages, and fix clock cleanup on registration failure.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate clock initialization errors
https://git.kernel.org/broonie/sound/c/691c4aac5ae5 [2/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors https://git.kernel.org/broonie/sound/c/a2c3ee3349a7 [3/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors https://git.kernel.org/broonie/sound/c/60a8112a088a [4/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors https://git.kernel.org/broonie/sound/c/1b65c13d1af9 [5/7] ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors https://git.kernel.org/broonie/sound/c/f5f6941d9297 [6/7] ASoC: mediatek: mt8188: mt8188-afe-pcm: Drop redundant probe error messages https://git.kernel.org/broonie/sound/c/a79f2432ee89 [7/7] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register https://git.kernel.org/broonie/sound/c/6cddf6e56d25
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