Few testcase - abort - kworker.* is trying to acquire lock at: _intel_gt_reset_lock, but task is already holding lock:\n.*at: process_one_work
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13133/bat-adlp-6/igt@kms_psr@primary_page_flip.html
<4> [222.426314]
<4> [222.426317] ======================================================
<4> [222.426318] WARNING: possible circular locking dependency detected
<4> [222.426319] 6.4.0-rc1-CI_DRM_13133-g9de28734b7c6+ #1 Not tainted
<4> [222.426321] ------------------------------------------------------
<4> [222.426321] kworker/0:1H/146 is trying to acquire lock:
<4> [222.426322] ffff888114cc4f18 (>->reset.backoff_srcu){++++}-{0:0}, at: _intel_gt_reset_lock+0x0/0x330 [i915]
<4> [222.426413]
but task is already holding lock:
<4> [222.426414] ffffc900005d3e60 ((work_completion)(&(&guc->timestamp.work)->work)){+.+.}-{0:0}, at: process_one_work+0x1cc/0x510
<4> [222.426418]
which lock already depends on the new lock.
<4> [222.426419]
the existing dependency chain (in reverse order) is:
<4> [222.426419]
-> #3 ((work_completion)(&(&guc->timestamp.work)->work)){+.+.}-{0:0}:
<4> [222.426422] lock_acquire+0xd8/0x2d0
<4> [222.426425] __flush_work+0x74/0x530
<4> [222.426426] __cancel_work_timer+0x14f/0x1f0
<4> [222.426427] intel_guc_submission_reset_prepare+0x81/0x4b0 [i915]
<4> [222.426532] intel_uc_reset_prepare+0x9c/0x120 [i915]
<4> [222.426634] reset_prepare+0x21/0x60 [i915]
<4> [222.426711] intel_gt_reset+0x1dd/0x470 [i915]
<4> [222.426785] intel_gt_reset_global+0xfb/0x170 [i915]
<4> [222.426859] intel_gt_handle_error+0x368/0x420 [i915]
<4> [222.426943] intel_gt_debugfs_reset_store+0x5c/0xc0 [i915]
<4> [222.427020] i915_wedged_set+0x29/0x40 [i915]
<4> [222.427092] simple_attr_write_xsigned.constprop.0+0xb4/0x110
<4> [222.427094] full_proxy_write+0x52/0x80
<4> [222.427096] vfs_write+0xc5/0x4f0
<4> [222.427098] ksys_write+0x64/0xe0
<4> [222.427099] do_syscall_64+0x3c/0x90
<4> [222.427102] entry_SYSCALL_64_after_hwframe+0x72/0xdc
<4> [222.427104]
-> #2 (>->reset.mutex){+.+.}-{3:3}:
<4> [222.427107] lock_acquire+0xd8/0x2d0
<4> [222.427109] i915_gem_shrinker_taints_mutex+0x31/0x50 [i915]
<4> [222.427207] intel_gt_init_reset+0x65/0x80 [i915]
<4> [222.427288] intel_gt_common_init_early+0xe1/0x170 [i915]
<4> [222.427363] intel_root_gt_init_early+0x48/0x60 [i915]
<4> [222.427436] i915_driver_probe+0x671/0xcb0 [i915]
<4> [222.427499] i915_pci_probe+0xdc/0x210 [i915]
<4> [222.427561] pci_device_probe+0x95/0x120
<4> [222.427564] really_probe+0x164/0x3c0
<4> [222.427566] __driver_probe_device+0x73/0x160
<4> [222.427568] driver_probe_device+0x19/0xa0
<4> [222.427569] __driver_attach+0xb6/0x180
<4> [222.427571] bus_for_each_dev+0x77/0xd0
<4> [222.427572] bus_add_driver+0x114/0x210
<4> [222.427574] driver_register+0x5b/0x110
<4> [222.427575] 0xffffffffa0156033
<4> [222.427581] do_one_initcall+0x57/0x270
<4> [222.427583] do_init_module+0x5f/0x220
<4> [222.427585] load_module+0x1ca4/0x1f00
<4> [222.427587] __do_sys_finit_module+0xb4/0x130
<4> [222.427589] do_syscall_64+0x3c/0x90
<4> [222.427591] entry_SYSCALL_64_after_hwframe+0x72/0xdc
<4> [222.427592]
-> #1 (fs_reclaim){+.+.}-{0:0}:
<4> [222.427594] lock_acquire+0xd8/0x2d0
<4> [222.427596] fs_reclaim_acquire+0xac/0xe0
<4> [222.427597] __alloc_pages+0xeb/0x2e0
<4> [222.427599] pte_alloc_one+0x17/0xf0
<4> [222.427602] __pte_alloc+0x26/0xf0
<4> [222.427604] __apply_to_page_range+0x6b3/0x750
<4> [222.427605] remap_io_mapping+0x70/0x130 [i915]
<4> [222.427671] vm_fault_gtt+0x46e/0xf60 [i915]
<4> [222.427763] __do_fault+0x2f/0x1d0
<4> [222.427764] do_pte_missing+0x5e7/0xd20
<4> [222.427766] __handle_mm_fault+0x5b0/0x790
<4> [222.427767] handle_mm_fault+0xa2/0x230
<4> [222.427768] do_user_addr_fault+0x3ea/0xa10
<4> [222.427770] exc_page_fault+0x68/0x1a0
<4> [222.427771] asm_exc_page_fault+0x26/0x30
<4> [222.427772]
-> #0 (>->reset.backoff_srcu){++++}-{0:0}:
<4> [222.427774] check_prev_add+0x90/0xc60
<4> [222.427776] __lock_acquire+0x1998/0x2590
<4> [222.427778] lock_acquire+0xd8/0x2d0
<4> [222.427779] _intel_gt_reset_lock+0x57/0x330 [i915]
<4> [222.427861] guc_timestamp_ping+0x35/0x130 [i915]
<4> [222.427968] process_one_work+0x250/0x510
<4> [222.427970] worker_thread+0x4f/0x3a0
<4> [222.427971] kthread+0xff/0x130
<4> [222.427974] ret_from_fork+0x29/0x50
<4> [222.427975]
other info that might help us debug this:
<4> [222.427976] Chain exists of:
>->reset.backoff_srcu --> >->reset.mutex --> (work_completion)(&(&guc->timestamp.work)->work)
<4> [222.427979] Possible unsafe locking scenario:
<4> [222.427980] CPU0 CPU1
<4> [222.427980] ---- ----
<4> [222.427981] lock((work_completion)(&(&guc->timestamp.work)->work));
<4> [222.427982] lock(>->reset.mutex);
<4> [222.427984] lock((work_completion)(&(&guc->timestamp.work)->work));
<4> [222.427985] lock(>->reset.backoff_srcu);
<4> [222.427987]
*** DEADLOCK ***
<4> [222.427987] 2 locks held by kworker/0:1H/146:
<4> [222.427988] #0: ffff888100082138 ((wq_completion)events_highpri){+.+.}-{0:0}, at: process_one_work+0x1c8/0x510
<4> [222.427992] #1: ffffc900005d3e60 ((work_completion)(&(&guc->timestamp.work)->work)){+.+.}-{0:0}, at: process_one_work+0x1cc/0x510
<4> [222.427995]
stack backtrace:
<4> [222.427996] CPU: 0 PID: 146 Comm: kworker/0:1H Not tainted 6.4.0-rc1-CI_DRM_13133-g9de28734b7c6+ #1
<4> [222.427998] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR4 RVP, BIOS ADLPFWI1.R00.3135.A00.2203251419 03/25/2022
<4> [222.428000] Workqueue: events_highpri guc_timestamp_ping [i915]
<4> [222.428106] Call Trace:
<4> [222.428107] <TASK>
<4> [222.428108] dump_stack_lvl+0x64/0xb0
<4> [222.428111] check_noncircular+0x131/0x150
<4> [222.428112] ? arch_stack_walk+0x87/0xf0
<4> [222.428115] check_prev_add+0x90/0xc60
<4> [222.428117] __lock_acquire+0x1998/0x2590
<4> [222.428119] ? startup_64_setup_env+0x84/0xaf0
<4> [222.428121] lock_acquire+0xd8/0x2d0
<4> [222.428123] ? __pfx__intel_gt_reset_lock+0x10/0x10 [i915]
<4> [222.428204] _intel_gt_reset_lock+0x57/0x330 [i915]
<4> [222.428285] ? __pfx__intel_gt_reset_lock+0x10/0x10 [i915]
<4> [222.428363] guc_timestamp_ping+0x35/0x130 [i915]
<4> [222.428462] process_one_work+0x250/0x510
<4> [222.428465] worker_thread+0x4f/0x3a0
<4> [222.428466] ? __pfx_worker_thread+0x10/0x10
<4> [222.428468] kthread+0xff/0x130
<4> [222.428470] ? __pfx_kthread+0x10/0x10
<4> [222.428472] ret_from_fork+0x29/0x50
<4> [222.428474] </TASK>
<7> [222.478343] i915 0000:00:02.0: [drm:wait_panel_status [i915]] Wait complete