Skip to contentSkip to conversation

drm/i915: Cancel hangcheck before GPU is suspended

PATCH Applied Joonas Lahtinen 3 participants 4 messages Dec 9, 2015 – Dec 10, 2015

Subsystems (2)
lore
Share & tools
lore

Joonas Lahtinen

author maintainer
#0 lore raw

PATCH 1/1 drm/i915: Cancel hangcheck before GPU is suspended

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

---
 drivers/gpu/drm/i915/i915_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.c +2 -1
index e6935f1..81862d5 100644
@@ -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;
 
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Joonas Lahtinen

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

Quoted 6 lines

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

Yep, looks good to me:

Quoted 27 lines

---
 drivers/gpu/drm/i915/i915_drv.c | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index e6935f1..81862d5 100644
@@ -1462,6 +1462,8 @@ static int intel_runtime_suspend(struct device
 *device)
  	i915_gem_release_all_mmaps(dev_priv);
  	mutex_unlock(&dev->struct_mutex);

drivers/gpu/drm/i915/i915_drv.c +1 -0
+	cancel_delayed_work_sync(&dev_priv-
Quoted 1 line

gpu_error.hangcheck_work);

+
  intel_guc_suspend(dev);

  intel_suspend_gt_powersave(dev);

drivers/gpu/drm/i915/i915_drv.c +0 -0
@@ -1475,7 +1477,6 @@ static int intel_runtime_suspend(struct device
 *device)
  		return ret;
  	}

drivers/gpu/drm/i915/i915_drv.c +0 -1
-	cancel_delayed_work_sync(&dev_priv-
Quoted 1 line

gpu_error.hangcheck_work);

Quoted 3 lines

  intel_uncore_forcewake_reset(dev, false);
  dev_priv->pm.suspended = true;

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by
#2 lore raw
Quoted 21 lines · Imre Deak
Quoted 20 lines · Joonas Lahtinen

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

Quoted 6 lines
Quoted 3 lines

Yep, looks good to me:

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

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Applied
#3 lore raw
Quoted 40 lines · Chris Wilson
Quoted 25 lines · Imre Deak
Quoted 24 lines · Joonas Lahtinen

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

Quoted 6 lines
Quoted 3 lines

Yep, looks good to me:

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.

Quoted 2 lines

Patch in the post, so for now

Pushed to dinq, thanks for the patch and review.

Quoted 2 lines

-Chris

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx