[lockdep] drm/i915: possible circular locking dependency in i915 driver init

Daniel Vetter daniel at ffwll.ch
Mon Aug 15 06:39:29 UTC 2016


On Sun, Aug 14, 2016 at 11:01:35PM +0900, Masami Hiramatsu wrote:
> Hello,
> 
> I've found a suspicious circular locking dependency in i915 by lockdep.
> It seems main driver initialization thread and sub fbdev configuration
> thread take locks in different order implicitly. Please check it.
> 
> The lockdep report is here.

Should be fixed in 4.8-rc2, please confirm.
-Daniel

> 
> [    4.254984] ======================================================
> [    4.254984] [ INFO: possible circular locking dependency detected ]
> [    4.254985] 4.8.0-rc1+ #8 Not tainted
> [    4.254985] -------------------------------------------------------
> [    4.254986] kworker/u16:1/72 is trying to acquire lock:
> [    4.255001]  (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffffc02eafb0>] drm_modeset_lock_all+0x40/0x130 [drm]
> [    4.255001] 
>                but task is already holding lock:
> [    4.255005]  ((fb_notifier_list).rwsem){++++.+}, at: [<ffffffff980b2ea5>] __blocking_notifier_call_chain+0x35/0x70
> [    4.255005] 
>                which lock already depends on the new lock.
> 
> [    4.255005] 
>                the existing dependency chain (in reverse order) is:
> [    4.255006] 
>                -> #1 ((fb_notifier_list).rwsem){++++.+}:
> [    4.255009]        [<ffffffff980e7a00>] lock_acquire+0x100/0x1f0
> [    4.255011]        [<ffffffff988b29a9>] down_write+0x49/0x80
> [    4.255013]        [<ffffffff980b3031>] blocking_notifier_chain_register+0x21/0xb0
> [    4.255015]        [<ffffffff984c93c8>] fb_register_client+0x18/0x20
> [    4.255016]        [<ffffffff984c8c1e>] backlight_device_register+0x12e/0x250
> [    4.255046]        [<ffffffffc04e3842>] intel_backlight_device_register+0xa2/0x160 [i915]
> [    4.255070]        [<ffffffffc04b173e>] intel_connector_register+0xe/0x10 [i915]
> [    4.255093]        [<ffffffffc04cd5db>] intel_dp_connector_register+0x1b/0x80 [i915]
> [    4.255102]        [<ffffffffc02d943a>] drm_connector_register+0x4a/0x80 [drm]
> [    4.255110]        [<ffffffffc02ddbe6>] drm_modeset_register_all+0x1c6/0x260 [drm]
> [    4.255116]        [<ffffffffc02d4ba2>] drm_dev_register+0xc2/0xd0 [drm]
> [    4.255135]        [<ffffffffc04212f1>] i915_driver_load+0x771/0x1460 [i915]
> [    4.255153]        [<ffffffffc042c63f>] i915_pci_probe+0x4f/0x70 [i915]
> [    4.255155]        [<ffffffff98497905>] local_pci_probe+0x45/0xa0
> [    4.255157]        [<ffffffff98498d11>] pci_device_probe+0xe1/0x130
> [    4.255159]        [<ffffffff985ae5e4>] driver_probe_device+0x224/0x430
> [    4.255160]        [<ffffffff985ae8d3>] __driver_attach+0xe3/0xf0
> [    4.255160]        [<ffffffff985ac166>] bus_for_each_dev+0x66/0xa0
> [    4.255161]        [<ffffffff985adcee>] driver_attach+0x1e/0x20
> [    4.255162]        [<ffffffff985ad7d0>] bus_add_driver+0x200/0x270
> [    4.255164]        [<ffffffff985af520>] driver_register+0x60/0xe0
> [    4.255165]        [<ffffffff98497230>] __pci_register_driver+0x60/0x70
> [    4.255182]        [<ffffffffc035f05b>] i915_init+0x5b/0x62 [i915]
> [    4.255183]        [<ffffffff9800217d>] do_one_initcall+0x3d/0x160
> [    4.255186]        [<ffffffff981c6d8d>] do_init_module+0x5f/0x1f8
> [    4.255187]        [<ffffffff9812fbdc>] load_module+0x246c/0x2bd0
> [    4.255188]        [<ffffffff9813057c>] SYSC_finit_module+0xbc/0xf0
> [    4.255190]        [<ffffffff981305ce>] SyS_finit_module+0xe/0x10
> [    4.255191]        [<ffffffff988b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
> [    4.255192] 
>                -> #0 (&dev->mode_config.mutex){+.+.+.}:
> [    4.255194]        [<ffffffff980e732c>] __lock_acquire+0x125c/0x14b0
> [    4.255195]        [<ffffffff980e7a00>] lock_acquire+0x100/0x1f0
> [    4.255197]        [<ffffffff988b0889>] mutex_lock_nested+0x69/0x3b0
> [    4.255206]        [<ffffffffc02eafb0>] drm_modeset_lock_all+0x40/0x130 [drm]
> [    4.255212]        [<ffffffffc03f877b>] drm_fb_helper_restore_fbdev_mode_unlocked+0x2b/0x80 [drm_kms_helper]
> [    4.255217]        [<ffffffffc03f87fd>] drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper]
> [    4.255240]        [<ffffffffc04c21da>] intel_fbdev_set_par+0x1a/0x60 [i915]
> [    4.255242]        [<ffffffff984c2f2f>] fbcon_init+0x57f/0x600
> [    4.255244]        [<ffffffff98555026>] visual_init+0xd6/0x130
> [    4.255245]        [<ffffffff98556831>] do_bind_con_driver+0x1c1/0x3a0
> [    4.255246]        [<ffffffff98556d16>] do_take_over_console+0x116/0x180
> [    4.255247]        [<ffffffff984beb67>] do_fbcon_takeover+0x57/0xb0
> [    4.255249]        [<ffffffff984c39a8>] fbcon_event_notify+0x658/0x750
> [    4.255250]        [<ffffffff980b2c1a>] notifier_call_chain+0x4a/0x70
> [    4.255251]        [<ffffffff980b2ebd>] __blocking_notifier_call_chain+0x4d/0x70
> [    4.255253]        [<ffffffff980b2ef6>] blocking_notifier_call_chain+0x16/0x20
> [    4.255254]        [<ffffffff984c940b>] fb_notifier_call_chain+0x1b/0x20
> [    4.255255]        [<ffffffff984cb6c1>] register_framebuffer+0x251/0x330
> [    4.255259]        [<ffffffffc03f8a7f>] drm_fb_helper_initial_config+0x25f/0x3f0 [drm_kms_helper]
> [    4.255282]        [<ffffffffc04c3498>] intel_fbdev_initial_config+0x18/0x30 [i915]
> [    4.255283]        [<ffffffff980b4aa7>] async_run_entry_fn+0x37/0x150
> [    4.255284]        [<ffffffff980aa9c8>] process_one_work+0x1e8/0x710
> [    4.255285]        [<ffffffff980aaf3b>] worker_thread+0x4b/0x4f0
> [    4.255286]        [<ffffffff980b193f>] kthread+0xef/0x110
> [    4.255287]        [<ffffffff988b58cf>] ret_from_fork+0x1f/0x40
> [    4.255287] 
>                other info that might help us debug this:
> 
> [    4.255288]  Possible unsafe locking scenario:
> 
> [    4.255288]        CPU0                    CPU1
> [    4.255288]        ----                    ----
> [    4.255289]   lock((fb_notifier_list).rwsem);
> [    4.255290]                                lock(&dev->mode_config.mutex);
> [    4.255290]                                lock((fb_notifier_list).rwsem);
> [    4.255291]   lock(&dev->mode_config.mutex);
> [    4.255291] 
>                 *** DEADLOCK ***
> 
> And i915 related kconfigs are here:
> ----
> CONFIG_DRM_I915=m
> CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT=y
> CONFIG_DRM_I915_USERPTR=y
> CONFIG_DRM_I915_GVT=y
> # CONFIG_DRM_I915_WERROR is not set
> # CONFIG_DRM_I915_DEBUG is not set
> ----
> 
> I've hit this on my DELL XPS15 which has skylake CPU/GPU.
> 
> Thanks,
> 
> 
> -- 
> Masami Hiramatsu <mhiramat at kernel.org>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list