alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Harsha Priya <harshapriya.n@intel.com>,
	Emmanuel Jillela <emmanuel.jillela@intel.com>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH v2] ALSA: HDA: Early Forbid of runtime PM
Date: Fri, 28 Aug 2020 09:33:08 +0200	[thread overview]
Message-ID: <s5h5z93ns23.wl-tiwai@suse.de> (raw)
In-Reply-To: <1598569536-9450-1-git-send-email-harshapriya.n@intel.com>

On Fri, 28 Aug 2020 01:05:36 +0200,
Harsha Priya wrote:
> 
> For certain codecs (like Realtek), pm_runtime_forbid() is invoked 
> in the probe function after build_controls(). In a stress test, 
> its observed occasionally that runtime PM calls are invoked 
> before controls are built. This causes the codec to be
> runtime suspended before probe completes. Because of this, not all
> controls are enumerated correctly, and audio does not work until
> system is rebooted.
> 
> This issue being common across all codecs, pm_runtime_forbid() is 
> called when the codec object is created to fix this issue. 
> A codec enables or disables runtime pm in its own probe function.
> 
> Multiple stress tests of 2000+ cycles has been done to test the fix.
> 
> Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
> Signed-off-by: Emmanuel Jillela <emmanuel.jillela@intel.com>
> Reviewed-by: Kailang Yang <kailang@realtek.com>

Thanks.  The only concern is about the influence on the relevant ASoC
code, especially hdac_hda.c.

Kai, could you check whether this still works?


Takashi

> ---
>  sound/pci/hda/hda_codec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index e96a87f1b611..a356c21edb90 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -1000,6 +1000,9 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
>  	if (err < 0)
>  		goto error;
>  
> +	/* PM runtime needs to be enabled later after binding codec */
> +	pm_runtime_forbid(&codec->core.dev);
> +
>  	return 0;
>  
>   error:
> -- 
> 2.17.1
> 

  reply	other threads:[~2020-08-28  7:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 23:05 [PATCH v2] ALSA: HDA: Early Forbid of runtime PM Harsha Priya
2020-08-28  7:33 ` Takashi Iwai [this message]
2020-08-28 15:03   ` Kai Vehmanen
     [not found]     ` <BN6PR1101MB2275262388388F71D62390299C520@BN6PR1101MB2275.namprd11.prod.outlook.com>
2020-08-31  9:40       ` Takashi Iwai
2020-09-18 14:56     ` Kai Vehmanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h5z93ns23.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=emmanuel.jillela@intel.com \
    --cc=harshapriya.n@intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).