From: Imre Deak <imre.deak@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: fix possible RPM ref leaking during RPS disabling
Date: Tue, 13 May 2014 16:46:10 +0300 [thread overview]
Message-ID: <1399988770.5451.3.camel@intelbox> (raw)
In-Reply-To: <20140512175157.GC25056@phenom.ffwll.local>
[-- Attachment #1.1: Type: text/plain, Size: 2187 bytes --]
On Mon, 2014-05-12 at 19:51 +0200, Daniel Vetter wrote:
> On Mon, May 12, 2014 at 06:35:04PM +0300, Imre Deak wrote:
> > In
> >
> > commit c6df39b5ea6342323a42edfbeeca0a28c643d7ae
> > Author: Imre Deak <imre.deak@intel.com>
> > Date: Mon Apr 14 20:24:29 2014 +0300
> >
> > drm/i915: get a runtime PM ref for the deferred GT powersave enabling
> >
> > I added an RPM get-ref when enabling RPS from a deferred work, but forgot
> > to add the corresponding put-ref when canceling the work. This may leave
> > RPM disabled.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>
> Could we intentionally hit this by e.g. racing a suspend/resume against
> runtime pm? E.g.
> 1. disable all outputs, make sure we've entered runtime pm
> 2. set runtime autosuspend delay to 0
> 3. suspend/resume
> 4. autosuspend (hopefully, my understanding is a bit unclear)
>
> ->Boom
>
> Would look nice as an igt subtest if it works ;-)
Yep, works consistently as expected both before and after the fix. I
pushed the new subtest, please add here:
Testcase: igt/pm_pc8/system-suspend
--Imre
> -Daniel
>
> > ---
> > drivers/gpu/drm/i915/intel_pm.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 834c49c..9170039 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -4609,7 +4609,9 @@ void intel_disable_gt_powersave(struct drm_device *dev)
> > ironlake_disable_drps(dev);
> > ironlake_disable_rc6(dev);
> > } else if (IS_GEN6(dev) || IS_GEN7(dev)) {
> > - cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
> > + if (cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work))
> > + intel_runtime_pm_put(dev_priv);
> > +
> > cancel_work_sync(&dev_priv->rps.work);
> > mutex_lock(&dev_priv->rps.hw_lock);
> > if (IS_VALLEYVIEW(dev))
> > --
> > 1.8.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-05-13 13:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 15:35 [PATCH 1/2] drm/i915: fix possible RPM ref leaking during RPS disabling Imre Deak
2014-05-12 15:35 ` [PATCH 2/2] drm/i915: disable GT power saving early during system suspend Imre Deak
2014-05-12 17:51 ` [PATCH 1/2] drm/i915: fix possible RPM ref leaking during RPS disabling Daniel Vetter
2014-05-13 13:46 ` Imre Deak [this message]
2014-05-13 13:54 ` Daniel Vetter
2014-05-13 13:56 ` Imre Deak
2014-05-22 12:56 ` Robert Beckett
2014-05-22 19:46 ` Daniel Vetter
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=1399988770.5451.3.camel@intelbox \
--to=imre.deak@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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