diff options
author | Imre Deak <imre.deak@intel.com> | 2014-12-15 11:59:28 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-12-15 12:14:04 -0500 |
commit | dbea3cea69508e9d548ed4a6be13de35492e5d15 (patch) | |
tree | 8674ef15b99649e468ccdeb0882364d0ee71ffd4 | |
parent | 78e68d36dab31c1f41885f757195fdfb29fc3075 (diff) |
drm/i915: sanitize RPS resetting during GPU reset
Atm, we don't disable RPS interrupts and related work items before
resetting the GPU. This may interfere with the following GPU
initialization and cause RPS interrupts to show up in PM_IIR too early
before calling gen6_enable_rps_interrupts() (triggering a WARN there).
Solve this by disabling RPS interrupts and flushing any related work
items before resetting the GPU.
v2:
- split out the common parts of the gt suspend and the new gt reset
functions (Paulo)
v3:
- remove the check for UMS, it's a NOP nowadays (Daniel)
Reported-by: He, Shuang <shuang.he@intel.com>
Testcase: igt/gem_reset_stats/ban-render
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86644
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 28 |
2 files changed, 22 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index f990ab4c3efb..fc8cfddbf232 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -811,6 +811,8 @@ int i915_reset(struct drm_device *dev) | |||
811 | if (!i915.reset) | 811 | if (!i915.reset) |
812 | return 0; | 812 | return 0; |
813 | 813 | ||
814 | intel_reset_gt_powersave(dev); | ||
815 | |||
814 | mutex_lock(&dev->struct_mutex); | 816 | mutex_lock(&dev->struct_mutex); |
815 | 817 | ||
816 | i915_gem_reset(dev); | 818 | i915_gem_reset(dev); |
@@ -880,7 +882,7 @@ int i915_reset(struct drm_device *dev) | |||
880 | * of re-init after reset. | 882 | * of re-init after reset. |
881 | */ | 883 | */ |
882 | if (INTEL_INFO(dev)->gen > 5) | 884 | if (INTEL_INFO(dev)->gen > 5) |
883 | intel_reset_gt_powersave(dev); | 885 | intel_enable_gt_powersave(dev); |
884 | } else { | 886 | } else { |
885 | mutex_unlock(&dev->struct_mutex); | 887 | mutex_unlock(&dev->struct_mutex); |
886 | } | 888 | } |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 1f4b56e273c8..964b28e3c630 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -6191,6 +6191,20 @@ void intel_cleanup_gt_powersave(struct drm_device *dev) | |||
6191 | valleyview_cleanup_gt_powersave(dev); | 6191 | valleyview_cleanup_gt_powersave(dev); |
6192 | } | 6192 | } |
6193 | 6193 | ||
6194 | static void gen6_suspend_rps(struct drm_device *dev) | ||
6195 | { | ||
6196 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
6197 | |||
6198 | flush_delayed_work(&dev_priv->rps.delayed_resume_work); | ||
6199 | |||
6200 | /* | ||
6201 | * TODO: disable RPS interrupts on GEN9+ too once RPS support | ||
6202 | * is added for it. | ||
6203 | */ | ||
6204 | if (INTEL_INFO(dev)->gen < 9) | ||
6205 | gen6_disable_rps_interrupts(dev); | ||
6206 | } | ||
6207 | |||
6194 | /** | 6208 | /** |
6195 | * intel_suspend_gt_powersave - suspend PM work and helper threads | 6209 | * intel_suspend_gt_powersave - suspend PM work and helper threads |
6196 | * @dev: drm device | 6210 | * @dev: drm device |
@@ -6206,14 +6220,7 @@ void intel_suspend_gt_powersave(struct drm_device *dev) | |||
6206 | if (INTEL_INFO(dev)->gen < 6) | 6220 | if (INTEL_INFO(dev)->gen < 6) |
6207 | return; | 6221 | return; |
6208 | 6222 | ||
6209 | flush_delayed_work(&dev_priv->rps.delayed_resume_work); | 6223 | gen6_suspend_rps(dev); |
6210 | |||
6211 | /* | ||
6212 | * TODO: disable RPS interrupts on GEN9+ too once RPS support | ||
6213 | * is added for it. | ||
6214 | */ | ||
6215 | if (INTEL_INFO(dev)->gen < 9) | ||
6216 | gen6_disable_rps_interrupts(dev); | ||
6217 | 6224 | ||
6218 | /* Force GPU to min freq during suspend */ | 6225 | /* Force GPU to min freq during suspend */ |
6219 | gen6_rps_idle(dev_priv); | 6226 | gen6_rps_idle(dev_priv); |
@@ -6316,8 +6323,11 @@ void intel_reset_gt_powersave(struct drm_device *dev) | |||
6316 | { | 6323 | { |
6317 | struct drm_i915_private *dev_priv = dev->dev_private; | 6324 | struct drm_i915_private *dev_priv = dev->dev_private; |
6318 | 6325 | ||
6326 | if (INTEL_INFO(dev)->gen < 6) | ||
6327 | return; | ||
6328 | |||
6329 | gen6_suspend_rps(dev); | ||
6319 | dev_priv->rps.enabled = false; | 6330 | dev_priv->rps.enabled = false; |
6320 | intel_enable_gt_powersave(dev); | ||
6321 | } | 6331 | } |
6322 | 6332 | ||
6323 | static void ibx_init_clock_gating(struct drm_device *dev) | 6333 | static void ibx_init_clock_gating(struct drm_device *dev) |