All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Cancel hangcheck before GPU is suspended
@ 2015-12-09 13:56 Joonas Lahtinen
  2015-12-09 14:10 ` Imre Deak
  0 siblings, 1 reply; 4+ messages in thread
From: Joonas Lahtinen @ 2015-12-09 13:56 UTC (permalink / raw
  To: Intel graphics driver community testing & development

In order to avoid accessing GPU registers while GPU is suspended cancel
the hangcheck work before calling intel_suspend_complete which actually
puts the GPU to suspend. Otherwise hangcheck might do MMIO reads to a
suspended GPU.

Placement before intel_guc_suspend is imitated from i915_drm_suspend
which cancels the work at i915_gem_suspend, to keep the functions
similar.

On VLV systems, namely BYT, this was causing an error during runtime
suspend cycle:

[drm:vlv_check_no_gt_access [i915]] *ERROR* GT register access while GT waking disabled

Testcase: igt/pm_rpm/basic-rte
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93121

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e6935f1..81862d5 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1462,6 +1462,8 @@ static int intel_runtime_suspend(struct device *device)
 	i915_gem_release_all_mmaps(dev_priv);
 	mutex_unlock(&dev->struct_mutex);
 
+	cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
+
 	intel_guc_suspend(dev);
 
 	intel_suspend_gt_powersave(dev);
@@ -1475,7 +1477,6 @@ static int intel_runtime_suspend(struct device *device)
 		return ret;
 	}
 
-	cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
 	intel_uncore_forcewake_reset(dev, false);
 	dev_priv->pm.suspended = true;
 
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Cancel hangcheck before GPU is suspended
  2015-12-09 13:56 [PATCH] drm/i915: Cancel hangcheck before GPU is suspended Joonas Lahtinen
@ 2015-12-09 14:10 ` Imre Deak
  2015-12-09 16:19   ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Imre Deak @ 2015-12-09 14:10 UTC (permalink / raw
  To: Joonas Lahtinen,
	Intel graphics driver community testing & development

On ke, 2015-12-09 at 15:56 +0200, Joonas Lahtinen wrote:
> In order to avoid accessing GPU registers while GPU is suspended
> cancel
> the hangcheck work before calling intel_suspend_complete which
> actually
> puts the GPU to suspend. Otherwise hangcheck might do MMIO reads to a
> suspended GPU.
> 
> Placement before intel_guc_suspend is imitated from i915_drm_suspend
> which cancels the work at i915_gem_suspend, to keep the functions
> similar.
> 
> On VLV systems, namely BYT, this was causing an error during runtime
> suspend cycle:
> 
> [drm:vlv_check_no_gt_access [i915]] *ERROR* GT register access while
> GT waking disabled
> 
> Testcase: igt/pm_rpm/basic-rte
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93121
> 
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>

Yep, looks good to me:
Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c
> b/drivers/gpu/drm/i915/i915_drv.c
> index e6935f1..81862d5 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1462,6 +1462,8 @@ static int intel_runtime_suspend(struct device
> *device)
>  	i915_gem_release_all_mmaps(dev_priv);
>  	mutex_unlock(&dev->struct_mutex);
>  
> +	cancel_delayed_work_sync(&dev_priv-
> >gpu_error.hangcheck_work);
> +
>  	intel_guc_suspend(dev);
>  
>  	intel_suspend_gt_powersave(dev);
> @@ -1475,7 +1477,6 @@ static int intel_runtime_suspend(struct device
> *device)
>  		return ret;
>  	}
>  
> -	cancel_delayed_work_sync(&dev_priv-
> >gpu_error.hangcheck_work);
>  	intel_uncore_forcewake_reset(dev, false);
>  	dev_priv->pm.suspended = true;
>  
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Cancel hangcheck before GPU is suspended
  2015-12-09 14:10 ` Imre Deak
@ 2015-12-09 16:19   ` Chris Wilson
  2015-12-10  9:32     ` Imre Deak
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2015-12-09 16:19 UTC (permalink / raw
  To: Imre Deak; +Cc: Intel graphics driver community testing & development

On Wed, Dec 09, 2015 at 04:10:03PM +0200, Imre Deak wrote:
> On ke, 2015-12-09 at 15:56 +0200, Joonas Lahtinen wrote:
> > In order to avoid accessing GPU registers while GPU is suspended
> > cancel
> > the hangcheck work before calling intel_suspend_complete which
> > actually
> > puts the GPU to suspend. Otherwise hangcheck might do MMIO reads to a
> > suspended GPU.
> > 
> > Placement before intel_guc_suspend is imitated from i915_drm_suspend
> > which cancels the work at i915_gem_suspend, to keep the functions
> > similar.
> > 
> > On VLV systems, namely BYT, this was causing an error during runtime
> > suspend cycle:
> > 
> > [drm:vlv_check_no_gt_access [i915]] *ERROR* GT register access while
> > GT waking disabled
> > 
> > Testcase: igt/pm_rpm/basic-rte
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93121
> > 
> > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Imre Deak <imre.deak@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Yep, looks good to me:
> Reviewed-by: Imre Deak <imre.deak@intel.com>

Well Imre also shotdown the simple tryget plan, so the only thing I can
say is that I'd rather move the cancel_sync(hangcheck) out of the
intel_runtime_suspend() into the mark_idle to match it's counterpart in
mark_busy.

Patch in the post, so for now
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Cancel hangcheck before GPU is suspended
  2015-12-09 16:19   ` Chris Wilson
@ 2015-12-10  9:32     ` Imre Deak
  0 siblings, 0 replies; 4+ messages in thread
From: Imre Deak @ 2015-12-10  9:32 UTC (permalink / raw
  To: Chris Wilson; +Cc: Intel graphics driver community testing & development

On Wed, 2015-12-09 at 16:19 +0000, Chris Wilson wrote:
> On Wed, Dec 09, 2015 at 04:10:03PM +0200, Imre Deak wrote:
> > On ke, 2015-12-09 at 15:56 +0200, Joonas Lahtinen wrote:
> > > In order to avoid accessing GPU registers while GPU is suspended
> > > cancel
> > > the hangcheck work before calling intel_suspend_complete which
> > > actually
> > > puts the GPU to suspend. Otherwise hangcheck might do MMIO reads
> > > to a
> > > suspended GPU.
> > > 
> > > Placement before intel_guc_suspend is imitated from
> > > i915_drm_suspend
> > > which cancels the work at i915_gem_suspend, to keep the functions
> > > similar.
> > > 
> > > On VLV systems, namely BYT, this was causing an error during
> > > runtime
> > > suspend cycle:
> > > 
> > > [drm:vlv_check_no_gt_access [i915]] *ERROR* GT register access
> > > while
> > > GT waking disabled
> > > 
> > > Testcase: igt/pm_rpm/basic-rte
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93121
> > > 
> > > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > > Cc: Imre Deak <imre.deak@intel.com>
> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > 
> > Yep, looks good to me:
> > Reviewed-by: Imre Deak <imre.deak@intel.com>
> 
> Well Imre also shotdown the simple tryget plan, so the only thing I
> can
> say is that I'd rather move the cancel_sync(hangcheck) out of the
> intel_runtime_suspend() into the mark_idle to match it's counterpart
> in
> mark_busy.
> 
> Patch in the post, so for now
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Pushed to dinq, thanks for the patch and review.


> -Chris
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-10  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-09 13:56 [PATCH] drm/i915: Cancel hangcheck before GPU is suspended Joonas Lahtinen
2015-12-09 14:10 ` Imre Deak
2015-12-09 16:19   ` Chris Wilson
2015-12-10  9:32     ` Imre Deak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.