lockdep + fault in apq8016 CI run
From https://gitlab.freedesktop.org/drm/msm/-/jobs/25673858:
======================================================
WARNING: possible circular locking dependency detected
5.19.0-rc2-00010-g7278d4590bd2 #1 Not tainted
------------------------------------------------------
kms_force_conne/237 is trying to acquire lock:
ffff80000a6d2ac8 (component_mutex){+.+.}-{3:3}, at: component_del+0x34/0x170
but task is already holding lock:
ffff0000047351c8 (&kms->commit_lock[i]){+.+.}-{3:3}, at: msm_atomic_commit_tail+0x174/0x6e0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&kms->commit_lock[i]){+.+.}-{3:3}:
lock_acquire+0x6c/0x90
__mutex_lock+0x84/0x400
mutex_lock_nested+0x3c/0x70
msm_atomic_commit_tail+0x174/0x6e0
commit_tail+0xa4/0x180
drm_atomic_helper_commit+0x178/0x3b0
drm_atomic_commit+0xa4/0xe0
drm_client_modeset_commit_atomic+0x228/0x284
drm_client_modeset_commit_locked+0x64/0x1d0
drm_client_modeset_commit+0x34/0x60
__drm_fb_helper_initial_config_and_unlock+0x478/0x580
drm_fb_helper_initial_config+0x54/0x6c
msm_fbdev_init+0x90/0xfc
msm_drm_bind+0x58c/0x654
try_to_bring_up_aggregate_device+0x164/0x1d0
__component_add+0xa8/0x174
component_add+0x18/0x2c
dsi_dev_attach+0x24/0x30
dsi_host_attach+0x98/0x14c
devm_mipi_dsi_attach+0x38/0xb0
adv7533_attach_dsi+0x8c/0x110
adv7511_probe+0x5a0/0x930
i2c_device_probe+0x30c/0x350
really_probe.part.0+0x9c/0x2b0
__driver_probe_device+0x98/0x144
driver_probe_device+0xac/0x14c
__device_attach_driver+0xbc/0x124
bus_for_each_drv+0x78/0xd0
__device_attach+0xa8/0x1c0
device_initial_probe+0x18/0x24
bus_probe_device+0xa0/0xac
deferred_probe_work_func+0x90/0xd0
process_one_work+0x28c/0x6b0
worker_thread+0x240/0x444
kthread+0x110/0x114
ret_from_fork+0x10/0x20
-> #2 (crtc_ww_class_mutex){+.+.}-{3:3}:
lock_acquire+0x6c/0x90
__ww_mutex_lock.constprop.0+0xa0/0x9d0
ww_mutex_lock+0x50/0x160
drm_modeset_lock+0x48/0x154
drmm_mode_config_init+0x22c/0x770
msm_drm_bind+0x13c/0x654
try_to_bring_up_aggregate_device+0x164/0x1d0
__component_add+0xa8/0x174
component_add+0x18/0x2c
dsi_dev_attach+0x24/0x30
dsi_host_attach+0x98/0x14c
devm_mipi_dsi_attach+0x38/0xb0
adv7533_attach_dsi+0x8c/0x110
adv7511_probe+0x5a0/0x930
i2c_device_probe+0x30c/0x350
really_probe.part.0+0x9c/0x2b0
__driver_probe_device+0x98/0x144
driver_probe_device+0xac/0x14c
__device_attach_driver+0xbc/0x124
bus_for_each_drv+0x78/0xd0
__device_attach+0xa8/0x1c0
device_initial_probe+0x18/0x24
bus_probe_device+0xa0/0xac
deferred_probe_work_func+0x90/0xd0
process_one_work+0x28c/0x6b0
worker_thread+0x240/0x444
kthread+0x110/0x114
ret_from_fork+0x10/0x20
-> #1 (crtc_ww_class_acquire){+.+.}-{0:0}:
lock_acquire+0x6c/0x90
drm_modeset_acquire_init+0xf4/0x150
drmm_mode_config_init+0x220/0x770
msm_drm_bind+0x13c/0x654
try_to_bring_up_aggregate_device+0x164/0x1d0
__component_add+0xa8/0x174
component_add+0x18/0x2c
dsi_dev_attach+0x24/0x30
dsi_host_attach+0x98/0x14c
devm_mipi_dsi_attach+0x38/0xb0
adv7533_attach_dsi+0x8c/0x110
adv7511_probe+0x5a0/0x930
i2c_device_probe+0x30c/0x350
really_probe.part.0+0x9c/0x2b0
__driver_probe_device+0x98/0x144
driver_probe_device+0xac/0x14c
__device_attach_driver+0xbc/0x124
bus_for_each_drv+0x78/0xd0
__device_attach+0xa8/0x1c0
device_initial_probe+0x18/0x24
bus_probe_device+0xa0/0xac
deferred_probe_work_func+0x90/0xd0
process_one_work+0x28c/0x6b0
worker_thread+0x240/0x444
kthread+0x110/0x114
ret_from_fork+0x10/0x20
-> #0 (component_mutex){+.+.}-{3:3}:
__lock_acquire+0x1280/0x20ac
lock_acquire.part.0+0xe0/0x230
lock_acquire+0x6c/0x90
__mutex_lock+0x84/0x400
mutex_lock_nested+0x3c/0x70
component_del+0x34/0x170
dsi_dev_detach+0x24/0x30
dsi_host_detach+0x20/0x64
mipi_dsi_detach+0x2c/0x40
adv7533_mode_set+0x64/0x90
adv7511_bridge_mode_set+0x210/0x214
drm_bridge_chain_mode_set+0x5c/0x84
crtc_set_mode+0x18c/0x1dc
drm_atomic_helper_commit_modeset_disables+0x40/0x50
msm_atomic_commit_tail+0x1d0/0x6e0
commit_tail+0xa4/0x180
drm_atomic_helper_commit+0x178/0x3b0
drm_atomic_commit+0xa4/0xe0
drm_client_modeset_commit_atomic+0x228/0x284
drm_client_modeset_commit_locked+0x64/0x1d0
drm_client_modeset_commit+0x34/0x60
drm_fb_helper_lastclose+0x74/0xcc
drm_lastclose+0x3c/0x80
drm_release+0xfc/0x114
__fput+0x70/0x224
____fput+0x14/0x20
task_work_run+0x88/0x1a0
do_exit+0x350/0xa50
do_group_exit+0x38/0xa4
__wake_up_parent+0x0/0x34
invoke_syscall+0x48/0x114
el0_svc_common.constprop.0+0x60/0x11c
do_el0_svc+0x30/0xc0
el0_svc+0x58/0x100
el0t_64_sync_handler+0x1b0/0x1bc
el0t_64_sync+0x18c/0x190
other info that might help us debug this:
Chain exists of:
component_mutex --> crtc_ww_class_mutex --> &kms->commit_lock[i]
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&kms->commit_lock[i]);
lock(crtc_ww_class_mutex);
lock(&kms->commit_lock[i]);
lock(component_mutex);
*** DEADLOCK ***
7 locks held by kms_force_conne/237:
#0: ffff80000a6c2540 (drm_global_mutex){+.+.}-{3:3}, at: drm_release+0x54/0x114
#1: ffff0000045e3678 (&helper->lock){+.+.}-{3:3}, at: drm_fb_helper_lastclose+0x6c/0xcc
#2: ffff0000047331a8 (&dev->master_mutex){+.+.}-{3:3}, at: drm_master_internal_acquire+0x28/0x60
#3: ffff0000045e3498 (&client->modeset_mutex){+.+.}-{3:3}, at: drm_client_modeset_commit_locked+0x30/0x1d0
#4: ffff80000c873b60 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_client_modeset_commit_atomic+0x48/0x284
#5: ffff0000045e2088 (crtc_ww_class_mutex){+.+.}-{3:3}, at: drm_modeset_lock+0x48/0x154
#6: ffff0000047351c8 (&kms->commit_lock[i]){+.+.}-{3:3}, at: msm_atomic_commit_tail+0x174/0x6e0
stack backtrace:
CPU: 3 PID: 237 Comm: kms_force_conne Not tainted 5.19.0-rc2-00010-g7278d4590bd2 #1
Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
Call trace:
dump_backtrace.part.0+0xd0/0xe0
show_stack+0x1c/0x6c
dump_stack_lvl+0x8c/0xb8
dump_stack+0x1c/0x38
print_circular_bug+0x1f8/0x200
check_noncircular+0x130/0x144
__lock_acquire+0x1280/0x20ac
lock_acquire.part.0+0xe0/0x230
lock_acquire+0x6c/0x90
__mutex_lock+0x84/0x400
mutex_lock_nested+0x3c/0x70
component_del+0x34/0x170
dsi_dev_detach+0x24/0x30
dsi_host_detach+0x20/0x64
mipi_dsi_detach+0x2c/0x40
adv7533_mode_set+0x64/0x90
adv7511_bridge_mode_set+0x210/0x214
drm_bridge_chain_mode_set+0x5c/0x84
crtc_set_mode+0x18c/0x1dc
drm_atomic_helper_commit_modeset_disables+0x40/0x50
msm_atomic_commit_tail+0x1d0/0x6e0
commit_tail+0xa4/0x180
drm_atomic_helper_commit+0x178/0x3b0
drm_atomic_commit+0xa4/0xe0
drm_client_modeset_commit_atomic+0x228/0x284
drm_client_modeset_commit_locked+0x64/0x1d0
drm_client_modeset_commit+0x34/0x60
drm_fb_helper_lastclose+0x74/0xcc
drm_lastclose+0x3c/0x80
drm_release+0xfc/0x114
__fput+0x70/0x224
____fput+0x14/0x20
task_work_run+0x88/0x1a0
do_exit+0x350/0xa50
do_group_exit+0x38/0xa4
__wake_up_parent+0x0/0x34
invoke_syscall+0x48/0x114
el0_svc_common.constprop.0+0x60/0x11c
do_el0_svc+0x30/0xc0
el0_svc+0x58/0x100
el0t_64_sync_handler+0x1b0/0x1bc
el0t_64_sync+0x18c/0x190
Unable to handle kernel write to read-only memory at virtual address ffff80000957c5c0
Mem abort info:
ESR = 0x000000009600004e
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x0e: level 2 permission fault
Data abort info:
ISV = 0, ISS = 0x0000004e
CM = 0, WnR = 1
swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000081c4e000
[ffff80000957c5c0] pgd=10000000bfeff003, p4d=10000000bfeff003, pud=10000000bfefe003, pmd=0060000081400f81
Internal error: Oops: 9600004e [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 237 Comm: kms_force_conne Not tainted 5.19.0-rc2-00010-g7278d4590bd2 #1
Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_dev_unregister+0x30/0xb0
lr : msm_drm_uninit.isra.0+0x188/0x1c0
sp : ffff80000c873770
x29: ffff80000c873770 x28: ffff000004265000 x27: ffff000004265018
x26: ffff000004265090 x25: ffff000003783600 x24: ffff000004733000
x23: ffff000004310010 x22: ffff80000957c538 x21: ffff800009589468
x20: ffff000004735080 x19: ffff80000957c538 x18: 00000000fffffffa
x17: 000000040044ffff x16: 00400032b5503510 x15: 0000000000000020
x14: 0000000000000000 x13: ffff80008c872e99 x12: ffff80000c872ea3
x11: ffff80000a386aa8 x10: 000000000000000a x9 : ffff80000c872da0
x8 : 000000000000000a x7 : 000000000000000f x6 : 000000000000000a
x5 : ffff00003fc92c18 x4 : 0000000000000000 x3 : dead000000000100
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff80000957c538
Call trace:
drm_dev_unregister+0x30/0xb0
msm_drm_uninit.isra.0+0x188/0x1c0
msm_drm_unbind+0x14/0x20
component_del+0xac/0x170
dsi_dev_detach+0x24/0x30
dsi_host_detach+0x20/0x64
mipi_dsi_detach+0x2c/0x40
adv7533_mode_set+0x64/0x90
adv7511_bridge_mode_set+0x210/0x214
drm_bridge_chain_mode_set+0x5c/0x84
crtc_set_mode+0x18c/0x1dc
drm_atomic_helper_commit_modeset_disables+0x40/0x50
msm_atomic_commit_tail+0x1d0/0x6e0
commit_tail+0xa4/0x180
drm_atomic_helper_commit+0x178/0x3b0
drm_atomic_commit+0xa4/0xe0
drm_client_modeset_commit_atomic+0x228/0x284
drm_client_modeset_commit_locked+0x64/0x1d0
drm_client_modeset_commit+0x34/0x60
drm_fb_helper_lastclose+0x74/0xcc
drm_lastclose+0x3c/0x80
drm_release+0xfc/0x114
__fput+0x70/0x224
____fput+0x14/0x20
task_work_run+0x88/0x1a0
do_exit+0x350/0xa50
do_group_exit+0x38/0xa4
__wake_up_parent+0x0/0x34
invoke_syscall+0x48/0x114
el0_svc_common.constprop.0+0x60/0x11c
do_el0_svc+0x30/0xc0
el0_svc+0x58/0x100
el0t_64_sync_handler+0x1b0/0x1bc
el0t_64_sync+0x18c/0x190
Code: b940b821 0a020021 36d00041 97fff0d5 (3902227f)
---[ end trace 0000000000000000 ]---