alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Sriram Periyasamy <sriramx.periyasamy@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: ALSA ML <alsa-devel@alsa-project.org>,
	Patches Audio <patches.audio@intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Sanyog Kale <sanyog.r.kale@intel.com>
Subject: Re: [PATCH] ASoC: Intel: Power down links before turning off display audio power
Date: Tue, 26 Jun 2018 16:54:01 +0530	[thread overview]
Message-ID: <20180626112401.GA3093@intel.com> (raw)
In-Reply-To: <s5h1scuzygs.wl-tiwai@suse.de>

On Mon, Jun 25, 2018 at 05:18:27PM +0200, Takashi Iwai wrote:
> On Mon, 25 Jun 2018 16:51:12 +0200,
> Sriram Periyasamy wrote:
> > 
> > On Mon, Jun 25, 2018 at 11:53:59AM +0200, Takashi Iwai wrote:
> > > On Mon, 25 Jun 2018 11:23:17 +0200,
> > > Sriram Periyasamy wrote:
> > > > 
> > > > On Mon, Jun 25, 2018 at 11:08:13AM +0200, Takashi Iwai wrote:
> > > > > On Mon, 25 Jun 2018 10:53:49 +0200,
> > > > > Sriram Periyasamy wrote:
> > > > > > 
> > > > > > On Fri, Jun 22, 2018 at 07:14:50PM +0200, Takashi Iwai wrote:
> > > > > > > On Fri, 22 Jun 2018 18:42:24 +0200,
> > > > > > > Pierre-Louis Bossart wrote:
> > > > > > > > 
> > > > > > > > On 6/22/18 4:25 AM, Sriram Periyasamy wrote:
> > > > > > > > > On certain platforms, Display HDMI HDA codec was not going to sleep state
> > > > > > > > > after the use when links are powered down after turning off the display
> > > > > > > > > power. As per the HW recommendation, links are powered down before turning
> > > > > > > > > off the display power to ensure that the codec goes to sleep state.
> > > > > > > > 
> > > > > > > > The change looks ok, I am still not clear on display power
> > > > > > > > management. snd_hdac_display_power is called both from hdac_hdmi.c and
> > > > > > > > skl.c in the respective probe/suspend/resume routines, wondering if
> > > > > > > > this is redundant or intentional.
> > > > > > > 
> > > > > > > Yeah, it looks like that skl.c keeps the display power on by assuming
> > > > > > > that it's turned off by the codec driver, but it doesn't happen
> > > > > > > actually.  I also find it fishy there...
> > > > > > > 
> > > > > > 
> > > > > > snd_hdac_display_power is called intentionally to ensure that the codec is
> > > > > > powered up before any communication is initiated from either skl.c or
> > > > > > hdac_hdmi.c.
> > > > > 
> > > > > But who turns it down if the device is not used?
> > > > 
> > > > Powering down of codec is taken care in codec's suspend routine.
> > > 
> > > But you'll power up twice, no?  Once in skl_resume() (which is no
> > > runtime resume but only for S3/S4) and once in codec resume.
> > > I wonder who will turn down when you wake up from S3.
> > 
> > No. When entering to S3, hdmi_codec_prepare() will invoke the runtime
> > resume of codec hdac_hdmi_runtime_resume() which power up the codec and
> > skl_suspend power down the codec. When it wakes up from S3, skl_resume()
> > powers up the codec and hdmi_codec_complete invokes the runtime suspend of
> > codec hdac_hdmi_runtime_suspend() which powers down the codec.
> 
> Hm, but what about the i915 power well refcount, not the codec runtime
> PM refcount?  Does the refcount reach to zero when the system goes to
> runtime suspend?  That puzzles me.
> 

Yes, i915 power well refcount goes to zero when system goes to runtime
suspend. The value of bus->i915_power_refcount in snd_hdac_display_power
is zero.

> > This design is required to achieve the runtime power reference count for
> > codec device when it is put to S3/S4 while playback was going on.
> 
> ... and this "design" picture is completely missing.
> That's why illustrating it was requested instead of a patch :)
> 
> > >  The runtime
> > > suspend doesn't call snd_hdac_display_power() in skl.c.
> > > 
> > 
> > Display power management for all runtime uses cases are handled in the
> > codec driver hdac_hdmi.c.
> 
> But it means that hdac_hdmi.c does manage the extra decrement the
> refcount that was taken in skl.c?
>

No, snd_hdac_display_power is invoked in skl.c for the following cases,

skl_probe_work - display power on, enumurate the codec and display power
                 off
skl_suspend & skl_resume - display power off/on for S3/S0 cycle 
	                   respectively

snd_hdac_display_power is invoked in hdac_hdmi.c for the following cases,

hdac_hdmi_dev_probe - display power on, probe the device and put the
		      device to runtime suspend explicitly

runtime suspend & resume - display power off and on respectively

Thanks,
Sriram.

  reply	other threads:[~2018-06-26 11:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22  9:25 [PATCH] ASoC: Intel: Power down links before turning off display audio power Sriram Periyasamy
2018-06-22 16:42 ` Pierre-Louis Bossart
2018-06-22 17:14   ` Takashi Iwai
2018-06-25  8:53     ` Sriram Periyasamy
2018-06-25  9:08       ` Takashi Iwai
2018-06-25  9:23         ` Sriram Periyasamy
2018-06-25  9:53           ` Takashi Iwai
2018-06-25 14:51             ` Sriram Periyasamy
2018-06-25 15:18               ` Takashi Iwai
2018-06-26 11:24                 ` Sriram Periyasamy [this message]
2018-06-26 11:33                   ` Takashi Iwai
2018-06-27  8:35                     ` Sriram Periyasamy
2018-06-27  8:48                       ` Takashi Iwai
2018-06-27  9:17                         ` Sriram Periyasamy
2018-06-27  9:34                           ` Takashi Iwai
2018-06-27 10:57                             ` Sriram Periyasamy
2018-06-27 11:24                               ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2018-11-09 17:37 Pierre-Louis Bossart
2018-11-09 19:37 ` Pierre-Louis Bossart

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=20180626112401.GA3093@intel.com \
    --to=sriramx.periyasamy@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=tiwai@suse.de \
    /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).