drm/xe: Move drm_client_dev_suspend/resume outside pm block signalling
Subsystems (3)
PATCH 1/1 drm/xe: Move drm_client_dev_suspend/resume outside pm block signalling
A circular locking dependency is reported between xe_pm_block_map and dev->clientlist_mutex:
&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map --> &dev->clientlist_mutex
The dependency chain is:
1. xe_pm_suspend() calls xe_pm_block_begin_signalling(), then xe_display_pm_suspend() which calls drm_client_dev_suspend() acquiring clientlist_mutex. (xe_pm_block_map -> clientlist_mutex)
2. drm_client_dev_unregister() -> drm_file_free() -> xe_file_close() -> prelim_xe_eudebug_file_close() acquires discovery_lock. (clientlist_mutex -> discovery_lock)
3. xe_vm_close_and_put() acquires vm->lock under discovery_lock. (discovery_lock -> vm->lock)
4. xe_exec_ioctl() holds vm->lock and calls xe_pm_block_on_suspend() which waits on xe_pm_block_map. (vm->lock -> xe_pm_block_map)
Fix this by moving drm_client_dev_suspend() before xe_pm_block_begin_signalling() in xe_pm_suspend(), and drm_client_dev_resume() after xe_pm_block_end_signalling() in xe_pm_resume(). This breaks the xe_pm_block_map -> clientlist_mutex edge in the dependency chain.
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/display/xe_display.c +0 -3
@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device *xe)* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);
@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device *xe)intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }
drivers/gpu/drm/xe/xe_pm.c +5 -0
@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h>
@@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));
@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Signature · 1 line
2.52.0
Quoted 17 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map --> &dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock.(discovery_lock -> vm->lock)
Quoted 8 lines
4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits on xe_pm_block_map. (vm->lock -> xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.
Is this not just hiding the issue from lockdep though? The pm_begin/end are not real locks, they are just there as annotations to teach lockdep about the hidden pm dependencies. For example, any locks you grab in rpm suspend()/resume() you are not allowed to hold when waking the device up, otherwise you can potentially deadlock. So here moving stuff outside the annotations probably doesn't really fix anything, it just hides it from lockdep so it doesn't complain.
The above looks like it's complaining that clientlist_mutex is held and indirectly ends up waiting on something pm related, but the pm side itself can also grab that lock? That seems like a legit complaint and should be fixed in the upper layers?
Quoted 76 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/xe/display/xe_display.c +0
-3@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device *xe)* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device *xe)intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Quoted 48 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 16:55
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 18 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map -->
&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock.(discovery_lock -> vm->lock)Quoted 8 lines
4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits on xe_pm_block_map. (vm->lock -> xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Is this not just hiding the issue from lockdep though? The pm_begin/end are not real locks, they are just there as annotations to teach lockdep about the hidden pm dependencies. For example, any locks you grab in rpm suspend()/resume() you are not allowed to hold when waking the device up, otherwise you can potentially deadlock. So here moving stuff outside the annotations probably doesn't really fix anything, it just hides it from lockdep so it doesn't complain.
Quoted 4 lines
The above looks like it's complaining that
clientlist_mutexis held and indirectly ends up waiting on something pm related, but the pm side itself can also grab that lock? That seems like a legit complaint and should be fixed in the upper layers?
Then it touches the eudebug subsystem as it most likely come from eudebug teardown, since drm_client_dev_suspend/resume doesn't functionally need to be inside the pm_block window (it just blanks/unblanks fbdev console), moving it outside is the minimal fix imo.
Tejas
Quoted 78 lines
Quoted 10 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>Review
Quoted 6 lines
--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/xe/display/xe_display.cQuoted 61 lines
index
810d93fefcbc..ec65dcbc3fdc100644drivers/gpu/drm/xe/display/xe_display.c +0
-3@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device *xe)* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device *xe)intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Quoted 48 lines · Tejas
Quoted 48 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 16:55
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 18 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map -->
&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock.(discovery_lock -> vm->lock)Quoted 8 lines
4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits on xe_pm_block_map. (vm->lock -> xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Is this not just hiding the issue from lockdep though? The pm_begin/end are not real locks, they are just there as annotations to teach lockdep about the hidden pm dependencies. For example, any locks you grab in rpm suspend()/resume() you are not allowed to hold when waking the device up, otherwise you can potentially deadlock. So here moving stuff outside the annotations probably doesn't really fix anything, it just hides it from lockdep so it doesn't complain.
Quoted 6 lines
Quoted 4 lines
The above looks like it's complaining that
clientlist_mutexis held and indirectly ends up waiting on something pm related, but the pm side itself can also grab that lock? That seems like a legit complaint and should be fixed in the upper layers?Then it touches the eudebug subsystem as it most likely come from eudebug teardown, since drm_client_dev_suspend/resume doesn't functionally need to be inside the
pm_blockwindow (it just blanks/unblanks fbdev console), moving it outside is the minimal fix imo.
If it's called in resume() or suspend() and it grabs clientlist_mutex then it is already part of the pm flow. Any locks you grab in here are part of the pm flow. The annotation here is just recording that dependency. If in the upper layers you then grab that same lock and then do something that depends on the pm flow, it has the potential to deadlock.
The above seems to be saying you have some kind of locking inversion with clientlist_mutex vs pm flow. Moving that lock outside the annotation likely just gets rids of the lockdep splat, and is not really a proper fix AFAICT.
For example, you grab lock A in resume(), but in the upper layers there is a path which can grab lock A and then end up indirectly depending on the resume() completing before continuing. That has the potential to deadlock, and the annotation here will help detect it.
Quoted 81 lines
Tejas
Quoted 78 lines
Quoted 10 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>Review
Quoted 6 lines
--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/xe/display/xe_display.cQuoted 61 lines
index
810d93fefcbc..ec65dcbc3fdc100644drivers/gpu/drm/xe/display/xe_display.c +0
-3@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device *xe)* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device *xe)intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Quoted 80 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 19:43
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 51 lines · Tejas
Quoted 51 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 16:55
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 20 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map -->
&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock.(discovery_lock -> vm->lock)Quoted 8 lines
4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits on xe_pm_block_map. (vm->lock -> xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Is this not just hiding the issue from lockdep though? The pm_begin/end are not real locks, they are just there as annotations to teach lockdep about the hidden pm dependencies. For example, any locks you grab in rpm
suspend()/resume() you are not allowed to hold when waking the device up, otherwise you can potentially deadlock. So here moving stuff outside the annotations probably doesn't really fix anything, it just hides it from lockdep so it doesn't complain.Quoted 6 lines
Quoted 4 lines
The above looks like it's complaining that
clientlist_mutexis held and indirectly ends up waiting on something pm related, but the pm side itself can also grab that lock? That seems like a legit complaint and should be fixed in the upper layers?Then it touches the eudebug subsystem as it most likely come from eudebug
teardown, since drm_client_dev_suspend/resume doesn't functionally need to be inside the
pm_blockwindow (it just blanks/unblanks fbdev console), moving it outside is the minimal fix imo.If it's called in
resume()orsuspend()and it grabsclientlist_mutexthen it is already part of the pm flow. Any locks you grab in here are part of the pm flow. The annotation here is just recording that dependency. If in the upper layers you then grab that same lock and then do something that depends on the pm flow, it has the potential to deadlock.
Quoted 8 lines
The above seems to be saying you have some kind of locking inversion with
clientlist_mutexvs pm flow. Moving that lock outside the annotation likely just gets rids of the lockdep splat, and is not really a proper fix AFAICT.For example, you grab lock A in
resume(), but in the upper layers there is a path which can grab lock A and then end up indirectly depending on theresume()completing before continuing. That has the potential to deadlock, and the annotation here will help detect it.
Before (Deadlock Cycle)xe_pm_suspend()
│ ├─ xe_pm_block_begin_signalling() ←── pm_block window STARTS │ ▼ │ ┌─────────────────────────────────────────────┐ │ │ xe_display_pm_suspend() │ │ │ └─ drm_client_dev_suspend() │ │ │ └─ mutex_lock(clientlist_mutex) ❌ │ ← INSIDE pm_block window │ │ └─ suspend each client │ │ │ └─ mutex_unlock(clientlist_mutex) │ │ └─────────────────────────────────────────────┘ │ ▼ ├─ ... actual device suspend ... │ ▼ └─ xe_pm_block_end_signalling() ←── pm_block window ENDS
After: Timeline of Suspend (Fixed)xe_pm_suspend()
│
├─ xe_display_pm_suspend_early() ←── BEFORE pm_block window
│ └─ intel_display_driver_suspend_clients()
│ └─ drm_client_dev_suspend()
│ └─ mutex_lock(clientlist_mutex) ✅
│ └─ suspend each client
│ └─ mutex_unlock(clientlist_mutex)
│ clientlist_mutex RELEASED
│ ▼
├─ xe_pm_block_begin_signalling() ←── pm_block window STARTS
│ ▼
│ ┌─────────────────────────────────────────────┐
│ │ xe_display_pm_suspend() │
│ │ └─ (no more clientlist_mutex here) │
│ │ ... actual device suspend ... │
│ └─────────────────────────────────────────────┘
│ ▼
├─ xe_pm_block_end_signalling() ←── pm_block window ENDS
│ ▼
└─ xe_display_pm_resume_late() ←── AFTER pm_block window
└─ intel_display_driver_resume_clients()
└─ drm_client_dev_resume()
└─ mutex_lock(clientlist_mutex) ✅@Auld, Matthew what is the opinion on above redefined approach, does that address your concern? (Note: This is based on latest drm-tip)
Tejas
Quoted 84 lines
Quoted 18 lines
Tejas
Quoted 15 lines
Quoted 15 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 6 lines
Quoted 6 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/xe/display/xe_display.cdrivers/gpu/drm/xe/display/xe_display.c void xe_display_pm_suspend(struct xe_device
Quoted 4 lines
index
810d93fefcbc..ec65dcbc3fdc100644drivers/gpu/drm/xe/display/xe_display.c +0
-0@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device*xe)
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/xe/display/xe_display.c void xe_display_pm_resume(struct xe_device
Quoted 8 lines
drivers/gpu/drm/xe/display/xe_display.c +0
-1* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device*xe)
Quoted 50 lines
Quoted 49 lines
Quoted 49 lines
drivers/gpu/drm/xe/display/xe_display.c +0
-2intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Quoted 129 lines · Tejas
Quoted 76 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 19:43
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 49 lines · Tejas
Quoted 49 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 16:55
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 20 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map -->
&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock.(discovery_lock -> vm->lock)Quoted 8 lines
4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits on xe_pm_block_map. (vm->lock -> xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Is this not just hiding the issue from lockdep though? The pm_begin/end are not real locks, they are just there as annotations to teach lockdep about the hidden pm dependencies. For example, any locks you grab in rpm
suspend()/resume() you are not allowed to hold when waking the device up, otherwise you can potentially deadlock. So here moving stuff outside the annotations probably doesn't really fix anything, it just hides it from lockdep so it doesn't complain.Quoted 5 lines
Quoted 4 lines
The above looks like it's complaining that
clientlist_mutexis held and indirectly ends up waiting on something pm related, but the pm side itself can also grab that lock? That seems like a legit complaint and should be fixed in the upper layers?Then it touches the eudebug subsystem as it most likely come from eudebug
teardown, since drm_client_dev_suspend/resume doesn't functionally need to be inside the
pm_blockwindow (it just blanks/unblanks fbdev console), moving it outside is the minimal fix imo.If it's called in
resume()orsuspend()and it grabsclientlist_mutexthen it is already part of the pm flow. Any locks you grab in here are part of the pm flow. The annotation here is just recording that dependency. If in the upper layers you then grab that same lock and then do something that depends on the pm flow, it has the potential to deadlock.Quoted 8 lines
The above seems to be saying you have some kind of locking inversion with
clientlist_mutexvs pm flow. Moving that lock outside the annotation likely just gets rids of the lockdep splat, and is not really a proper fix AFAICT.For example, you grab lock A in
resume(), but in the upper layers there is a path which can grab lock A and then end up indirectly depending on theresume()completing before continuing. That has the potential to deadlock, and the annotation here will help detect it.Before (Deadlock Cycle)
xe_pm_suspend()│ ├─ xe_pm_block_begin_signalling() ←── pm_block window STARTS │ ▼ │ ┌─────────────────────────────────────────────┐ │ │ xe_display_pm_suspend() │ │ │ └─ drm_client_dev_suspend() │ │ │ └─ mutex_lock(clientlist_mutex) ❌ │ ← INSIDE pm_block window │ │ └─ suspend each client │ │ │ └─ mutex_unlock(clientlist_mutex) │ │ └─────────────────────────────────────────────┘ │ ▼ ├─ ... actual device suspend ... │ ▼ └─ xe_pm_block_end_signalling() ←── pm_block window ENDSAfter: Timeline of Suspend (Fixed)
xe_pm_suspend()│ ├─ xe_display_pm_suspend_early() ←── BEFORE pm_block window │ └─ intel_display_driver_suspend_clients() │ └─ drm_client_dev_suspend() │ └─ mutex_lock(clientlist_mutex) ✅ │ └─ suspend each client │ └─ mutex_unlock(clientlist_mutex) │ clientlist_mutex RELEASED │ ▼ ├─ xe_pm_block_begin_signalling() ←── pm_block window STARTS │ ▼ │ ┌─────────────────────────────────────────────┐ │ │ xe_display_pm_suspend() │ │ │ └─ (no more clientlist_mutex here) │ │ │ ... actual device suspend ... │ │ └─────────────────────────────────────────────┘ │ ▼ ├─ xe_pm_block_end_signalling() ←── pm_block window ENDS │ ▼ └─ xe_display_pm_resume_late() ←── AFTER pm_block window └─ intel_display_driver_resume_clients() └─ drm_client_dev_resume() └─ mutex_lock(clientlist_mutex) ✅
Quoted 1 line
@Auld, Matthew what is the opinion on above redefined approach, does that address your concern? (Note: This is based on latest drm-tip)
I agree with Matthew's concern.
Moving "drm_client_dev_suspend()/resume()" outside the pm_block annotation may only hide the dependency from lockdep. It does not change the fact that "clientlist_mutex" is still acquired as part of suspend/resume flow.
For this trace, the real problematic edge is from eudebug close during unbind:
clientlist_mutex -> registration_lock -> discovery_lock
Lockdep already knows:
discovery_lock -> clientlist_mutex -> registration_lock
So both paths create the cycle.
I think the proper fix should be in the eudebug/file-close path which should avoid taking "discovery_lock" while fbdev/DRM unregister locks are already held. One option could be to drain/close eudebug before display/fbdev unregister starts, or alternatively skip eudebug file-close handling once eudebug teardown has already been marked closed.
~Arvind
Quoted 80 lines
Tejas
Quoted 78 lines
Quoted 14 lines
Tejas
Quoted 13 lines
Quoted 13 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 6 lines
Quoted 6 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/xe/display/xe_display.cdrivers/gpu/drm/xe/display/xe_display.c void xe_display_pm_suspend(struct xe_device
Quoted 4 lines
index
810d93fefcbc..ec65dcbc3fdc100644drivers/gpu/drm/xe/display/xe_display.c +0
-0@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device*xe)
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/xe/display/xe_display.c void xe_display_pm_resume(struct xe_device
Quoted 8 lines
drivers/gpu/drm/xe/display/xe_display.c +0
-1* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device*xe)
Quoted 48 lines
Quoted 48 lines
Quoted 48 lines
drivers/gpu/drm/xe/display/xe_display.c +0
-2intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Quoted 166 lines
-----Original Message-----
From: Yadav, Arvind <[email protected]>
Sent: 03 July 2026 12:14
To: Upadhyay, Tejas <[email protected]>; Auld, Matthew <[email protected]>; [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 72 lines · Tejas
Quoted 72 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 19:43
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 50 lines · Tejas
Quoted 50 lines
-----Original Message-----
From: Auld, Matthew <[email protected]>
Sent: 17 June 2026 16:55
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 21 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:&dev->clientlist_mutex --> &vm->lock --> xe_pm_block_map -->
&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock.(discovery_lock -> vm->lock)4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()Quoted 8 lines
which waits on xe_pm_block_map. (vm->lock ->
xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Is this not just hiding the issue from lockdep though? The pm_begin/end are not real locks, they are just there as annotations to teach lockdep about the hidden pm dependencies. For example, any locks you grab in rpm
suspend()/resume() you are not allowed to hold when waking the device up, otherwise you can potentially deadlock. So here moving stuff outside the annotations probably doesn't really fix anything, it just hides it from lockdep so it doesn't complain.Quoted 6 lines
Quoted 4 lines
The above looks like it's complaining that
clientlist_mutexis held and indirectly ends up waiting on something pm related, but the pm side itself can also grab that lock? That seems like a legit complaint and should be fixed in the upper layers?Then it touches the eudebug subsystem as it most likely come from eudebug
teardown, since drm_client_dev_suspend/resume doesn't functionally need to be inside the
pm_blockwindow (it just blanks/unblanks fbdev console), moving it outside is the minimal fix imo.Quoted 5 lines
Quoted 5 lines
If it's called in
resume()orsuspend()and it grabsclientlist_mutexthen it is already part of the pm flow. Any locks you grab in here are part of the pm flow. The annotation here is just recording that dependency. If in the upper layers you then grab that same lock and then do something that depends on the pm flow, it has the potential todeadlock.
Quoted 4 lines
Quoted 4 lines
The above seems to be saying you have some kind of locking inversion with
clientlist_mutexvs pm flow. Moving that lock outside the annotation likely just gets rids of the lockdep splat, and is not really a properfix AFAICT.
Quoted 8 lines
Quoted 6 lines
For example, you grab lock A in
resume(), but in the upper layers there is a path which can grab lock A and then end up indirectly depending on theresume()completing before continuing. That has the potential to deadlock, and the annotation here will help detect it.Before (Deadlock Cycle)
xe_pm_suspend()Quoted 7 lines
│ ├─ xe_pm_block_begin_signalling() ←── pm_block window STARTS │ ▼ │ ┌─────────────────────────────────────────────┐ │ │ xe_display_pm_suspend() │ │ │ └─ drm_client_dev_suspend() │ │ │ └─ mutex_lock(clientlist_mutex) ❌ │ ← INSIDE pm_blockwindow
Quoted 9 lines
│ │ └─ suspend each client │ │ │ └─ mutex_unlock(clientlist_mutex) │ │ └─────────────────────────────────────────────┘ │ ▼ ├─ ... actual device suspend ... │ ▼ └─ xe_pm_block_end_signalling() ←── pm_block window ENDSQuoted 4 lines
After: Timeline of Suspend (Fixed)
xe_pm_suspend()│ ├─ xe_display_pm_suspend_early() ←── BEFORE pm_blockwindow
Quoted 23 lines
│ └─ intel_display_driver_suspend_clients() │ └─ drm_client_dev_suspend() │ └─ mutex_lock(clientlist_mutex) ✅ │ └─ suspend each client │ └─ mutex_unlock(clientlist_mutex) │ clientlist_mutex RELEASED │ ▼ ├─ xe_pm_block_begin_signalling() ←── pm_block window STARTS │ ▼ │ ┌─────────────────────────────────────────────┐ │ │ xe_display_pm_suspend() │ │ │ └─ (no more clientlist_mutex here) │ │ │ ... actual device suspend ... │ │ └─────────────────────────────────────────────┘ │ ▼ ├─ xe_pm_block_end_signalling() ←── pm_block window ENDS │ ▼ └─ xe_display_pm_resume_late() ←── AFTER pm_block window └─ intel_display_driver_resume_clients() └─ drm_client_dev_resume() └─ mutex_lock(clientlist_mutex) ✅Quoted 2 lines
@Auld, Matthew what is the opinion on above redefined approach, does that address your concern? (Note: This is based on latest drm-tip)
I agree with Matthew's concern.
Moving "drm_client_dev_suspend()/resume()" outside thepm_blockannotation may only hide the dependency from lockdep. It does not change the fact that "clientlist_mutex" is still acquired as part of suspend/resume flow.For this trace, the real problematic edge is from eudebug close during unbind:
clientlist_mutex->registration_lock->discovery_lockLockdep already knows:
discovery_lock->clientlist_mutex->registration_lock
Quoted 7 lines
So both paths create the cycle.
I think the proper fix should be in the eudebug/file-close path which should avoid taking "discovery_lock" while fbdev/DRM unregister locks are already held. One option could be to drain/close eudebug before display/fbdev unregister starts, or alternatively skip eudebug file-close handling once eudebug teardown has already been marked closed.
Hi Arvind,
Please consider below example,
Thread A (exec ioctl):
lock(vm->lock)
xe_pm_block_on_suspend() ← ACTUALLY BLOCKS waiting for resume
... stuck until suspend/resume finishes ...
Thread B (suspend path):
xe_pm_block_begin_signalling() ← just annotation
...
drm_client_dev_suspend()
mutex_lock(clientlist_mutex) ← ACTUALLY BLOCKS (held by Thread C)
Thread C (client unregister/unbind):
mutex_lock(clientlist_mutex) ← holds this
...→ xe_file_close()
lock(discovery_lock)
...→ xe_vm_close_and_put()
lock(vm->lock) ← ACTUALLY BLOCKS (held by Thread A)Thread A: holds vm->lock → waits for suspend to finish (blocked on pm_block)
Thread B: suspend can't finish → waits for clientlist_mutex (blocked on Thread C)
Thread C: holds clientlist_mutex → waits for vm->lock (blocked on Thread A)
with that locking come outside of pm block, we end up with below :
NOW,
Thread B (suspend):
drm_client_dev_suspend()
mutex_lock(clientlist_mutex) ← acquired (or waits briefly, but NOT inside pm_block)
... suspend clients ...
mutex_unlock(clientlist_mutex) ← RELEASED ✅
↑ clientlist_mutex is FREE now
xe_pm_block_begin_signalling() ← pm_block window STARTS (no dependency on clientlist_mutex)
...
xe_display_pm_suspend() ← no clientlist_mutex needed anymore
xe_bo_evict_all()
xe_gt_suspend()
...
xe_pm_block_end_signalling() ← pm_block window ENDS ✅ (REACHES here!)
Thread A (exec ioctl):
lock(vm->lock) ← acquired
xe_pm_block_on_suspend() ← BLOCKED... but only until Thread B finishes
... Thread B DOES finish (nothing blocks it)
← UNBLOCKED! ✅ pm_block ended, continues
unlock(vm->lock) ← released ✅
Thread C (client unregister):
mutex_lock(clientlist_mutex) ← acquired
...→ xe_vm_close_and_put()
lock(vm->lock) ← BLOCKED... waiting for Thread A
... Thread A DOES finish (it got unblocked by B)
← UNBLOCKED! ✅ vm->lock is free nowAs per shown above, this deadlock can be avoided irrespective of client I feel. Let me know your view.
Tejas
Quoted 83 lines
~Arvind
Quoted 81 lines
Tejas
Quoted 79 lines
Quoted 14 lines
Tejas
Quoted 13 lines
Quoted 13 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)Quoted 6 lines
Quoted 6 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/xe/display/xe_display.cdrivers/gpu/drm/xe/display/xe_display.c void xe_display_pm_suspend(struct xe_device
Quoted 4 lines
index
810d93fefcbc..ec65dcbc3fdc100644drivers/gpu/drm/xe/display/xe_display.c +0
-0@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device*xe)
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/xe/display/xe_display.c void xe_display_pm_resume(struct xe_device
Quoted 8 lines
drivers/gpu/drm/xe/display/xe_display.c +0
-1* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device*xe)
Quoted 49 lines
Quoted 49 lines
Quoted 49 lines
drivers/gpu/drm/xe/display/xe_display.c +0
-2intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }(quoted diff) +0
-0
b/drivers/gpu/drm/xe/xe_pm.cindex99562f691080..d00c620d0926100644drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Jani Nikula
maintainerQuoted 26 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:
&dev->clientlist_mutex-->&vm->lock-->xe_pm_block_map-->&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock. (discovery_lock->vm->lock)4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits onxe_pm_block_map. (vm->lock->xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.
Quoted 3 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
What baseline are you using?
See f597d4b2fd0d ("drm/{i915, xe}: move more calls inside intel_display_driver_pm_resume()"), pushed almost two weeks ago.
The direction must be to move display related calls to display, and neither i915 nor xe core driver should be messing with anything to do with display directly.
Need to find another solution.
BR,
Jani.
Quoted 71 lines
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/xe/display/xe_display.c +0
-3@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device *xe)* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device *xe)intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +5
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }
Signature · 1 line
Jani Nikula, Intel
Quoted 46 lines
-----Original Message-----
From: Jani Nikula <[email protected]>
Sent: 17 June 2026 17:01
To: Upadhyay, Tejas <[email protected]>; intel- [email protected]
Cc: Upadhyay, Tejas <[email protected]>; Nilawar, Badal <[email protected]>; Jadav, Raag <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 27 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:
&dev->clientlist_mutex-->&vm->lock-->xe_pm_block_map-->&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock. (discovery_lock->vm->lock)4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits onxe_pm_block_map. (vm->lock->xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Quoted 3 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
What baseline are you using?
Quoted 7 lines
See
f597d4b2fd0d("drm/{i915, xe}: move more calls insideintel_display_driver_pm_resume()"), pushed almost two weeks ago.The direction must be to move display related calls to display, and neither i915 nor xe core driver should be messing with anything to do with display directly.
Need to find another solution.
Commit f597d4b2fd0d is NOT in my tree (drm-xe-next). I will need to see why its not in drm-xe-next may be next rebase is still not done. I will wait and respin, I also need to think on Matt's concern.
Tejas
Quoted 79 lines
BR,
Jani.Quoted 62 lines
Cc Jani Nikula <[email protected]>Cc Badal Nilawar <[email protected]>Cc Raag Jadav <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>--- drivers/gpu/drm/xe/display/xe_display.c | 3 --- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/xe/display/xe_display.c +0
-3@@ -304,7 +304,6 @@ void xe_display_pm_suspend(struct xe_device *xe)* properly. */ intel_display_power_disable (display); -drm_client_dev_suspend (&xe->drm);if (intel_display_device_present (display)) {drm_kms_helper_poll_disable (&xe->drm);@@ -461,8 +460,6 @@ void xe_display_pm_resume(struct xe_device *xe)intel_opregion_resume (display); -drm_client_dev_resume (&xe->drm); -intel_display_power_enable (display); }drivers/gpu/drm/xe/xe_pm.c +3
-0@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/dmi.h> +#include <drm/drm_client_event.h> #include <drm/drm_managed.h> #include <drm/ttm/ttm_placement.h> @@ -177,6 +178,7 @@ int xe_pm_suspend(struct xe_device *xe)int err;drm_dbg (&xe->drm,"Suspending device\n" ); +drm_client_dev_suspend (&xe->drm);xe_pm_block_begin_signalling ();trace_xe_pm_suspend (xe,__builtin_return_address (0 ));@@ -219,6 +221,7 @@ int xe_pm_suspend(struct xe_device *xe) err:drm_dbg (&xe->drm,"Device suspend failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }@@ -292,10 +295,12 @@ int xe_pm_resume(struct xe_device *xe)drivers/gpu/drm/xe/xe_pm.c int xe_pm_resume(struct xe_device *xe) · line 305
Quoted 10 lines
drivers/gpu/drm/xe/xe_pm.c +2
-0drm_dbg (&xe->drm,"Device resumed\n" );xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return 0 ; err:drm_dbg (&xe->drm,"Device resume failed %d\n" , err);xe_pm_block_end_signalling (); +drm_client_dev_resume (&xe->drm);return err; }--
Jani Nikula, Intel
Jani Nikula
maintainerQuoted 3 lines · Tejas
Commit
f597d4b2fd0dis NOT in my tree (drm-xe-next). I will need to see why its not in drm-xe-next may be next rebase is still not done. I will wait and respin, I also need to think on Matt's concern.
Please do yourself a favour and develop drm stuff on top of drm-tip.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel
Quoted 26 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:
&dev->clientlist_mutex-->&vm->lock-->xe_pm_block_map-->&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock. (discovery_lock->vm->lock)4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits onxe_pm_block_map. (vm->lock->xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.
Quoted 3 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Other folks already have interesting comments but just FYI:
We'd want to make sure fbdev is not left blank on suspend/resume failure so the user atleast have an opportunity to see the failure and possibly add to the bug report.
You can refer to the comment above xe_display_pm_resume().
Raag
Quoted 43 lines
-----Original Message-----
From: Jadav, Raag <[email protected]>
Sent: 17 June 2026 17:27
To: Upadhyay, Tejas <[email protected]>
Cc: [email protected]; Jani Nikula <[email protected]>; Nilawar, Badal <[email protected]>
Subject: Re: [PATCH] drm/xe: Move drm_client_dev_suspend/resume outside pm block signallingQuoted 27 lines · Tejas Upadhyay
A circular locking dependency is reported between
xe_pm_block_mapanddev->clientlist_mutex:
&dev->clientlist_mutex-->&vm->lock-->xe_pm_block_map-->&dev->clientlist_mutexThe dependency chain is:
1.xe_pm_suspend()callsxe_pm_block_begin_signalling(), thenxe_display_pm_suspend()which callsdrm_client_dev_suspend()acquiringclientlist_mutex. (xe_pm_block_map->clientlist_mutex)2.
drm_client_dev_unregister()->drm_file_free()->xe_file_close()->prelim_xe_eudebug_file_close()acquiresdiscovery_lock. (clientlist_mutex->discovery_lock)3.
xe_vm_close_and_put()acquiresvm->lockunderdiscovery_lock. (discovery_lock->vm->lock)4.
xe_exec_ioctl()holdsvm->lockand callsxe_pm_block_on_suspend()which waits onxe_pm_block_map. (vm->lock->xe_pm_block_map)Fix this by moving
drm_client_dev_suspend()beforexe_pm_block_begin_signalling()inxe_pm_suspend(), anddrm_client_dev_resume()afterxe_pm_block_end_signalling()inxe_pm_resume(). This breaks thexe_pm_block_map->clientlist_mutexedge in the dependency chain.Quoted 3 lines
The drm_client_dev_suspend/resume calls are safe to move because they only blank/unblank the fbdev console and don't depend on display power state or any operations within the block signalling scope.
Quoted 6 lines
Other folks already have interesting comments but just FYI:
We'd want to make sure fbdev is not left blank on suspend/resume failure so the user atleast have an opportunity to see the failure and possibly add to the bug report.You can refer to the comment above
xe_display_pm_resume().
Thanks for flagging this. The patch already handles this as in the suspend error paths, drm_client_dev_resume() is called at err: (which err_display falls through to), so the fbdev console is always unblanked on failure. Similarly in xe_pm_resume(), both the success and error paths call drm_client_dev_resume(), consistent with the existing pattern of calling xe_display_pm_resume() before bailing on GT resume failure. So the user always gets their screen back on any suspend/resume failure as far as I understand it.
Tejas
Quoted 2 lines
Raag