diff options
author | Imre Deak <imre.deak@intel.com> | 2017-03-28 05:38:55 -0400 |
---|---|---|
committer | Imre Deak <imre.deak@intel.com> | 2017-03-28 09:02:10 -0400 |
commit | f5073824efc856c9a8f56706f03ad4e07b779a36 (patch) | |
tree | 67519185b67224eddd6a8ed4424cd39d07806a55 | |
parent | 0a309f9e3dfaa4f5db0bf1b0cab54571744b491a (diff) |
drm/i915: WARN if the core runtime PM get helpers fail
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
-rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 012bc358a33a..f8a375f8dde6 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c | |||
@@ -2840,8 +2840,10 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv) | |||
2840 | { | 2840 | { |
2841 | struct pci_dev *pdev = dev_priv->drm.pdev; | 2841 | struct pci_dev *pdev = dev_priv->drm.pdev; |
2842 | struct device *kdev = &pdev->dev; | 2842 | struct device *kdev = &pdev->dev; |
2843 | int ret; | ||
2843 | 2844 | ||
2844 | pm_runtime_get_sync(kdev); | 2845 | ret = pm_runtime_get_sync(kdev); |
2846 | WARN_ONCE(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret); | ||
2845 | 2847 | ||
2846 | atomic_inc(&dev_priv->pm.wakeref_count); | 2848 | atomic_inc(&dev_priv->pm.wakeref_count); |
2847 | assert_rpm_wakelock_held(dev_priv); | 2849 | assert_rpm_wakelock_held(dev_priv); |
@@ -2871,7 +2873,8 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv) | |||
2871 | * function, since the power state is undefined. This applies | 2873 | * function, since the power state is undefined. This applies |
2872 | * atm to the late/early system suspend/resume handlers. | 2874 | * atm to the late/early system suspend/resume handlers. |
2873 | */ | 2875 | */ |
2874 | WARN_ON_ONCE(ret < 0); | 2876 | WARN_ONCE(ret < 0, |
2877 | "pm_runtime_get_if_in_use() failed: %d\n", ret); | ||
2875 | if (ret <= 0) | 2878 | if (ret <= 0) |
2876 | return false; | 2879 | return false; |
2877 | } | 2880 | } |
@@ -2955,8 +2958,11 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) | |||
2955 | * platforms without RPM support. | 2958 | * platforms without RPM support. |
2956 | */ | 2959 | */ |
2957 | if (!HAS_RUNTIME_PM(dev_priv)) { | 2960 | if (!HAS_RUNTIME_PM(dev_priv)) { |
2961 | int ret; | ||
2962 | |||
2958 | pm_runtime_dont_use_autosuspend(kdev); | 2963 | pm_runtime_dont_use_autosuspend(kdev); |
2959 | pm_runtime_get_sync(kdev); | 2964 | ret = pm_runtime_get_sync(kdev); |
2965 | WARN(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret); | ||
2960 | } else { | 2966 | } else { |
2961 | pm_runtime_use_autosuspend(kdev); | 2967 | pm_runtime_use_autosuspend(kdev); |
2962 | } | 2968 | } |