BSW GEN9: Few tests - WARNING: possible circular locking dependency detected is trying to acquire lock:. at: stop_machine. but task is already holding lock at: do_page_fault
4> [70.541024] ======================================================
<4> [70.541028] WARNING: possible circular locking dependency detected
<4> [70.541035] 5.6.0-rc7-g68b152390f91-drmtip_465+ #1 Tainted: G U
<4> [70.541038] ------------------------------------------------------
<4> [70.541043] kms_plane/2040 is trying to acquire lock:
<4> [70.541048] ffffffff8543dc10 (cpu_hotplug_lock.rw_sem){++++}, at: stop_machine+0x12/0x30
<4> [70.541062]
but task is already holding lock:
<4> [70.541066] ffff9fe6365626d8 (&mm->mmap_sem#2){++++}, at: do_page_fault+0x13a/0x6f0
<4> [70.541077]
which lock already depends on the new lock.
<4> [70.541081]
the existing dependency chain (in reverse order) is:
<4> [70.541085]
-> #3 (&mm->mmap_sem#2){++++}:
<4> [70.541097] __might_fault+0x63/0x90
<4> [70.541104] _copy_to_user+0x1e/0x80
<4> [70.541110] perf_read+0x200/0x2b0
<4> [70.541116] vfs_read+0x96/0x160
<4> [70.541121] ksys_read+0x9f/0xe0
<4> [70.541127] do_syscall_64+0x4f/0x240
<4> [70.541136] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4> [70.541139]
-> #2 (&cpuctx_mutex){+.+.}:
<4> [70.541149] __mutex_lock+0x9a/0x9c0
<4> [70.541155] perf_event_init_cpu+0xa4/0x140
<4> [70.541162] perf_event_init+0x1c9/0x1f9
<4> [70.541168] start_kernel+0x362/0x4eb
<4> [70.541173] secondary_startup_64+0xb6/0xc0
<4> [70.541177]
-> #1 (pmus_lock){+.+.}:
<4> [70.541185] __mutex_lock+0x9a/0x9c0
<4> [70.541191] perf_event_init_cpu+0x6b/0x140
<4> [70.541198] cpuhp_invoke_callback+0x9b/0x9d0
<4> [70.541203] _cpu_up+0xa2/0x140
<4> [70.541208] do_cpu_up+0x61/0xa0
<4> [70.541215] smp_init+0x57/0x96
<4> [70.541220] kernel_init_freeable+0x87/0x1dc
<4> [70.541225] kernel_init+0x5/0x100
<4> [70.541231] ret_from_fork+0x3a/0x50
<4> [70.541234]
-> #0 (cpu_hotplug_lock.rw_sem){++++}:
<4> [70.541245] __lock_acquire+0x1328/0x15d0
<4> [70.541250] lock_acquire+0xa7/0x1c0
<4> [70.541255] cpus_read_lock+0x34/0xd0
<4> [70.541260] stop_machine+0x12/0x30
<4> [70.541460] bxt_vtd_ggtt_insert_entries__BKL+0x36/0x50 [i915]
<4> [70.541634] ggtt_bind_vma+0x31/0x50 [i915]
<4> [70.541835] __vma_bind+0x26/0x40 [i915]
<4> [70.542001] fence_work+0x1c/0x88 [i915]
<4> [70.542166] fence_notify+0x78/0xf8 [i915]
<4> [70.542331] __i915_sw_fence_complete+0x81/0x250 [i915]
<4> [70.542530] i915_vma_pin+0x21e/0x1190 [i915]
<4> [70.542727] i915_gem_object_ggtt_pin+0xb0/0x270 [i915]
<4> [70.542920] vm_fault_gtt+0x12f/0x990 [i915]
<4> [70.542927] __do_fault+0x45/0xf8
<4> [70.542934] __handle_mm_fault+0xba9/0x10c0
<4> [70.542940] handle_mm_fault+0x154/0x340
<4> [70.542946] do_page_fault+0x3ca/0x6f0
<4> [70.542951] page_fault+0x34/0x40
<4> [70.542954]
other info that might help us debug this:
<4> [70.542958] Chain exists of:
cpu_hotplug_lock.rw_sem --> &cpuctx_mutex --> &mm->mmap_sem#2
<4> [70.542966] Possible unsafe locking scenario:
<4> [70.542970] CPU0 CPU1
<4> [70.542973] ---- ----
<4> [70.542976] lock(&mm->mmap_sem#2);
<4> [70.542981] lock(&cpuctx_mutex);
<4> [70.542985] lock(&mm->mmap_sem#2);
<4> [70.542990] lock(cpu_hotplug_lock.rw_sem);
<4> [70.542995]
*** DEADLOCK ***
````