From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757079Ab3AOOZW (ORCPT ); Tue, 15 Jan 2013 09:25:22 -0500 Received: from cantor2.suse.de ([195.135.220.15]:54859 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756699Ab3AOOZT (ORCPT ); Tue, 15 Jan 2013 09:25:19 -0500 Date: Tue, 15 Jan 2013 15:25:18 +0100 Message-ID: From: Takashi Iwai To: sedat.dilek@gmail.com Cc: Jiri Kosina , linux-fbdev@vger.kernel.org, LKML , alan@lxorguk.ukuu.org.uk, Andrew Morton Subject: Re: 3.8-rc2 lockdep complains about console_lock vs. fb_notifier_list.rwsem In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Sat, 5 Jan 2013 13:13:27 +0100, Sedat Dilek wrote: > > Hi Jiri, > > ...known issue (see thread in [1]), please feel free to test patches > from Alan and Andrew (see [1], [2] and [3]) and report. > > Regards, > - Sedat - > > [1] http://marc.info/?t=135309396400003&r=1&w=2 > [2] http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover.patch > [3] http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover-fix.patch > [4] http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover-fix-2.patch I've hit this bug and tried the patch [2] ([3] and [4] are gone). Unfortunately the deadlock is still reported, as seen below. A similar fix for fbcon_unbind(), splitting an unlocked version of unbind_con_driver() and call it? (BTW, the patch [2] contains strange characters in the comments, and has a few coding issues easily detected by checkpatch.pl.) thanks, Takashi === [ 3.228454] [drm] Initialized drm 1.1.0 20060810 [ 3.317144] [drm] radeon defaulting to kernel modesetting. [ 3.330546] [drm] radeon kernel modesetting enabled. [ 3.343942] checking generic (c0000000 1000000) vs hw (c0000000 10000000) [ 3.343946] fb: conflicting fb hw usage radeondrmfb vs VESA VGA - removing generic driver [ 3.357376] [ 3.357377] ====================================================== [ 3.357378] [ INFO: possible circular locking dependency detected ] [ 3.357380] 3.8.0-rc3-test+ #82 Not tainted [ 3.357381] ------------------------------------------------------- [ 3.357383] udevd/137 is trying to acquire lock: [ 3.357394] (console_lock){+.+.+.}, at: [] unbind_con_driver+0x3f/0x200 [ 3.357395] [ 3.357395] but task is already holding lock: [ 3.357402] ((fb_notifier_list).rwsem){.+.+.+}, at: [] __blocking_notifier_call_chain+0x51/0xc0 [ 3.357403] [ 3.357403] which lock already depends on the new lock. [ 3.357403] [ 3.357404] [ 3.357404] the existing dependency chain (in reverse order) is: [ 3.357407] [ 3.357407] -> #1 ((fb_notifier_list).rwsem){.+.+.+}: [ 3.357411] [] lock_acquire+0xaa/0x210 [ 3.357417] [] down_read+0x42/0x57 [ 3.357419] [] __blocking_notifier_call_chain+0x51/0xc0 [ 3.357422] [] blocking_notifier_call_chain+0x11/0x20 [ 3.357426] [] fb_notifier_call_chain+0x16/0x20 [ 3.357428] [] register_framebuffer+0x1c2/0x2f0 [ 3.357433] [] vesafb_probe+0x6e0/0x760 [ 3.357437] [] platform_drv_probe+0x3e/0x70 [ 3.357440] [] driver_probe_device+0x86/0x390 [ 3.357442] [] __driver_attach+0xa3/0xb0 [ 3.357445] [] bus_for_each_dev+0x4d/0x90 [ 3.357447] [] driver_attach+0x19/0x20 [ 3.357450] [] bus_add_driver+0x1a8/0x290 [ 3.357452] [] driver_register+0x72/0x170 [ 3.357455] [] platform_driver_register+0x41/0x50 [ 3.357458] [] platform_driver_probe+0x16/0xa0 [ 3.357460] [] vesafb_init+0x215/0x258 [ 3.357464] [] do_one_initcall+0x122/0x180 [ 3.357468] [] kernel_init+0x1fc/0x370 [ 3.357471] [] ret_from_fork+0x7c/0xb0 [ 3.357474] [ 3.357474] -> #0 (console_lock){+.+.+.}: [ 3.357476] [] __lock_acquire+0x1385/0x1cc0 [ 3.357478] [] lock_acquire+0xaa/0x210 [ 3.357482] [] console_lock+0x6f/0x80 [ 3.357485] [] unbind_con_driver+0x3f/0x200 [ 3.357489] [] fbcon_event_notify+0x447/0x8b0 [ 3.357492] [] notifier_call_chain+0x55/0x110 [ 3.357495] [] __blocking_notifier_call_chain+0x67/0xc0 [ 3.357497] [] blocking_notifier_call_chain+0x11/0x20 [ 3.357500] [] fb_notifier_call_chain+0x16/0x20 [ 3.357502] [] do_unregister_framebuffer+0x5b/0x110 [ 3.357505] [] do_remove_conflicting_framebuffers+0x158/0x190 [ 3.357507] [] remove_conflicting_framebuffers+0x3a/0x60 [ 3.357532] [] radeon_pci_probe+0x8b/0xd0 [radeon] [ 3.357536] [] local_pci_probe+0x46/0x80 [ 3.357539] [] pci_device_probe+0x101/0x110 [ 3.357542] [] driver_probe_device+0x86/0x390 [ 3.357544] [] __driver_attach+0xa3/0xb0 [ 3.357547] [] bus_for_each_dev+0x4d/0x90 [ 3.357549] [] driver_attach+0x19/0x20 [ 3.357552] [] bus_add_driver+0x1a8/0x290 [ 3.357554] [] driver_register+0x72/0x170 [ 3.357557] [] __pci_register_driver+0x5f/0x70 [ 3.357577] [] drm_pci_init+0x11a/0x130 [drm] [ 3.357594] [] radeon_init+0xec/0x1000 [radeon] [ 3.357597] [] do_one_initcall+0x122/0x180 [ 3.357600] [] load_module+0x1043/0x1510 [ 3.357603] [] sys_init_module+0xd7/0x120 [ 3.357605] [] system_call_fastpath+0x1a/0x1f [ 3.357606] [ 3.357606] other info that might help us debug this: [ 3.357606] [ 3.357607] Possible unsafe locking scenario: [ 3.357607] [ 3.357608] CPU0 CPU1 [ 3.357609] ---- ---- [ 3.357611] lock((fb_notifier_list).rwsem); [ 3.357613] lock(console_lock); [ 3.357615] lock((fb_notifier_list).rwsem); [ 3.357616] lock(console_lock); [ 3.357617] [ 3.357617] *** DEADLOCK *** [ 3.357617] [ 3.357619] 5 locks held by udevd/137: [ 3.357624] #0: (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x53/0xb0 [ 3.357628] #1: (&__lockdep_no_validate__){......}, at: [] __driver_attach+0x61/0xb0 [ 3.357633] #2: (registration_lock){+.+.+.}, at: [] remove_conflicting_framebuffers+0x2b/0x60 [ 3.357637] #3: (&fb_info->lock){+.+.+.}, at: [] lock_fb_info+0x21/0x60 [ 3.357642] #4: ((fb_notifier_list).rwsem){.+.+.+}, at: [] __blocking_notifier_call_chain+0x51/0xc0 [ 3.357643] [ 3.357643] stack backtrace: [ 3.357645] Pid: 137, comm: udevd Not tainted 3.8.0-rc3-test+ #82 [ 3.357646] Call Trace: [ 3.357652] [] print_circular_bug+0x1fb/0x20c [ 3.357655] [] __lock_acquire+0x1385/0x1cc0 [ 3.357658] [] lock_acquire+0xaa/0x210 [ 3.357661] [] ? unbind_con_driver+0x3f/0x200 [ 3.357664] [] ? trace_hardirqs_on+0xd/0x10 [ 3.357667] [] console_lock+0x6f/0x80 [ 3.357670] [] ? unbind_con_driver+0x3f/0x200 [ 3.357673] [] unbind_con_driver+0x3f/0x200 [ 3.357676] [] ? trace_hardirqs_on_thunk+0x3a/0x3f [ 3.357680] [] fbcon_event_notify+0x447/0x8b0 [ 3.357683] [] notifier_call_chain+0x55/0x110 [ 3.357685] [] __blocking_notifier_call_chain+0x67/0xc0 [ 3.357688] [] blocking_notifier_call_chain+0x11/0x20 [ 3.357690] [] fb_notifier_call_chain+0x16/0x20 [ 3.357693] [] do_unregister_framebuffer+0x5b/0x110 [ 3.357696] [] do_remove_conflicting_framebuffers+0x158/0x190 [ 3.357698] [] remove_conflicting_framebuffers+0x3a/0x60 [ 3.357717] [] radeon_pci_probe+0x8b/0xd0 [radeon] [ 3.357721] [] local_pci_probe+0x46/0x80 [ 3.357724] [] pci_device_probe+0x101/0x110 [ 3.357727] [] driver_probe_device+0x86/0x390 [ 3.357729] [] __driver_attach+0xa3/0xb0 [ 3.357732] [] ? driver_probe_device+0x390/0x390 [ 3.357734] [] bus_for_each_dev+0x4d/0x90 [ 3.357737] [] driver_attach+0x19/0x20 [ 3.357740] [] bus_add_driver+0x1a8/0x290 [ 3.357744] [] ? 0xffffffffa01c1fff [ 3.357747] [] driver_register+0x72/0x170 [ 3.357749] [] ? 0xffffffffa01c1fff [ 3.357752] [] __pci_register_driver+0x5f/0x70 [ 3.357762] [] drm_pci_init+0x11a/0x130 [drm] [ 3.357764] [] ? 0xffffffffa01c1fff [ 3.357767] [] ? 0xffffffffa01c1fff [ 3.357784] [] radeon_init+0xec/0x1000 [radeon] [ 3.357786] [] do_one_initcall+0x122/0x180 [ 3.357789] [] load_module+0x1043/0x1510 [ 3.357792] [] ? ddebug_proc_open+0xb0/0xb0 [ 3.357796] [] sys_init_module+0xd7/0x120 [ 3.357798] [] system_call_fastpath+0x1a/0x1f