From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 01/16] drm/i915: vlv: fix gunit HW state corruption during S4 suspend Date: Tue, 21 Oct 2014 15:34:00 +0300 Message-ID: <20141021123400.GD4284@intel.com> References: <1410362229-814-1-git-send-email-imre.deak@intel.com> <1410362229-814-2-git-send-email-imre.deak@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 627B36E0B1 for ; Tue, 21 Oct 2014 05:34:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1410362229-814-2-git-send-email-imre.deak@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Imre Deak Cc: intel-gfx@lists.freedesktop.org, Sagar Kamble List-Id: intel-gfx@lists.freedesktop.org On Wed, Sep 10, 2014 at 06:16:54PM +0300, Imre Deak wrote: > During S4 freeze we don't call intel_suspend_complete(), which would > save the gunit HW state, but during S4 thaw/restore events we call > intel_resume_prepare() which restores it, thus ending up in a corrupted > HW state. > = > Fix this by calling intel_suspend_complete() from the corresponding > freeze_late event handler. > = > The issue was introduced in > commit 016970beb05da6285c2f3ed2bee1c676cb75972e > Author: Sagar Kamble > Date: Wed Aug 13 23:07:06 2014 +0530 > = > CC: Sagar Kamble > Signed-off-by: Imre Deak Yep, pairs up with .thaw_early()/.restore_early(), which should take care of all the valid combinations of pm events. Reviewed-by: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > = > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_= drv.c > index b8bd008..2365875 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -987,6 +987,15 @@ static int i915_pm_freeze(struct device *dev) > return i915_drm_freeze(drm_dev); > } > = > +static int i915_pm_freeze_late(struct device *dev) > +{ > + struct pci_dev *pdev =3D to_pci_dev(dev); > + struct drm_device *drm_dev =3D pci_get_drvdata(pdev); > + struct drm_i915_private *dev_priv =3D drm_dev->dev_private; > + > + return intel_suspend_complete(dev_priv); > +} > + > static int i915_pm_thaw_early(struct device *dev) > { > struct pci_dev *pdev =3D to_pci_dev(dev); > @@ -1571,6 +1580,7 @@ static const struct dev_pm_ops i915_pm_ops =3D { > .resume_early =3D i915_pm_resume_early, > .resume =3D i915_pm_resume, > .freeze =3D i915_pm_freeze, > + .freeze_late =3D i915_pm_freeze_late, > .thaw_early =3D i915_pm_thaw_early, > .thaw =3D i915_pm_thaw, > .poweroff =3D i915_pm_poweroff, > -- = > 1.8.4 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel OTC