All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: set idle_bias_off=1 for all platform DAPM contexts
@ 2012-04-05 18:28 Stephen Warren
  2012-04-05 18:34 ` Stephen Warren
  2012-04-05 20:57 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Warren @ 2012-04-05 18:28 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Stephen Warren

From: Stephen Warren <swarren@nvidia.com>

The ASoC core currently defaults to using STANDBY rather than OFF for
idle ASoC platform devices, which causes a permanent pm_runtime_get() on
them. This keeps the device active unnecessarily. This can be especially
problematic when the ASoC platform device and DAI device are the same
device.

The distinction between OFF and STANDBY is likely not relevant for ASoC
platform drivers, since they aren't analog devices. So, solve this issue
by hard-coding idle_bias_off = 1 for all ASoC platform devices. If this
turns out to be a problem, this value could be sourced from the
snd_soc_platform_driver, similarly to soc_probe_codec().

Note: Prior to this change, this caused a large (10) runtime_active count
for the Tegra I2S controller even when not in use, and a leak in that
value as streams were started and stopped. This change probably hides a
bug.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/soc-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8a17048..63e6114 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1072,6 +1072,8 @@ static int soc_probe_platform(struct snd_soc_card *card,
 		snd_soc_dapm_new_dai_widgets(&platform->dapm, dai);
 	}
 
+	platform->dapm.idle_bias_off = 1;
+
 	if (driver->probe) {
 		ret = driver->probe(platform);
 		if (ret < 0) {
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: set idle_bias_off=1 for all platform DAPM contexts
  2012-04-05 18:28 [PATCH] ASoC: set idle_bias_off=1 for all platform DAPM contexts Stephen Warren
@ 2012-04-05 18:34 ` Stephen Warren
  2012-04-05 20:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2012-04-05 18:34 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel

On 04/05/2012 12:28 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> The ASoC core currently defaults to using STANDBY rather than OFF for
> idle ASoC platform devices, which causes a permanent pm_runtime_get() on
> them. This keeps the device active unnecessarily. This can be especially
> problematic when the ASoC platform device and DAI device are the same
> device.
> 
> The distinction between OFF and STANDBY is likely not relevant for ASoC
> platform drivers, since they aren't analog devices. So, solve this issue
> by hard-coding idle_bias_off = 1 for all ASoC platform devices. If this
> turns out to be a problem, this value could be sourced from the
> snd_soc_platform_driver, similarly to soc_probe_codec().

Sorry, I forgot to mention that future Tegra ASoC changes will depend on
this change at runtime for correct operation.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: set idle_bias_off=1 for all platform DAPM contexts
  2012-04-05 18:28 [PATCH] ASoC: set idle_bias_off=1 for all platform DAPM contexts Stephen Warren
  2012-04-05 18:34 ` Stephen Warren
@ 2012-04-05 20:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-04-05 20:57 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, Stephen Warren, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 486 bytes --]

On Thu, Apr 05, 2012 at 12:28:01PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> The ASoC core currently defaults to using STANDBY rather than OFF for
> idle ASoC platform devices, which causes a permanent pm_runtime_get() on
> them. This keeps the device active unnecessarily. This can be especially
> problematic when the ASoC platform device and DAI device are the same
> device.

Applied, thanks (for 3.4 as it looks like a bug fix to me).

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-05 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-05 18:28 [PATCH] ASoC: set idle_bias_off=1 for all platform DAPM contexts Stephen Warren
2012-04-05 18:34 ` Stephen Warren
2012-04-05 20:57 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.