[PATCH 08/11] drm/i915: Guard rpm helpers in rpm_get/put

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

 



Guard rpm helpers in rpm_get/put with is_intel_rpm_allowed
to avoid rpm helpers in intel_engine/gt_pm_get/put
called from  user_forcewake, intel_gt_resume, i915_ttm_accel_move
and intel_context_enter/exit_engine

Signed-off-by: Tilak Tangudu <tilak.tangudu@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_wakeref.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_wakeref.c b/drivers/gpu/drm/i915/intel_wakeref.c
index dfd87d082218..00a5335387a4 100644
--- a/drivers/gpu/drm/i915/intel_wakeref.c
+++ b/drivers/gpu/drm/i915/intel_wakeref.c
@@ -11,15 +11,17 @@
 
 static void rpm_get(struct intel_wakeref *wf)
 {
-	wf->wakeref = intel_runtime_pm_get(wf->rpm);
+	if (is_intel_rpm_allowed(wf->rpm))
+		wf->wakeref = intel_runtime_pm_get(wf->rpm);
 }
 
 static void rpm_put(struct intel_wakeref *wf)
 {
 	intel_wakeref_t wakeref = fetch_and_zero(&wf->wakeref);
 
-	intel_runtime_pm_put(wf->rpm, wakeref);
-	INTEL_WAKEREF_BUG_ON(!wakeref);
+	if (wakeref)
+		intel_runtime_pm_put(wf->rpm, wakeref);
+
 }
 
 int __intel_wakeref_get_first(struct intel_wakeref *wf)
-- 
2.25.1




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux