Skip to content

drm/xe: Add missing dma-fence-signaling annotation to fix below splat

Matthew Brost requested to merge (removed):fix_lockdep_splat into xe

[ 2184.968799] ====================================================== [ 2184.974995] WARNING: possible circular locking dependency detected [ 2184.981188] 5.19.0-xe+ #3266 Tainted: G W [ 2184.986515] ------------------------------------------------------ [ 2184.992706] kworker/0:101/8921 is trying to acquire lock: [ 2184.998117] ffffffff82e09a80 (dma_fence_map)++-{0:0}, at: dma_fence_signal+0x13/0x70 [ 2185.006225] but task is already holding lock: [ 2185.012071] ffff88810efc3c28 (&ct->lock){+.+.}-{3:3}, at: xe_guc_ct_send+0x27/0x80 [xe] [ 2185.020105] which lock already depends on the new lock.

[ 2185.028298] the existing dependency chain (in reverse order) is: [ 2185.035788] -> #1 (closed) (&ct->lock){+.+.}-{3:3}: [ 2185.041380] xe_guc_ct_init+0x144/0x1f0 [xe] [ 2185.046196] xe_guc_init+0x59/0x330 [xe] [ 2185.050676] xe_uc_init+0x20/0x70 [xe] [ 2185.054971] xe_gt_init+0x2ab/0x490 [xe] [ 2185.059446] xe_device_probe+0x1d8/0x210 [xe] [ 2185.064351] xe_pci_probe+0x20a/0x3c0 [xe] [ 2185.069002] pci_device_probe+0xa2/0x150 [ 2185.073466] really_probe+0x178/0x360 [ 2185.077667] __driver_probe_device+0xfa/0x170 [ 2185.082561] driver_probe_device+0x1a/0x90 [ 2185.087198] __driver_attach+0x9b/0x180 [ 2185.091575] bus_for_each_dev+0x72/0xc0 [ 2185.095948] bus_add_driver+0x162/0x220 [ 2185.100323] driver_register+0x66/0xc0 [ 2185.104606] do_one_initcall+0x53/0x2f0 [ 2185.108980] do_init_module+0x45/0x1c0 [ 2185.113267] load_module+0x1c3a/0x1e10 [ 2185.117551] __do_sys_finit_module+0xaf/0x120 [ 2185.122447] do_syscall_64+0x37/0x90 [ 2185.126558] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 2185.132144] -> #0 (dma_fence_map)++-{0:0}: [ 2185.138078] __lock_acquire+0x15ae/0x2940 [ 2185.142626] lock_acquire+0xd3/0x310 [ 2185.146739] dma_fence_begin_signalling+0x50/0x60 [ 2185.151983] dma_fence_signal+0x13/0x70 [ 2185.156359] xe_guc_sched_done_handler+0xa2/0x2f0 [xe] [ 2185.162042] dequeue_one_g2h+0x342/0x440 [xe] [ 2185.166945] guc_ct_send_locked+0x5d2/0xa10 [xe] [ 2185.172112] xe_guc_ct_send+0x3e/0x80 [xe] [ 2185.176755] guc_engine_run_job+0x5f4/0xe20 [xe] [ 2185.181927] drm_sched_main+0x20c/0x5d0 [ 2185.186301] process_one_work+0x272/0x5c0 [ 2185.190850] worker_thread+0x37/0x370 [ 2185.195048] kthread+0xed/0x120 [ 2185.198728] ret_from_fork+0x1f/0x30 [ 2185.202844] other info that might help us debug this:

[ 2185.210857] Possible unsafe locking scenario:

[ 2185.216788] CPU0 CPU1 [ 2185.221339] ---- ---- [ 2185.225886] lock(&ct->lock); [ 2185.228961] lock(dma_fence_map); [ 2185.234892] lock(&ct->lock); [ 2185.240486] lock(dma_fence_map); [ 2185.243904] *** DEADLOCK ***

[ 2185.249840] 3 locks held by kworker/0:101/8921: [ 2185.254386] #0: ffff888100071538 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x1eb/0x5c0 [ 2185.263787] #1 (closed): ffffc900095fbe78 ((work_completion)(&sched->work_run)){+.+.}-{0:0}, at: process_one_work+0x1eb/0x5c0 [ 2185.274407] #2 (closed): ffff88810efc3c28 (&ct->lock){+.+.}-{3:3}, at: xe_guc_ct_send+0x27/0x80 [xe] [ 2185.282865] stack backtrace: [ 2185.287236] CPU: 0 PID: 8921 Comm: kworker/0:101 Tainted: G W 5.19.0-xe+ #3266 [ 2185.295776] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.3243.A01.2006102133 06/10/2020 [ 2185.309162] Workqueue: events drm_sched_main [ 2185.313463] Call Trace: [ 2185.315926] [ 2185.318051] dump_stack_lvl+0x56/0x7f [ 2185.321733] check_noncircular+0x132/0x150 [ 2185.325855] __lock_acquire+0x15ae/0x2940 [ 2185.329885] lock_acquire+0xd3/0x310 [ 2185.333479] ? dma_fence_signal+0x13/0x70 [ 2185.337505] dma_fence_begin_signalling+0x50/0x60 [ 2185.342230] ? dma_fence_signal+0x13/0x70 [ 2185.346260] dma_fence_signal+0x13/0x70 [ 2185.350112] xe_guc_sched_done_handler+0xa2/0x2f0 [xe] [ 2185.355275] dequeue_one_g2h+0x342/0x440 [xe] [ 2185.359665] guc_ct_send_locked+0x5d2/0xa10 [xe] [ 2185.364316] ? drm_plane_get_damage_clips.cold.5+0x1c/0x1c [ 2185.369819] xe_guc_ct_send+0x3e/0x80 [xe] [ 2185.373950] guc_engine_run_job+0x5f4/0xe20 [xe] [ 2185.378600] drm_sched_main+0x20c/0x5d0 [ 2185.382458] process_one_work+0x272/0x5c0 [ 2185.386484] worker_thread+0x37/0x370 [ 2185.390168] ? process_one_work+0x5c0/0x5c0 [ 2185.394366] kthread+0xed/0x120 [ 2185.397526] ? kthread_complete_and_exit+0x20/0x20 [ 2185.402332] ret_from_fork+0x1f/0x30 [ 2185.405929]

Signed-off-by: Matthew Brost matthew.brost@intel.com

Merge request reports