From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King Date: Wed, 30 Jan 2013 20:04:00 +0000 Subject: BUG: circular locking dependency detected Message-Id: <20130130200400.GB31748@flint.arm.linux.org.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fbdev@vger.kernel.org This looks like a bug in the framebuffer/console layers. Looks like we have one path where we call the notifier list, and a called function takes the console lock, and another path where we hold the console lock while calling the notifier list. =========================== [ INFO: possible circular locking dependency detected ] 3.8.0-rc4+ #656 Not tainted ------------------------------------------------------- kworker/0:1/442 is trying to acquire lock: ((fb_notifier_list).rwsem){.+.+.+}, at: [] __blocking_notifier_call_chain+0x34/0x68 but task is already holding lock: (console_lock){+.+.+.}, at: [] console_callback+0x14/0x138 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (console_lock){+.+.+.}: [] __lock_acquire+0x1d20/0x1e80 [] lock_acquire+0x68/0x7c [] console_lock+0x5c/0x70 [] register_con_driver+0x44/0x150 [] take_over_console+0x24/0x3b4 [] fbcon_takeover+0x70/0xd4 [] fbcon_event_notify+0x7c8/0x818 [] notifier_call_chain+0x4c/0x8c [] __blocking_notifier_call_chain+0x50/0x68 [] blocking_notifier_call_chain+0x20/0x28 [] fb_notifier_call_chain+0x20/0x28 [] register_framebuffer+0x18c/0x238 [] clcdfb_probe+0x2b0/0x3c0 [] amba_probe+0x88/0xa0 [] driver_probe_device+0x84/0x218 [] __driver_attach+0x9c/0xa0 [] bus_for_each_dev+0x5c/0x88 [] driver_attach+0x20/0x28 [] bus_add_driver+0xa4/0x244 [] driver_register+0x80/0x14c [] amba_driver_register+0x48/0x5c [] amba_clcdfb_init+0x28/0x3c [] do_one_initcall+0x44/0x1ac [] kernel_init_freeable+0x104/0x1c8 [] kernel_init+0x10/0xec [] ret_from_fork+0x14/0x24 -> #0 ((fb_notifier_list).rwsem){.+.+.+}: [] print_circular_bug+0x84/0x2f0 [] __lock_acquire+0x1e0c/0x1e80 [] lock_acquire+0x68/0x7c [] down_read+0x34/0x44 [] __blocking_notifier_call_chain+0x34/0x68 [] blocking_notifier_call_chain+0x20/0x28 [] fb_notifier_call_chain+0x20/0x28 [] fb_blank+0x40/0xac [] fbcon_blank+0x1f4/0x29c [] do_blank_screen+0x1b8/0x270 [] console_callback+0x74/0x138 [] process_one_work+0x1b4/0x4ec [] worker_thread+0x17c/0x4bc [] kthread+0xb0/0xbc [] ret_from_fork+0x14/0x24 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(console_lock); lock((fb_notifier_list).rwsem); lock(console_lock); lock((fb_notifier_list).rwsem); *** DEADLOCK *** 3 locks held by kworker/0:1/442: #0: (events){.+.+..}, at: [] process_one_work+0x140/0x4ec #1: (console_work){+.+...}, at: [] process_one_work+0x140/0x4ec #2: (console_lock){+.+.+.}, at: [] console_callback+0x14/0x138 stack backtrace: Backtrace: [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) r6:c05323f0 r5:c0524800 r4:c05323f0 r3:cf8f6b80 [] (dump_stack+0x0/0x1c) from [] (print_circular_bug+0x1e4/0x2f0) [] (print_circular_bug+0x0/0x2f0) from [] (__lock_acquire+0x1e0c/0x1e80) [] (__lock_acquire+0x0/0x1e80) from [] (lock_acquire+0x68/0x7c) [] (lock_acquire+0x0/0x7c) from [] (down_read+0x34/0x44) r7:00000010 r6:cfb7dd20 r5:00000002 r4:c04715cc [] (down_read+0x0/0x44) from [] (__blocking_notifier_call_chain+0x34/0x68) r5:ffffffff r4:c04715cc [] (__blocking_notifier_call_chain+0x0/0x68) from [] (blocking_notifier_call_chain+0x20/0x28) r7:cf0ffc00 r6:00000001 r5:cfb7dd20 r4:cfb5f800 [] (blocking_notifier_call_chain+0x0/0x28) from [] (fb_notifier_call_chain+0x20/0x28) [] (fb_notifier_call_chain+0x0/0x28) from [] (fb_blank+0x40/0xac) [] (fb_blank+0x0/0xac) from [] (fbcon_blank+0x1f4/0x29c) r6:00000001 r5:cf80a000 r4:cfb5f800 [] (fbcon_blank+0x0/0x29c) from [] (do_blank_screen+0x1b8/0x270) [] (do_blank_screen+0x0/0x270) from [] (console_callback+0x74/0x138) r7:c0ba8640 r6:c0bac300 r5:c099a51c r4:c099a51c [] (console_callback+0x0/0x138) from [] (process_one_work+0x1b4/0x4ec) r6:c0bac300 r5:cf9489c0 r4:c0472e3c r3:c01c2b34 [] (process_one_work+0x0/0x4ec) from [] (worker_thread+0x17c/0x4bc) [] (worker_thread+0x0/0x4bc) from [] (kthread+0xb0/0xbc) [] (kthread+0x0/0xbc) from [] (ret_from_fork+0x14/0x24) r8:00000000 r7:00000000 r6:00000000 r5:c004886c r4:cf84dde8 -- Russell King