[PATCH] ALSA: hda: enable the runtime_pm for non-vgaswitcheroo hda controllers

Takashi Iwai tiwai at suse.de
Tue Apr 14 12:27:49 CEST 2020


On Tue, 14 Apr 2020 12:14:05 +0200,
Hui Wang wrote:
> 
> Before the pci_driver->probe() is called, the pci subsystem calls
> runtime_forbib() and runtime_get_sync() on this pci dev, so only call
> runtime_put_autosuspend() is not enough to enable the runtime_pm on
> this device.
> 
> For controllers with vgaswitcheroo feature, the pci/quirks.c will call
> runtime_allow() for this dev, then the controllers could enter
> rt_idle/suspend/resume, but for non-vgaswitcheroo controllers like
> Intel hda controllers, the runtime_pm is not enabled even it calls
> put_autosuspend(). Need to call runtime_allow() for those controllers
> in the hda driver.
> 
> Signed-off-by: Hui Wang <hui.wang at canonical.com>

Was this behavior changed from the earlier kernels?  I thought this
was left untouched because it's supposed to be set via udev rules or
such.

OTOH, enabling the runtime PM is almost mandatory for modern systems,
and I'm fine to apply this kind of forcible enablement.


thanks,

Takashi


> ---
>  sound/pci/hda/hda_intel.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 8519051a426e..779705bef88b 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -2356,6 +2356,8 @@ static int azx_probe_continue(struct azx *chip)
>  
>  	if (azx_has_pm_runtime(chip)) {
>  		pm_runtime_use_autosuspend(&pci->dev);
> +		if (!use_vga_switcheroo(chip))
> +			pm_runtime_allow(&pci->dev);
>  		pm_runtime_put_autosuspend(&pci->dev);
>  	}
>  
> -- 
> 2.17.1
> 


More information about the Alsa-devel mailing list