diff mbox series

ALSA: hda: enable the runtime_pm for non-vgaswitcheroo hda controllers

Message ID 20200414101405.6992-1-hui.wang@canonical.com
State New
Headers show
Series ALSA: hda: enable the runtime_pm for non-vgaswitcheroo hda controllers | expand

Commit Message

Hui Wang April 14, 2020, 10:14 a.m. UTC
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@canonical.com>
---
 sound/pci/hda/hda_intel.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

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);
 	}