Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/pm: Move xe_rpm_lockmap_acquire
@ 2024-09-11  9:30 Suraj Kandpal
  2024-09-11 10:41 ` Matthew Auld
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Suraj Kandpal @ 2024-09-11  9:30 UTC (permalink / raw)
  To: intel-xe; +Cc: uma.shankar, Suraj Kandpal

Move xe_rpm_lockmap_acquire after display_pm_suspend and resume
funtions to avoid cirular locking dependency because of locks
being taken in intel_fbdev, intel_dp_mst_mgr suspend and resume
functions.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/xe/xe_pm.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index a3d1509066f7..7f33e553728a 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -363,6 +363,18 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
 	/* Disable access_ongoing asserts and prevent recursive pm calls */
 	xe_pm_write_callback_task(xe, current);
 
+	/*
+	 * Applying lock for entire list op as xe_ttm_bo_destroy and xe_bo_move_notify
+	 * also checks and delets bo entry from user fault list.
+	 */
+	mutex_lock(&xe->mem_access.vram_userfault.lock);
+	list_for_each_entry_safe(bo, on,
+				 &xe->mem_access.vram_userfault.list, vram_userfault_link)
+		xe_bo_runtime_pm_release_mmap_offset(bo);
+	mutex_unlock(&xe->mem_access.vram_userfault.lock);
+
+	xe_display_pm_runtime_suspend(xe);
+
 	/*
 	 * The actual xe_pm_runtime_put() is always async underneath, so
 	 * exactly where that is called should makes no difference to us. However
@@ -386,18 +398,6 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
 	 */
 	xe_rpm_lockmap_acquire(xe);
 
-	/*
-	 * Applying lock for entire list op as xe_ttm_bo_destroy and xe_bo_move_notify
-	 * also checks and delets bo entry from user fault list.
-	 */
-	mutex_lock(&xe->mem_access.vram_userfault.lock);
-	list_for_each_entry_safe(bo, on,
-				 &xe->mem_access.vram_userfault.list, vram_userfault_link)
-		xe_bo_runtime_pm_release_mmap_offset(bo);
-	mutex_unlock(&xe->mem_access.vram_userfault.lock);
-
-	xe_display_pm_runtime_suspend(xe);
-
 	if (xe->d3cold.allowed) {
 		err = xe_bo_evict_all(xe);
 		if (err)
@@ -438,8 +438,6 @@ int xe_pm_runtime_resume(struct xe_device *xe)
 	/* Disable access_ongoing asserts and prevent recursive pm calls */
 	xe_pm_write_callback_task(xe, current);
 
-	xe_rpm_lockmap_acquire(xe);
-
 	if (xe->d3cold.allowed) {
 		err = xe_pcode_ready(xe, true);
 		if (err)
@@ -463,6 +461,8 @@ int xe_pm_runtime_resume(struct xe_device *xe)
 
 	xe_display_pm_runtime_resume(xe);
 
+	xe_rpm_lockmap_acquire(xe);
+
 	if (xe->d3cold.allowed) {
 		err = xe_bo_restore_user(xe);
 		if (err)
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-09-11 13:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11  9:30 [PATCH] drm/xe/pm: Move xe_rpm_lockmap_acquire Suraj Kandpal
2024-09-11 10:41 ` Matthew Auld
2024-09-11 10:58   ` Kandpal, Suraj
2024-09-11 11:05 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-11 11:05 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-11 11:06 ` ✓ CI.KUnit: success " Patchwork
2024-09-11 11:18 ` ✓ CI.Build: " Patchwork
2024-09-11 11:21 ` ✓ CI.Hooks: " Patchwork
2024-09-11 11:22 ` ✓ CI.checksparse: " Patchwork
2024-09-11 11:34 ` [PATCH] " Imre Deak
2024-09-11 12:01   ` Kandpal, Suraj
2024-09-11 12:05     ` Imre Deak
2024-09-11 12:20       ` Kandpal, Suraj
2024-09-11 11:39 ` ✗ CI.BAT: failure for " Patchwork
2024-09-11 13:12 ` ✗ CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox