Commit ed493883 authored by Imre Deak's avatar Imre Deak Committed by Daniel Vetter

drm/i915: check for GT faults in all resume handlers and driver load time

Checking for GT faults is not specific in any way to S4 thaw, so do it
also during S3 resume, S4 restore and driver load time. This allows us to
unify the Sx handlers in an upcoming patch.

v2:
- move the check to intel_uncore_early_sanitize(), so we check at driver
  load time too (Chris)
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent f4a12ead
...@@ -757,9 +757,6 @@ static int __i915_drm_thaw(struct drm_device *dev) ...@@ -757,9 +757,6 @@ static int __i915_drm_thaw(struct drm_device *dev)
static int i915_drm_thaw(struct drm_device *dev) static int i915_drm_thaw(struct drm_device *dev)
{ {
if (drm_core_check_feature(dev, DRIVER_MODESET))
i915_check_and_clear_faults(dev);
return __i915_drm_thaw(dev); return __i915_drm_thaw(dev);
} }
......
...@@ -360,7 +360,8 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore) ...@@ -360,7 +360,8 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
} }
void intel_uncore_early_sanitize(struct drm_device *dev, bool restore_forcewake) static void __intel_uncore_early_sanitize(struct drm_device *dev,
bool restore_forcewake)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -386,6 +387,12 @@ void intel_uncore_early_sanitize(struct drm_device *dev, bool restore_forcewake) ...@@ -386,6 +387,12 @@ void intel_uncore_early_sanitize(struct drm_device *dev, bool restore_forcewake)
intel_uncore_forcewake_reset(dev, restore_forcewake); intel_uncore_forcewake_reset(dev, restore_forcewake);
} }
void intel_uncore_early_sanitize(struct drm_device *dev, bool restore_forcewake)
{
__intel_uncore_early_sanitize(dev, restore_forcewake);
i915_check_and_clear_faults(dev);
}
void intel_uncore_sanitize(struct drm_device *dev) void intel_uncore_sanitize(struct drm_device *dev)
{ {
/* BIOS often leaves RC6 enabled, but disable it for hw init */ /* BIOS often leaves RC6 enabled, but disable it for hw init */
...@@ -846,7 +853,7 @@ void intel_uncore_init(struct drm_device *dev) ...@@ -846,7 +853,7 @@ void intel_uncore_init(struct drm_device *dev)
setup_timer(&dev_priv->uncore.force_wake_timer, setup_timer(&dev_priv->uncore.force_wake_timer,
gen6_force_wake_timer, (unsigned long)dev_priv); gen6_force_wake_timer, (unsigned long)dev_priv);
intel_uncore_early_sanitize(dev, false); __intel_uncore_early_sanitize(dev, false);
if (IS_VALLEYVIEW(dev)) { if (IS_VALLEYVIEW(dev)) {
dev_priv->uncore.funcs.force_wake_get = __vlv_force_wake_get; dev_priv->uncore.funcs.force_wake_get = __vlv_force_wake_get;
...@@ -928,6 +935,8 @@ void intel_uncore_init(struct drm_device *dev) ...@@ -928,6 +935,8 @@ void intel_uncore_init(struct drm_device *dev)
ASSIGN_READ_MMIO_VFUNCS(gen4); ASSIGN_READ_MMIO_VFUNCS(gen4);
break; break;
} }
i915_check_and_clear_faults(dev);
} }
#undef ASSIGN_WRITE_MMIO_VFUNCS #undef ASSIGN_WRITE_MMIO_VFUNCS
#undef ASSIGN_READ_MMIO_VFUNCS #undef ASSIGN_READ_MMIO_VFUNCS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment