]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/i915: WARN if the core runtime PM get helpers fail
authorImre Deak <imre.deak@intel.com>
Tue, 28 Mar 2017 09:38:55 +0000 (12:38 +0300)
committerImre Deak <imre.deak@intel.com>
Tue, 28 Mar 2017 13:02:10 +0000 (16:02 +0300)
We don't expect the core runtime PM get helpers to return any error, so
add a WARN for this. Also print the return value for all the callsites
to help debugging.

v2:
- Don't call pm_runtime_get_sync() as part of initing locals. (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1490693935-12638-1-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/intel_runtime_pm.c

index 012bc358a33ab179c7a3a2a1d9fd8d4afb94fb56..f8a375f8dde6680ba5b82f31895dcf1ea7c8a7af 100644 (file)
@@ -2840,8 +2840,10 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
 {
        struct pci_dev *pdev = dev_priv->drm.pdev;
        struct device *kdev = &pdev->dev;
+       int ret;
 
-       pm_runtime_get_sync(kdev);
+       ret = pm_runtime_get_sync(kdev);
+       WARN_ONCE(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);
 
        atomic_inc(&dev_priv->pm.wakeref_count);
        assert_rpm_wakelock_held(dev_priv);
@@ -2871,7 +2873,8 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv)
                 * function, since the power state is undefined. This applies
                 * atm to the late/early system suspend/resume handlers.
                 */
-               WARN_ON_ONCE(ret < 0);
+               WARN_ONCE(ret < 0,
+                         "pm_runtime_get_if_in_use() failed: %d\n", ret);
                if (ret <= 0)
                        return false;
        }
@@ -2955,8 +2958,11 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
         * platforms without RPM support.
         */
        if (!HAS_RUNTIME_PM(dev_priv)) {
+               int ret;
+
                pm_runtime_dont_use_autosuspend(kdev);
-               pm_runtime_get_sync(kdev);
+               ret = pm_runtime_get_sync(kdev);
+               WARN(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);
        } else {
                pm_runtime_use_autosuspend(kdev);
        }