[PATCH] ASoC: mediatek: mt6797: Fix runtime PM handling in probe

Mark Brown broonie at kernel.org
Fri Nov 20 08:22:36 PST 2026


> The MT6797 AFE probe registers its components even when the runtime
> resume fails to enable the clocks. If component registration fails
> after a successful resume, the probe disables runtime PM while still
> holding its usage reference. The runtime PM disabled path also
> returns the previous successful result without registering components.

> @@ -846,11 +851,13 @@ static int mt6797_afe_pcm_dev_probe(struct platform_device *pdev)
>  				     afe->num_dai_drivers);
>  	if (ret) {
>  		dev_warn(dev, "err_dai_component\n");
> -		goto err_pm_disable;
> +		goto err_pm_put;
>  	}
>  
>  	return 0;
>  
> +err_pm_put:
> +	pm_runtime_put_sync_suspend(dev);

There's a race with userspace fiddling with runtime PM here, it can
force runtime PM on.  Instead drop the reference with
pm_runtime_put_noidle(), disable runtime PM and then directly call the
suspend function to ensure the hardware is i the right state.

-- 
Mark Brown <broonie at kernel.org>



More information about the Linux-mediatek mailing list