intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>,
	linux-pm@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH v2] PM / Runtime: Introduce pm_runtime_get_noidle
Date: Thu, 10 Dec 2015 23:20:40 +0200	[thread overview]
Message-ID: <1449782440.28642.5.camel@intel.com> (raw)
In-Reply-To: <1965611.CCxSd8EYaz@vostro.rjw.lan>

On Thu, 2015-12-10 at 22:42 +0100, Rafael J. Wysocki wrote:
> On Thursday, December 10, 2015 10:36:37 PM Rafael J. Wysocki wrote:
> > On Thursday, December 10, 2015 11:43:50 AM Imre Deak wrote:
> > > On Thu, 2015-12-10 at 01:58 +0100, Rafael J. Wysocki wrote:
> > > > On Wednesday, December 09, 2015 06:22:19 PM Joonas Lahtinen
> > > > wrote:
> > > > > Introduce pm_runtime_get_noidle to for situations where it is
> > > > > not
> > > > > desireable to touch an idling device. One use scenario is
> > > > > periodic
> > > > > hangchecks performed by the drm/i915 driver which can be
> > > > > omitted
> > > > > on a device in a runtime idle state.
> > > > > 
> > > > > v2:
> > > > > - Fix inconsistent return value when !CONFIG_PM.
> > > > > - Update documentation for bool return value
> > > > > 
> > > > > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.c
> > > > > om>
> > > > > Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > > > > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > > > > Cc: linux-pm@vger.kernel.org
> > > > 
> > > > Well, I don't quite see how this can be used in a non-racy way
> > > > without doing an additional pm_runtime_resume() or something
> > > > like
> > > > that in the same code path.
> > > 
> > > We don't want to resume, that would be the whole point. We'd like
> > > to
> > > ensure that we hold a reference _and_ the device is already
> > > active. So
> > > AFAICS we'd need to check runtime_status == RPM_ACTIVE in
> > > addition
> > > after taking the reference.
> > 
> > Right, and that under the lock.
> 
> Which basically means you can call pm_runtime_resume() just fine,
> because it will do nothing if the status is RPM_ACTIVE already.
> 
> So really, why don't you use pm_runtime_get_sync()?

The difference would be that if the status is not RPM_ACTIVE already we
would drop the reference and report error. The caller would in this
case forego of doing something, since we the device is suspended or on
the way to being suspended. One example of such a scenario is a
watchdog like functionality: the watchdog work would
call pm_runtime_get_noidle() and check if the device is ok by doing
some HW access, but only if the device is powered. Otherwise the work
item would do nothing (meaning it also won't reschedule itself). The
watchdog work would get rescheduled next time the device is woken up
and some work is submitted to the device.

--Imre

  reply	other threads:[~2015-12-10 21:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 15:45 [PATCH 1/3] PM / Runtime: Introduce pm_runtime_get_noidle Joonas Lahtinen
2015-12-09 15:45 ` [PATCH 2/3] drm/i915: Take runtime pm wakelock during hangcheck Joonas Lahtinen
2015-12-09 15:45 ` [PATCH 3/3] drm/i915: Do not cancel hangcheck prior to runtime suspend Joonas Lahtinen
2015-12-09 16:22 ` [PATCH v2] PM / Runtime: Introduce pm_runtime_get_noidle Joonas Lahtinen
2015-12-10  0:58   ` Rafael J. Wysocki
2015-12-10  9:43     ` [Intel-gfx] " Imre Deak
2015-12-10 21:36       ` Rafael J. Wysocki
2015-12-10 21:42         ` Rafael J. Wysocki
2015-12-10 21:20           ` Imre Deak [this message]
2015-12-10 22:14             ` Rafael J. Wysocki
2015-12-11 11:08               ` Dave Gordon
2015-12-11 12:03               ` Ulf Hansson
2015-12-11 15:13                 ` Rafael J. Wysocki
2015-12-11 15:59                   ` Ulf Hansson
2015-12-11 23:37                     ` Rafael J. Wysocki
2015-12-11 12:54               ` Imre Deak
2015-12-11 15:40                 ` [Intel-gfx] " Rafael J. Wysocki
2015-12-11 15:47                   ` Imre Deak
2015-12-11 23:21                     ` Rafael J. Wysocki
2015-12-11 23:41                       ` Rafael J. Wysocki
2015-12-12  1:51                         ` Rafael J. Wysocki
2015-12-12 19:40                           ` Imre Deak
2015-12-12 19:49                             ` Chris Wilson
2015-12-14  2:04                               ` Rafael J. Wysocki
2015-12-14 22:22                               ` [PATCH] PM / runtime: Add new helper for conditional usage count incrementation Rafael J. Wysocki
2015-12-15 10:21                                 ` Joonas Lahtinen
2015-12-15 14:28                                 ` Ulf Hansson
2015-12-16  3:10                                   ` Rafael J. Wysocki
2015-12-15 15:06                                 ` Alan Stern
2015-12-16  3:11                                   ` Rafael J. Wysocki
2015-12-17  1:54                                 ` [PATCH v2] " Rafael J. Wysocki
2015-12-17  9:03                                   ` Ulf Hansson

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=1449782440.28642.5.camel@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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).