]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Fix taking invalid lock on wedge
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 3 Apr 2025 05:38:05 +0000 (22:38 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 7 Apr 2025 21:22:35 +0000 (14:22 -0700)
commit1e1981b16bb1bbe2fafa57ed439b45cb5b34e32d
tree43849cee41995d4290832c1cc10e419a65520ef8
parentf350747a9935d6c1539684c37f30e45ce9a3319f
drm/xe: Fix taking invalid lock on wedge

If device wedges on e.g. GuC upload, the submission is not yet enabled
and the state is not even initialized. Protect the wedge call so it does
nothing in this case. It fixes the following splat:

[] xe 0000:bf:00.0: [drm] device wedged, needs recovery
[] ------------[ cut here ]------------
[] DEBUG_LOCKS_WARN_ON(lock->magic != lock)
[] WARNING: CPU: 48 PID: 312 at kernel/locking/mutex.c:564 __mutex_lock+0x8a1/0xe60
...
[] RIP: 0010:__mutex_lock+0x8a1/0xe60
[]  mutex_lock_nested+0x1b/0x30
[]  xe_guc_submit_wedge+0x80/0x2b0 [xe]

Reviewed-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Link: https://lore.kernel.org/r/20250402-warn-after-wedge-v1-1-93e971511fa5@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_guc_submit.c
drivers/gpu/drm/xe/xe_guc_types.h