Commit 604effb7 authored by Imre Deak's avatar Imre Deak Committed by Daniel Vetter

drm/i915: fix suspend/resume for GENs w/o runtime PM support

Before sharing common parts between the system and runtime s/r
handlers we WARNed if the runtime s/r handlers were called on GENs that
didn't support RPM. But this WARN is not correct if the same handler is
called from the system s/r path, since that can happen on any platform.
This also broke system s/r on old platforms.

The issue was introduced in

commit 016970be
Author: Sagar Kamble <sagar.a.kamble@intel.com>
Date:   Wed Aug 13 23:07:06 2014 +0530

v2:
- remove the WARN and depend on the HAS_RUNTIME_PM check in
  rutime_suspend/resume instead (Daniel)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82751Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c2813548
......@@ -1373,7 +1373,9 @@ static int intel_runtime_suspend(struct device *device)
if (WARN_ON_ONCE(!(dev_priv->rps.enabled && intel_enable_rc6(dev))))
return -ENODEV;
WARN_ON(!HAS_RUNTIME_PM(dev));
if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev)))
return -ENODEV;
assert_force_wake_inactive(dev_priv);
DRM_DEBUG_KMS("Suspending device\n");
......@@ -1441,7 +1443,8 @@ static int intel_runtime_resume(struct device *device)
struct drm_i915_private *dev_priv = dev->dev_private;
int ret;
WARN_ON(!HAS_RUNTIME_PM(dev));
if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev)))
return -ENODEV;
DRM_DEBUG_KMS("Resuming device\n");
......@@ -1476,16 +1479,12 @@ static int intel_suspend_complete(struct drm_i915_private *dev_priv)
struct drm_device *dev = dev_priv->dev;
int ret;
if (IS_GEN6(dev)) {
ret = 0;
} else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
if (IS_HASWELL(dev) || IS_BROADWELL(dev))
ret = hsw_suspend_complete(dev_priv);
} else if (IS_VALLEYVIEW(dev)) {
else if (IS_VALLEYVIEW(dev))
ret = vlv_suspend_complete(dev_priv);
} else {
ret = -ENODEV;
WARN_ON(1);
}
else
ret = 0;
return ret;
}
......@@ -1501,16 +1500,14 @@ static int intel_resume_prepare(struct drm_i915_private *dev_priv,
struct drm_device *dev = dev_priv->dev;
int ret;
if (IS_GEN6(dev)) {
if (IS_GEN6(dev))
ret = snb_resume_prepare(dev_priv, rpm_resume);
} else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
else if (IS_HASWELL(dev) || IS_BROADWELL(dev))
ret = hsw_resume_prepare(dev_priv, rpm_resume);
} else if (IS_VALLEYVIEW(dev)) {
else if (IS_VALLEYVIEW(dev))
ret = vlv_resume_prepare(dev_priv, rpm_resume);
} else {
WARN_ON(1);
ret = -ENODEV;
}
else
ret = 0;
return ret;
}
......
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