Regression in 5.15-rc6 - WARNING: possible circular locking dependency detected

Fabio Estevam festevam at gmail.com
Sun Oct 24 05:09:12 PDT 2021


Hi Francesco,

[Adding Daniel on Cc]

On Fri, Oct 22, 2021 at 1:31 PM Francesco Dolcini
<francesco.dolcini at toradex.com> wrote:
>
> Hello all,
> I just had a kernel WARNING doing a quick boot test with 5.15-rc6, the issue
> seems reproducible at every boot. NXP i.MX6 CPU, Apalis iMX6D 1GB board,
> arch/arm/boot/dts/imx6q-apalis-eval.dts, imx_v6_v7_defconfig.
>
> # cat /proc/version
>
> Linux version 5.15.0-rc6 (francesco at francesco-nb) (arm-linux-gnueabihf-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #5 SMP Fri Oct 22 18:05:46 CEST 2021
>
> Linux 5.14.14 boots without any warning, no idea on any previous 5.15 rc. I was
> not able to bisect when this issue was introduced (and I'm not sure when I'll
> have the time to do it).
>
> Any idea?
>
> [    6.294686] imx-drm display-subsystem: bound imx-ipuv3-crtc.2 (ops ipu_crtc_ops)
> [    6.303115] imx-drm display-subsystem: bound imx-ipuv3-crtc.3 (ops ipu_crtc_ops)
> [    6.311727] imx-drm display-subsystem: bound imx-ipuv3-crtc.6 (ops ipu_crtc_ops)
> [    6.320037] imx-drm display-subsystem: bound imx-ipuv3-crtc.7 (ops ipu_crtc_ops)
> [    6.329265] imx-drm display-subsystem: bound 120000.hdmi (ops dw_hdmi_imx_ops)
> [    6.337159] imx-drm display-subsystem: bound disp0 (ops imx_pd_ops)
> [    6.348908] [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1
> [    6.381584]
> [    6.381602] WARNING: possible circular locking dependency detected
> [    6.381608] 5.15.0-rc6 #5 Not tainted
> [    6.381616] ------------------------------------------------------
> [    6.381622] kworker/u4:0/7 is trying to acquire lock:
> [    6.381630] c1752428 (regulator_list_mutex){+.+.}-{3:3}, at: regulator_lock_dependent+0x40/0x294
> [    6.381672]
> [    6.381672] but task is already holding lock:
> [    6.381678] c176e548 (dma_fence_map){++++}-{0:0}, at: imx_drm_atomic_commit_tail+0x10/0x160
> [    6.381717]
> [    6.381717] which lock already depends on the new lock.
> [    6.381717]
> [    6.381722]
> [    6.381722] the existing dependency chain (in reverse order) is:
> [    6.381727]
> [    6.381727] -> #3 (dma_fence_map){++++}-{0:0}:
> [    6.381749]        dma_resv_lockdep+0x1c4/0x2b8
> [    6.381763]        do_one_initcall+0x78/0x388
> [    6.381780]        kernel_init_freeable+0x198/0x22c
> [    6.381798]        kernel_init+0x10/0x128
> [    6.381813]        ret_from_fork+0x14/0x38
> [    6.381824]        0x0
> [    6.381833]
> [    6.381833] -> #2 (fs_reclaim){+.+.}-{0:0}:
> [    6.381856]        kmem_cache_alloc+0x28/0x384
> [    6.381867]        __d_alloc+0x20/0x224
> [    6.381883]        d_alloc+0x10/0x60
> [    6.381894]        d_alloc_parallel+0x48/0xa60
> [    6.381908]        __lookup_slow+0x8c/0x178
> [    6.381926]        lookup_one_len+0xa0/0xe8
> [    6.381937]        start_creating+0x94/0x14c
> [    6.381955]        debugfs_create_dir+0x10/0x114
> [    6.381967]        pinctrl_init+0x1c/0xd4
> [    6.381979]        do_one_initcall+0x78/0x388
> [    6.381990]        kernel_init_freeable+0x198/0x22c
> [    6.382005]        kernel_init+0x10/0x128
> [    6.382016]        ret_from_fork+0x14/0x38
> [    6.382026]        0x0
> [    6.382033]
> [    6.382033] -> #1 (&sb->s_type->i_mutex_key#2){+.+.}-{3:3}:
> [    6.382064]        simple_recursive_removal+0x54/0x35c
> [    6.382081]        debugfs_remove+0x30/0x4c
> [    6.382093]        _regulator_put.part.0+0x30/0x1d8
> [    6.382105]        regulator_put+0x2c/0x3c
> [    6.382113]        sgtl5000_i2c_probe+0x70/0x644
> [    6.382129]        i2c_device_probe+0x288/0x2bc
> [    6.382151]        really_probe+0x14c/0x320
> [    6.382169]        __driver_probe_device+0x80/0xe4
> [    6.382181]        driver_probe_device+0x30/0xd4
> [    6.382193]        __driver_attach+0x70/0xf4
> [    6.382204]        bus_for_each_dev+0x74/0xc0
> [    6.382217]        bus_add_driver+0x150/0x1dc
> [    6.382229]        driver_register+0x74/0x108
> [    6.382240]        i2c_register_driver+0x38/0x8c
> [    6.382254]        do_one_initcall+0x78/0x388
> [    6.382266]        kernel_init_freeable+0x198/0x22c
> [    6.382281]        kernel_init+0x10/0x128
> [    6.382291]        ret_from_fork+0x14/0x38
> [    6.382300]        0x0
> [    6.382306]
> [    6.382306] -> #0 (regulator_list_mutex){+.+.}-{3:3}:
> [    6.382326]        lock_acquire+0x130/0x400
> [    6.382339]        __mutex_lock+0x94/0xa40
> [    6.382353]        mutex_lock_nested+0x1c/0x24
> [    6.382365]        regulator_lock_dependent+0x40/0x294
> [    6.382375]        regulator_enable+0x2c/0xec
> [    6.382387]        panel_simple_resume+0x38/0x1f4
> [    6.382404]        __rpm_callback+0x3c/0x108
> [    6.382422]        rpm_callback+0x68/0x70
> [    6.382432]        rpm_resume+0x5ec/0x7dc
> [    6.382441]        __pm_runtime_resume+0x64/0x90
> [    6.382453]        panel_simple_prepare+0x2c/0x50
> [    6.382465]        imx_pd_bridge_enable+0x10/0x1c
> [    6.382477]        drm_atomic_bridge_chain_enable+0x80/0xa4
> [    6.382492]        drm_atomic_helper_commit_modeset_enables+0x12c/0x26c
> [    6.382515]        imx_drm_atomic_commit_tail+0x3c/0x160
> [    6.382525]        commit_tail+0x9c/0x190
> [    6.382538]        drm_atomic_helper_commit+0x158/0x18c
> [    6.382550]        drm_client_modeset_commit_atomic+0x238/0x284
> [    6.382568]        drm_client_modeset_commit_locked+0x60/0x1cc
> [    6.382579]        drm_client_modeset_commit+0x24/0x40
> [    6.382589]        __drm_fb_helper_restore_fbdev_mode_unlocked+0x9c/0xc8
> [    6.382608]        drm_fb_helper_set_par+0x38/0x68
> [    6.382620]        fbcon_init+0x2bc/0x550
> [    6.382640]        visual_init+0xbc/0x104
> [    6.382657]        do_bind_con_driver+0x1c8/0x3b0
> [    6.382670]        do_take_over_console+0x134/0x1f0
> [    6.382680]        do_fbcon_takeover+0x60/0xc0
> [    6.382692]        register_framebuffer+0x1c8/0x2e8
> [    6.382704]        __drm_fb_helper_initial_config_and_unlock+0x3f8/0x644
> [    6.382718]        drm_fbdev_client_hotplug+0xf8/0x194
> [    6.382730]        drm_fbdev_generic_setup+0x9c/0x198
> [    6.382740]        imx_drm_bind+0xdc/0x120
> [    6.382750]        try_to_bring_up_master+0x15c/0x1a8
> [    6.382770]        __component_add+0x94/0x140
> [    6.382781]        imx_pd_probe+0x130/0x18c
> [    6.382791]        platform_probe+0x58/0xb8
> [    6.382802]        really_probe+0x14c/0x320
> [    6.382817]        __driver_probe_device+0x80/0xe4
> [    6.382828]        driver_probe_device+0x30/0xd4
> [    6.382839]        __device_attach_driver+0x8c/0xb4
> [    6.382850]        bus_for_each_drv+0x80/0xd0
> [    6.382861]        __device_attach+0xec/0x160
> [    6.382873]        bus_probe_device+0x88/0x90
> [    6.382883]        deferred_probe_work_func+0x7c/0xac
> [    6.382894]        process_one_work+0x298/0x7cc
> [    6.382913]        worker_thread+0x30/0x50c
> [    6.382923]        kthread+0x154/0x17c
> [    6.382935]        ret_from_fork+0x14/0x38
> [    6.382944]        0x0
> [    6.382951]
> [    6.382951] other info that might help us debug this:
> [    6.382951]
> [    6.382956] Chain exists of:
> [    6.382956]   regulator_list_mutex --> fs_reclaim --> dma_fence_map
> [    6.382956]
> [    6.382987]  Possible unsafe locking scenario:
> [    6.382987]
> [    6.382992]        CPU0                    CPU1
> [    6.382996]        ----                    ----
> [    6.382999]   lock(dma_fence_map);
> [    6.383009]                                lock(fs_reclaim);
> [    6.383021]                                lock(dma_fence_map);
> [    6.383032]   lock(regulator_list_mutex);
> [    6.383042]
> [    6.383042]  *** DEADLOCK ***
> [    6.383042]
> [    6.383045] 13 locks held by kworker/u4:0/7:
> [    6.383053]  #0: c2006ca8 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1ec/0x7cc
> [    6.383088]  #1: c20c7f28 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x1ec/0x7cc
> [    6.383120]  #2: c22cf0d8 (&dev->mutex){....}-{3:3}, at: __device_attach+0x30/0x160
> [    6.383154]  #3: c176a1a4 (component_mutex){+.+.}-{3:3}, at: __component_add+0x44/0x140
> [    6.383189]  #4: c174cc3c (registration_lock){+.+.}-{3:3}, at: register_framebuffer+0x28/0x2e8
> [    6.383220]  #5: c1618544 (console_lock){+.+.}-{0:0}, at: register_framebuffer+0x248/0x2e8
> [    6.383251]  #6: c2bdfc48 (&fb_info->lock){+.+.}-{3:3}, at: register_framebuffer+0x1c0/0x2e8
> [    6.383282]  #7: c292fb6c (&helper->lock){+.+.}-{3:3}, at: __drm_fb_helper_restore_fbdev_mode_unlocked+0x4c/0xc8
> [    6.383319]  #8: c2ad00e8 (&dev->master_mutex){+.+.}-{3:3}, at: drm_master_internal_acquire+0x18/0x3c
> [    6.383356]  #9: c292fa50 (&client->modeset_mutex){+.+.}-{3:3}, at: drm_client_modeset_commit_locked+0x20/0x1cc
> [    6.383394]  #10: c20c7b18 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_client_modeset_commit_atomic+0x34/0x284
> [    6.383429]  #11: c2ad34a0 (crtc_ww_class_mutex){+.+.}-{3:3}, at: drm_modeset_backoff+0x90/0x228
> [    6.383464]  #12: c176e548 (dma_fence_map){++++}-{0:0}, at: imx_drm_atomic_commit_tail+0x10/0x160
> [    6.383500]
> [    6.383500] stack backtrace:
> [    6.383506] CPU: 0 PID: 7 Comm: kworker/u4:0 Not tainted 5.15.0-rc6 #5
> [    6.383521] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [    6.383530] Workqueue: events_unbound deferred_probe_work_func
> [    6.383553] [<c01118f8>] (unwind_backtrace) from [<c010bde0>] (show_stack+0x10/0x14)
> [    6.383580] [<c010bde0>] (show_stack) from [<c0e86d9c>] (dump_stack_lvl+0x58/0x70)
> [    6.383600] [<c0e86d9c>] (dump_stack_lvl) from [<c0188f44>] (check_noncircular+0xf4/0x168)
> [    6.383616] [<c0188f44>] (check_noncircular) from [<c018cdfc>] (__lock_acquire+0x169c/0x3210)
> [    6.383632] [<c018cdfc>] (__lock_acquire) from [<c018f3dc>] (lock_acquire+0x130/0x400)
> [    6.383646] [<c018f3dc>] (lock_acquire) from [<c0e98cc8>] (__mutex_lock+0x94/0xa40)
> [    6.383669] [<c0e98cc8>] (__mutex_lock) from [<c0e99690>] (mutex_lock_nested+0x1c/0x24)
> [    6.383688] [<c0e99690>] (mutex_lock_nested) from [<c06afa2c>] (regulator_lock_dependent+0x40/0x294)
> [    6.383710] [<c06afa2c>] (regulator_lock_dependent) from [<c06b33bc>] (regulator_enable+0x2c/0xec)
> [    6.383727] [<c06b33bc>] (regulator_enable) from [<c07d3238>] (panel_simple_resume+0x38/0x1f4)
> [    6.383748] [<c07d3238>] (panel_simple_resume) from [<c080b424>] (__rpm_callback+0x3c/0x108)
> [    6.383772] [<c080b424>] (__rpm_callback) from [<c080b558>] (rpm_callback+0x68/0x70)
> [    6.383789] [<c080b558>] (rpm_callback) from [<c080b07c>] (rpm_resume+0x5ec/0x7dc)
> [    6.383806] [<c080b07c>] (rpm_resume) from [<c080b2d0>] (__pm_runtime_resume+0x64/0x90)
> [    6.383824] [<c080b2d0>] (__pm_runtime_resume) from [<c07d30c8>] (panel_simple_prepare+0x2c/0x50)
> [    6.383843] [<c07d30c8>] (panel_simple_prepare) from [<c07cfd0c>] (imx_pd_bridge_enable+0x10/0x1c)
> [    6.383862] [<c07cfd0c>] (imx_pd_bridge_enable) from [<c0727fb8>] (drm_atomic_bridge_chain_enable+0x80/0xa4)
> [    6.383883] [<c0727fb8>] (drm_atomic_bridge_chain_enable) from [<c070690c>] (drm_atomic_helper_commit_modeset_enables+0x12c/0x26c)
> [    6.383908] [<c070690c>] (drm_atomic_helper_commit_modeset_enables) from [<c07cd4cc>] (imx_drm_atomic_commit_tail+0x3c/0x160)
> [    6.383928] [<c07cd4cc>] (imx_drm_atomic_commit_tail) from [<c070869c>] (commit_tail+0x9c/0x190)
> [    6.383948] [<c070869c>] (commit_tail) from [<c07088f0>] (drm_atomic_helper_commit+0x158/0x18c)
> [    6.383968] [<c07088f0>] (drm_atomic_helper_commit) from [<c073dcb8>] (drm_client_modeset_commit_atomic+0x238/0x284)
> [    6.383992] [<c073dcb8>] (drm_client_modeset_commit_atomic) from [<c073ddd4>] (drm_client_modeset_commit_locked+0x60/0x1cc)
> [    6.384012] [<c073ddd4>] (drm_client_modeset_commit_locked) from [<c073df64>] (drm_client_modeset_commit+0x24/0x40)
> [    6.384031] [<c073df64>] (drm_client_modeset_commit) from [<c070ed5c>] (__drm_fb_helper_restore_fbdev_mode_unlocked+0x9c/0xc8)
> [    6.384055] [<c070ed5c>] (__drm_fb_helper_restore_fbdev_mode_unlocked) from [<c070edf0>] (drm_fb_helper_set_par+0x38/0x68)
> [    6.384074] [<c070edf0>] (drm_fb_helper_set_par) from [<c06786f0>] (fbcon_init+0x2bc/0x550)
> [    6.384097] [<c06786f0>] (fbcon_init) from [<c06d8610>] (visual_init+0xbc/0x104)
> [    6.384122] [<c06d8610>] (visual_init) from [<c06d9a3c>] (do_bind_con_driver+0x1c8/0x3b0)
> [    6.384142] [<c06d9a3c>] (do_bind_con_driver) from [<c06d9f80>] (do_take_over_console+0x134/0x1f0)
> [    6.384160] [<c06d9f80>] (do_take_over_console) from [<c0676334>] (do_fbcon_takeover+0x60/0xc0)
> [    6.384179] [<c0676334>] (do_fbcon_takeover) from [<c066e7e0>] (register_framebuffer+0x1c8/0x2e8)
> [    6.384198] [<c066e7e0>] (register_framebuffer) from [<c070e6f4>] (__drm_fb_helper_initial_config_and_unlock+0x3f8/0x644)
> [    6.384216] [<c070e6f4>] (__drm_fb_helper_initial_config_and_unlock) from [<c070f02c>] (drm_fbdev_client_hotplug+0xf8/0x194)
> [    6.384236] [<c070f02c>] (drm_fbdev_client_hotplug) from [<c070f164>] (drm_fbdev_generic_setup+0x9c/0x198)
> [    6.384254] [<c070f164>] (drm_fbdev_generic_setup) from [<c07cd44c>] (imx_drm_bind+0xdc/0x120)
> [    6.384275] [<c07cd44c>] (imx_drm_bind) from [<c07f57c4>] (try_to_bring_up_master+0x15c/0x1a8)
> [    6.384301] [<c07f57c4>] (try_to_bring_up_master) from [<c07f58a4>] (__component_add+0x94/0x140)
> [    6.384323] [<c07f58a4>] (__component_add) from [<c07cfe64>] (imx_pd_probe+0x130/0x18c)
> [    6.384344] [<c07cfe64>] (imx_pd_probe) from [<c07ff918>] (platform_probe+0x58/0xb8)
> [    6.384361] [<c07ff918>] (platform_probe) from [<c07fd220>] (really_probe+0x14c/0x320)
> [    6.384382] [<c07fd220>] (really_probe) from [<c07fd474>] (__driver_probe_device+0x80/0xe4)
> [    6.384402] [<c07fd474>] (__driver_probe_device) from [<c07fd508>] (driver_probe_device+0x30/0xd4)
> [    6.384422] [<c07fd508>] (driver_probe_device) from [<c07fd824>] (__device_attach_driver+0x8c/0xb4)
> [    6.384442] [<c07fd824>] (__device_attach_driver) from [<c07fb5e4>] (bus_for_each_drv+0x80/0xd0)
> [    6.384464] [<c07fb5e4>] (bus_for_each_drv) from [<c07fd058>] (__device_attach+0xec/0x160)
> [    6.384482] [<c07fd058>] (__device_attach) from [<c07fc2b8>] (bus_probe_device+0x88/0x90)
> [    6.384500] [<c07fc2b8>] (bus_probe_device) from [<c07fc774>] (deferred_probe_work_func+0x7c/0xac)
> [    6.384518] [<c07fc774>] (deferred_probe_work_func) from [<c0147ec0>] (process_one_work+0x298/0x7cc)
> [    6.384542] [<c0147ec0>] (process_one_work) from [<c0148424>] (worker_thread+0x30/0x50c)
> [    6.384560] [<c0148424>] (worker_thread) from [<c01512e4>] (kthread+0x154/0x17c)
> [    6.384579] [<c01512e4>] (kthread) from [<c010011c>] (ret_from_fork+0x14/0x38)
> [    6.384596] Exception stack(0xc20c7fb0 to 0xc20c7ff8)
> [    6.384605] 7fa0:                                     ???????? ???????? ???????? ????????
> [    6.384612] 7fc0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
> [    6.384619] 7fe0: ???????? ???????? ???????? ???????? ???????? ????????

This is caused by f4b34faa0842 ("drm/imx: Annotate dma-fence critical
section in commit path").

I have reported this in https://www.spinics.net/lists/dri-devel/msg318671.html

Hi Daniel,

Would you have any suggestions?

Thanks



More information about the linux-arm-kernel mailing list