From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 1/2] drm/i915: fix possible RPM ref leaking during RPS disabling Date: Tue, 13 May 2014 16:46:10 +0300 Message-ID: <1399988770.5451.3.camel@intelbox> References: <1399908905-3025-1-git-send-email-imre.deak@intel.com> <20140512175157.GC25056@phenom.ffwll.local> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0194986926==" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D6D186E7E1 for ; Tue, 13 May 2014 06:46:12 -0700 (PDT) In-Reply-To: <20140512175157.GC25056@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0194986926== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-8cSQ58xAf+2KD5UwlKfo" --=-8cSQ58xAf+2KD5UwlKfo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 > >=20 > > commit c6df39b5ea6342323a42edfbeeca0a28c643d7ae > > Author: Imre Deak > > Date: Mon Apr 14 20:24:29 2014 +0300 > >=20 > > drm/i915: get a runtime PM ref for the deferred GT powersave enabli= ng > >=20 > > I added an RPM get-ref when enabling RPS from a deferred work, but forg= ot > > to add the corresponding put-ref when canceling the work. This may leav= e > > RPM disabled. > >=20 > > Signed-off-by: Imre Deak >=20 > 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) >=20 > ->Boom >=20 > 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 >=20 > > --- > > drivers/gpu/drm/i915/intel_pm.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > >=20 > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/int= el_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)) > > --=20 > > 1.8.4 > >=20 > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx >=20 --=-8cSQ58xAf+2KD5UwlKfo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAABAgAGBQJTciIiAAoJEORIIAnNuWDF4+8IAN44P5RTodAm0agFrYiBQfOe 5Tbw2XTtoPFbcyc0pixhHfm0DufacnAa+f1ooPS5Qz+immARWqvVoot+oPK6EU3B vv80UzLtMRekW0WEaLM7ELG34dp+2Ekowy0Bi8S7RcMTvLT9E38NeUWHw/VjVLF5 fYHVjqfH1xIeKbgwlGiOuGmf0/ygxeEdwikSWPQZvF9itqUhhbiG5HGl2Ki45jMB HAlxsGfLKgdqpTWmxQGYP8SxJBX7TK+mRk0JAaXd0YSCEHps/5MRJmDb11oz6eQo AV9INrgbkBzvbziPruY7kYsH6PyHBOds7+ofQzVKgSkqYE9oUqq3Rv5BSfbn3IE= =Vmmm -----END PGP SIGNATURE----- --=-8cSQ58xAf+2KD5UwlKfo-- --===============0194986926== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0194986926==--