[PATCH] drm/i915: Always catch incorrect usage of intel_runtime_pm_get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>

Put an explicit might_sleep at the start of intel_runtime_pm_get so we
always catch incorrect usage, regardless of the code path taken in
pm_runtime_get_sync.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 70e659772a7a..338dbfd7d228 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -3188,6 +3188,12 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
 	struct device *kdev = &pdev->dev;
 	int ret;
 
+	/*
+	 * Catch incorrect usage regardless of the code path taken in
+	 * pm_runtime_get_sync.
+	 */
+	might_sleep();
+
 	ret = pm_runtime_get_sync(kdev);
 	WARN_ONCE(ret < 0, "pm_runtime_get_sync() failed: %d\n", ret);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux