[alsa-devel] [PATCH] ALSA: hda - Enable runtime pm for Haswell
Haswell doesnot support runtime pm by default. This patch let haswell Display HD-A controller enter runtime suspend, and bring more power saving whith power-well.
Signed-off-by: Wang Xingchao xingchao.wang@linux.intel.com --- sound/pci/hda/hda_intel.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bf27693..eb25888 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -3755,6 +3755,12 @@ static int azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci)) pm_runtime_put_noidle(&pci->dev); + else if (chip->driver_caps + & AZX_DCAPS_I915_POWERWELL) { + /* Haswell doesnot support runtime pm by default */ + pm_runtime_put_noidle(&pci->dev); + pm_runtime_allow(&pci->dev); + }
dev++; complete_all(&chip->probe_wait);
At Thu, 16 May 2013 16:29:05 +0800, Wang Xingchao wrote:
Haswell doesnot support runtime pm by default. This patch let haswell Display HD-A controller enter runtime suspend, and bring more power saving whith power-well.
Signed-off-by: Wang Xingchao xingchao.wang@linux.intel.com
I don't think it's good to fiddle such a thing in the driver side. If Haswell can support runtime PM really, it should be set commonly.
Takashi
sound/pci/hda/hda_intel.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bf27693..eb25888 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -3755,6 +3755,12 @@ static int azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci)) pm_runtime_put_noidle(&pci->dev);
else if (chip->driver_caps
& AZX_DCAPS_I915_POWERWELL) {
/* Haswell doesnot support runtime pm by default */
pm_runtime_put_noidle(&pci->dev);
pm_runtime_allow(&pci->dev);
}
dev++; complete_all(&chip->probe_wait);
-- 1.7.9.5
Hi Takashi,
-----Original Message----- From: Takashi Iwai [mailto:tiwai@suse.de] Sent: Thursday, May 16, 2013 4:49 PM To: Wang Xingchao Cc: Girdwood, Liam R; Lin, Mengdong; Li, Jocelyn; alsa-devel@alsa-project.org; Wang, Xingchao Subject: Re: [PATCH] ALSA: hda - Enable runtime pm for Haswell
At Thu, 16 May 2013 16:29:05 +0800, Wang Xingchao wrote:
Haswell doesnot support runtime pm by default. This patch let haswell Display HD-A controller enter runtime suspend, and bring more power saving whith power-well.
Signed-off-by: Wang Xingchao xingchao.wang@linux.intel.com
I don't think it's good to fiddle such a thing in the driver side. If Haswell can support runtime PM really, it should be set commonly.
Haswell doesnot show its power capability to support PME, I'm not sure it's caused by BIOS setting or need some additional configurations in PCI registers. So pci_dev_run_wake() return false and this make haswell lose the chance to support runtime pm in software, right?
If a PCI device would support runtime pm in software, maybe it doesnot support PME in hardware level, it should get a chance to try. I see some pci devices, they look much like:
pm_runtime_put_noidle(&pdev->dev); pm_runtime_allow(&pdev->dev);
anyway it's better if we can set haswell PME capability externally, then it fits current code. but if there's such software requirement for runtime pm, it should be improved, right?
Thanks --xingchao
Takashi
sound/pci/hda/hda_intel.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bf27693..eb25888 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -3755,6 +3755,12 @@ static int azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci)) pm_runtime_put_noidle(&pci->dev);
else if (chip->driver_caps
& AZX_DCAPS_I915_POWERWELL) {
/* Haswell doesnot support runtime pm by default */
pm_runtime_put_noidle(&pci->dev);
pm_runtime_allow(&pci->dev);
}
dev++; complete_all(&chip->probe_wait);
-- 1.7.9.5
Hi,
Add Rafael in loop.
-----Original Message----- From: Takashi Iwai [mailto:tiwai@suse.de] Sent: Thursday, May 16, 2013 4:49 PM To: Wang Xingchao Cc: Girdwood, Liam R; Lin, Mengdong; Li, Jocelyn; alsa-devel@alsa-project.org; Wang, Xingchao Subject: Re: [PATCH] ALSA: hda - Enable runtime pm for Haswell
At Thu, 16 May 2013 16:29:05 +0800, Wang Xingchao wrote:
Haswell doesnot support runtime pm by default. This patch let haswell Display HD-A controller enter runtime suspend, and bring more power saving whith power-well.
Signed-off-by: Wang Xingchao xingchao.wang@linux.intel.com
I don't think it's good to fiddle such a thing in the driver side. If Haswell can support runtime PM really, it should be set commonly.
I wonder whether it's HD-A driver's policy to only support runtime PM if the device can support signal wakup? According to Rafael, the device can support runtime PM regardless, no matter it supports PME or not. If so, we should remove the "if" condition check here.
Thanks --xingchao
Takashi
sound/pci/hda/hda_intel.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bf27693..eb25888 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -3755,6 +3755,12 @@ static int azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci)) pm_runtime_put_noidle(&pci->dev);
else if (chip->driver_caps
& AZX_DCAPS_I915_POWERWELL) {
/* Haswell doesnot support runtime pm by default */
pm_runtime_put_noidle(&pci->dev);
pm_runtime_allow(&pci->dev);
}
dev++; complete_all(&chip->probe_wait);
-- 1.7.9.5
At Wed, 22 May 2013 03:56:00 +0000, Wang, Xingchao wrote:
Hi,
Add Rafael in loop.
-----Original Message----- From: Takashi Iwai [mailto:tiwai@suse.de] Sent: Thursday, May 16, 2013 4:49 PM To: Wang Xingchao Cc: Girdwood, Liam R; Lin, Mengdong; Li, Jocelyn; alsa-devel@alsa-project.org; Wang, Xingchao Subject: Re: [PATCH] ALSA: hda - Enable runtime pm for Haswell
At Thu, 16 May 2013 16:29:05 +0800, Wang Xingchao wrote:
Haswell doesnot support runtime pm by default. This patch let haswell Display HD-A controller enter runtime suspend, and bring more power saving whith power-well.
Signed-off-by: Wang Xingchao xingchao.wang@linux.intel.com
I don't think it's good to fiddle such a thing in the driver side. If Haswell can support runtime PM really, it should be set commonly.
I wonder whether it's HD-A driver's policy to only support runtime PM if the device can support signal wakup? According to Rafael, the device can support runtime PM regardless, no matter it supports PME or not. If so, we should remove the "if" condition check here.
Well, if the decision is purely a driver issue, then we can get rid of PME check. But in that case, it should be simply like:
azx_probe() { ... if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME) pm_runtime_put_noidle(&pci->dev); ... }
azx_remove() { ... if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME) pm_runtime_get_noresume(&pci->dev); ... }
AFAIU, calling pm_runtime_allow() enables the runtime PM *forcibly*. Usually this isn't a good thing.
thanks,
Takashi
Thanks --xingchao
Takashi
sound/pci/hda/hda_intel.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bf27693..eb25888 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -3755,6 +3755,12 @@ static int azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci)) pm_runtime_put_noidle(&pci->dev);
else if (chip->driver_caps
& AZX_DCAPS_I915_POWERWELL) {
/* Haswell doesnot support runtime pm by default */
pm_runtime_put_noidle(&pci->dev);
pm_runtime_allow(&pci->dev);
}
dev++; complete_all(&chip->probe_wait);
-- 1.7.9.5
participants (3)
-
Takashi Iwai
-
Wang Xingchao
-
Wang, Xingchao