[PATCH 1/4] ALSA: hda: Refactor codec PM to use direct-complete optimization

Takashi Iwai tiwai at suse.de
Fri Oct 23 13:32:04 CEST 2020


On Fri, 23 Oct 2020 12:23:35 +0200,
Kai-Heng Feng wrote:
> 
> +static void hda_codec_pm_complete(struct device *dev)
>  {
>  	struct hda_codec *codec = dev_to_hda_codec(dev);
> -	int ret;
>  
> -	ret = pm_runtime_force_resume(dev);
> -	/* schedule jackpoll work for jack detection update */
> -	if (codec->jackpoll_interval ||
> -	    (pm_runtime_suspended(dev) && hda_codec_need_resume(codec)))
> -		schedule_delayed_work(&codec->jackpoll_work,
> -				      codec->jackpoll_interval);
> -	return ret;
> +	if (pm_runtime_suspended(dev) &&
> +	    (hda_codec_need_resume(codec) || codec->forced_resume))
> +		pm_request_resume(dev);

You shouldn't drop the check of codec->jackpoll_interval.  If this
field is set, the codec driver has to resume no matter what it was, so
that the polling can start up again.


thanks,

Takashi


More information about the Alsa-devel mailing list