From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752644Ab2L0ExE (ORCPT ); Wed, 26 Dec 2012 23:53:04 -0500 Received: from mail.skyhub.de ([78.46.96.112]:54446 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751053Ab2L0ExB (ORCPT ); Wed, 26 Dec 2012 23:53:01 -0500 Date: Thu, 27 Dec 2012 05:53:01 +0100 From: Borislav Petkov To: Sasha Levin Cc: Cong Wang , Josh Boyer , Alan Cox , LKML , Florian Tobias Schandinat , Linus Torvalds Subject: Re: [PATCH] fb: Rework locking to fix lock ordering on takeover Message-ID: <20121227045301.GB17472@x1.alien8.de> Mail-Followup-To: Borislav Petkov , Sasha Levin , Cong Wang , Josh Boyer , Alan Cox , LKML , Florian Tobias Schandinat , Linus Torvalds References: <20121116192606.11799.35711.stgit@localhost.localdomain> <20121121125310.00625f55@pyramind.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 26, 2012 at 01:09:51PM -0500, Sasha Levin wrote: > > This patch can fix the following warning we saw? > > http://lkml.org/lkml/2012/12/22/53 > > > > I will give it a try. > > Yup, that's the same error I've reported couple of months ago. > > It looks like the fb maintains are still absent, so it'll probably > need a different way to get upstream. Adding to the bug pressure: just got a very similar splat on -rc1 (see below). Alan, I'll run your patch to verify. Thanks. [33946.663968] ====================================================== [33946.663970] [ INFO: possible circular locking dependency detected ] [33946.663978] 3.8.0-rc1+ #1 Not tainted [33946.663980] ------------------------------------------------------- [33946.663986] kworker/1:2/15780 is trying to acquire lock: [33946.664010] ((fb_notifier_list).rwsem){++++.+}, at: [] __blocking_notifier_call_chain+0x33/0x60 [33946.664013] [33946.664013] but task is already holding lock: [33946.664029] (console_lock){+.+.+.}, at: [] console_callback+0x13/0x160 [33946.664032] [33946.664032] which lock already depends on the new lock. [33946.664032] [33946.664034] [33946.664034] the existing dependency chain (in reverse order) is: [33946.664042] [33946.664042] -> #1 (console_lock){+.+.+.}: [33946.664054] [] lock_acquire+0x8a/0x140 [33946.664063] [] console_lock+0x5f/0x70 [33946.664072] [] register_con_driver+0x39/0x150 [33946.664080] [] take_over_console+0x2e/0x70 [33946.664088] [] fbcon_takeover+0x5a/0xb0 [33946.664096] [] fbcon_event_notify+0x5eb/0x6f0 [33946.664103] [] notifier_call_chain+0x4c/0x70 [33946.664111] [] __blocking_notifier_call_chain+0x4b/0x60 [33946.664119] [] blocking_notifier_call_chain+0x16/0x20 [33946.664127] [] fb_notifier_call_chain+0x1b/0x20 [33946.664136] [] register_framebuffer+0x1bc/0x2f0 [33946.664169] [] drm_fb_helper_single_fb_probe+0x1e3/0x310 [drm_kms_helper] [33946.664183] [] drm_fb_helper_initial_config+0x1d1/0x230 [drm_kms_helper] [33946.664239] [] radeon_fbdev_init+0xc1/0x120 [radeon] [33946.664290] [] radeon_modeset_init+0x3a8/0xb90 [radeon] [33946.664333] [] radeon_driver_load_kms+0xf0/0x180 [radeon] [33946.664344] [] drm_get_pci_dev+0x186/0x2d0 [33946.664379] [] radeon_pci_probe+0xb3/0xf0 [radeon] [33946.664390] [] pci_device_probe+0x9c/0xe0 [33946.664400] [] driver_probe_device+0x8b/0x3a0 [33946.664408] [] __driver_attach+0xab/0xb0 [33946.664415] [] bus_for_each_dev+0x55/0x90 [33946.664422] [] driver_attach+0x1e/0x20 [33946.664429] [] bus_add_driver+0x1b0/0x2a0 [33946.664437] [] driver_register+0x77/0x160 [33946.664445] [] __pci_register_driver+0x64/0x70 [33946.664452] [] drm_pci_init+0x10c/0x120 [33946.664480] [] inet6_ioctl+0x7/0xb0 [ipv6] [33946.664491] [] do_one_initcall+0x122/0x170 [33946.664500] [] load_module+0x185f/0x2160 [33946.664507] [] sys_init_module+0xae/0x110 [33946.664516] [] system_call_fastpath+0x16/0x1b [33946.664526] [33946.664526] -> #0 ((fb_notifier_list).rwsem){++++.+}: [33946.664534] [] __lock_acquire+0x1ae8/0x1b10 [33946.664542] [] lock_acquire+0x8a/0x140 [33946.664549] [] down_read+0x34/0x49 [33946.664557] [] __blocking_notifier_call_chain+0x33/0x60 [33946.664564] [] blocking_notifier_call_chain+0x16/0x20 [33946.664572] [] fb_notifier_call_chain+0x1b/0x20 [33946.664579] [] fb_blank+0x3b/0xc0 [33946.664586] [] fbcon_blank+0x223/0x2d0 [33946.664595] [] do_blank_screen+0x1cb/0x270 [33946.664603] [] console_callback+0x6a/0x160 [33946.664612] [] process_one_work+0x19d/0x5e0 [33946.664620] [] worker_thread+0x15d/0x450 [33946.664628] [] kthread+0xea/0xf0 [33946.664636] [] ret_from_fork+0x7c/0xb0 [33946.664638] [33946.664638] other info that might help us debug this: [33946.664638] [33946.664641] Possible unsafe locking scenario: [33946.664641] [33946.664643] CPU0 CPU1 [33946.664645] ---- ---- [33946.664650] lock(console_lock); [33946.664656] lock((fb_notifier_list).rwsem); [33946.664661] lock(console_lock); [33946.664666] lock((fb_notifier_list).rwsem); [33946.664667] [33946.664667] *** DEADLOCK *** [33946.664667] [33946.664671] 3 locks held by kworker/1:2/15780: [33946.664686] #0: (events){.+.+.+}, at: [] process_one_work+0x130/0x5e0 [33946.664701] #1: (console_work){+.+.+.}, at: [] process_one_work+0x130/0x5e0 [33946.664715] #2: (console_lock){+.+.+.}, at: [] console_callback+0x13/0x160 [33946.664717] [33946.664717] stack backtrace: [33946.664723] Pid: 15780, comm: kworker/1:2 Not tainted 3.8.0-rc1+ #1 [33946.664726] Call Trace: [33946.664736] [] print_circular_bug+0x1fe/0x20f [33946.664745] [] __lock_acquire+0x1ae8/0x1b10 [33946.664756] [] ? print_context_stack+0x87/0xf0 [33946.664766] [] lock_acquire+0x8a/0x140 [33946.664773] [] ? __blocking_notifier_call_chain+0x33/0x60 [33946.664781] [] down_read+0x34/0x49 [33946.664788] [] ? __blocking_notifier_call_chain+0x33/0x60 [33946.664796] [] ? __lock_acquire+0x1218/0x1b10 [33946.664803] [] __blocking_notifier_call_chain+0x33/0x60 [33946.664811] [] blocking_notifier_call_chain+0x16/0x20 [33946.664819] [] fb_notifier_call_chain+0x1b/0x20 [33946.664826] [] fb_blank+0x3b/0xc0 [33946.664833] [] fbcon_blank+0x223/0x2d0 [33946.664841] [] ? _raw_spin_unlock_irqrestore+0x65/0x80 [33946.664848] [] ? get_parent_ip+0x11/0x50 [33946.664855] [] ? sub_preempt_count+0x79/0xd0 [33946.664862] [] ? _raw_spin_unlock_irqrestore+0x42/0x80 [33946.664872] [] ? try_to_del_timer_sync+0x4f/0x70 [33946.664880] [] ? del_timer_sync+0xaa/0xd0 [33946.664888] [] ? del_timer_sync+0x5/0xd0 [33946.664896] [] do_blank_screen+0x1cb/0x270 [33946.664905] [] console_callback+0x6a/0x160 [33946.664913] [] process_one_work+0x19d/0x5e0 [33946.664921] [] ? process_one_work+0x130/0x5e0 [33946.664927] [] ? _raw_spin_lock_irq+0x17/0x50 [33946.664935] [] ? poke_blanked_console+0xd0/0xd0 [33946.664945] [] worker_thread+0x15d/0x450 [33946.664954] [] ? busy_worker_rebind_fn+0x100/0x100 [33946.664961] [] kthread+0xea/0xf0 [33946.664972] [] ? kthread_create_on_node+0x160/0x160 [33946.664979] [] ret_from_fork+0x7c/0xb0 [33946.664987] [] ? kthread_create_on_node+0x160/0x160 -- Regards/Gruss, Boris.