diff mbox series

[v2] ALSA: hda: call runtime_allow() for all hda controllers

Message ID 20200414142725.6020-1-hui.wang@canonical.com (mailing list archive)
State New, archived
Headers show
Series [v2] ALSA: hda: call runtime_allow() for all hda controllers | expand

Commit Message

Hui Wang April 14, 2020, 2:27 p.m. UTC
Before the pci_driver->probe() is called, the pci subsystem calls
runtime_forbid() 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 because the
runtime_allow() is not called.

Since it is no harm calling runtime_allow() twice, here let hda
driver call runtime_allow() for all controllers. Then the runtime_pm
is enabled on all controllers after the put_autosuspend() is called.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/hda_intel.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Takashi Iwai April 14, 2020, 3:16 p.m. UTC | #1
On Tue, 14 Apr 2020 16:27:25 +0200,
Hui Wang wrote:
> 
> Before the pci_driver->probe() is called, the pci subsystem calls
> runtime_forbid() 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 because the
> runtime_allow() is not called.
> 
> Since it is no harm calling runtime_allow() twice, here let hda
> driver call runtime_allow() for all controllers. Then the runtime_pm
> is enabled on all controllers after the put_autosuspend() is called.
> 
> Signed-off-by: Hui Wang <hui.wang@canonical.com>

Applied now.  Thanks.


Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 8519051a426e..a5fab12defde 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2356,6 +2356,7 @@  static int azx_probe_continue(struct azx *chip)
 
 	if (azx_has_pm_runtime(chip)) {
 		pm_runtime_use_autosuspend(&pci->dev);
+		pm_runtime_allow(&pci->dev);
 		pm_runtime_put_autosuspend(&pci->dev);
 	}