Re: Linus GIT 3.8.0-rc5: INFO: possible circular locking dependency detected -- ((fb_notifier_list).rwsem){.+.+.+}, at: [] __blocking_notifier_call_chain+0x49/0x80

2013-01-28 Thread Daniel Vetter
Hi Miles,

Dave Airlie has some patches in the works which should fix this all, see

http://cgit.freedesktop.org/~airlied/linux/log/?h=fbcon-locking-fixes

Patches hopefully land in 3.9, they're too risky (meaning, they've
caused deadlocks) for 3.8.

Cheers, Daniel

On Mon, Jan 28, 2013 at 7:38 AM, Miles Lane  wrote:
> Hi Daniel,
> At the bottom of this message you will find dmesg output showing this
> problem from the current Linus GIT tree.
> Here is the test of the message you wrote about this
> (http://marc.info/?l=dri-devel=135905755124554=2):
> --
> Patches for the know issues around console_lock vs fbdev_notifier are in -mm:
>
> http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover.patch
> http://ozlabs.org/~akpm/mmots/broken-out/fb-yet-another-band-aid-for-fixing-lockdep-mess.patch
>
> Unfortunately the patches seem to be stuck there for now despite quite
> a few reports about this (including seemingly relevant background
> noise about hangs in distro bugzillas).
> -Daniel
> --
>
> [  489.832113] [ INFO: possible circular locking dependency detected ]
> [  489.832115] 3.8.0-rc5 #99 Not tainted
> [  489.832116] ---
> [  489.832117] 99video/4306 is trying to acquire lock:
> [  489.832129]  ((fb_notifier_list).rwsem){.+.+.+}, at:
> [] __blocking_notifier_call_chain+0x49/0x80
> [  489.832130]
> [  489.832130] but task is already holding lock:
> [  489.832136]  (console_lock){+.+.+.}, at: []
> store_fbstate+0x43/0x71
> [  489.832137]
> [  489.832137] which lock already depends on the new lock.
> [  489.832137]
> [  489.832138]
> [  489.832138] the existing dependency chain (in reverse order) is:
> [  489.832141]
> [  489.832141] -> #1 (console_lock){+.+.+.}:
> [  489.832146][] lock_acquire+0xfe/0x14d
> [  489.832150][] console_lock+0x64/0x66
> [  489.832154][] register_con_driver+0x33/0x123
> [  489.832158][] take_over_console+0x21/0x266
> [  489.832161][] fbcon_takeover+0x56/0x98
> [  489.832165][] fbcon_event_notify+0x3b6/0x6e4
> [  489.832169][] notifier_call_chain+0x8c/0xc0
> [  489.832173][]
> __blocking_notifier_call_chain+0x5f/0x80
> [  489.832176][] 
> blocking_notifier_call_chain+0xf/0x11
> [  489.832181][] fb_notifier_call_chain+0x16/0x18
> [  489.832184][] register_framebuffer+0x216/0x27a
> [  489.832189][] vesafb_probe+0x6df/0x75f
> [  489.832193][] platform_drv_probe+0x34/0x5e
> [  489.832196][] driver_probe_device+0x90/0x19b
> [  489.832199][] __driver_attach+0x4e/0x6f
> [  489.832202][] bus_for_each_dev+0x52/0x85
> [  489.832205][] driver_attach+0x19/0x1b
> [  489.832208][] bus_add_driver+0xf7/0x21a
> [  489.832211][] driver_register+0x8c/0x110
> [  489.832214][] platform_driver_register+0x41/0x43
> [  489.832217][] platform_driver_probe+0x18/0x8a
> [  489.832220][] vesafb_init+0x215/0x258
> [  489.832224][] do_one_initcall+0x7a/0x130
> [  489.832228][] kernel_init_freeable+0x109/0x191
> [  489.832233][] kernel_init+0x9/0xd1
> [  489.832236][] ret_from_fork+0x7c/0xb0
> [  489.832240]
> [  489.832240] -> #0 ((fb_notifier_list).rwsem){.+.+.+}:
> [  489.832242][] __lock_acquire+0xacc/0xe0c
> [  489.832245][] lock_acquire+0xfe/0x14d
> [  489.832249][] down_read+0x3f/0x4b
> [  489.832253][]
> __blocking_notifier_call_chain+0x49/0x80
> [  489.832257][] 
> blocking_notifier_call_chain+0xf/0x11
> [  489.832260][] fb_notifier_call_chain+0x16/0x18
> [  489.832263][] fb_set_suspend+0x22/0x4b
> [  489.832266][] store_fbstate+0x4e/0x71
> [  489.832270][] dev_attr_store+0x13/0x1f
> [  489.832274][] sysfs_write_file+0xe9/0x121
> [  489.832278][] vfs_write+0x91/0xd0
> [  489.832281][] sys_write+0x5a/0x8b
> [  489.832284][] system_call_fastpath+0x16/0x1b
> [  489.832285]
> [  489.832285] other info that might help us debug this:
> [  489.832285]
> [  489.832286]  Possible unsafe locking scenario:
> [  489.832286]
> [  489.832287]CPU0CPU1
> [  489.832288]
> [  489.832290]   lock(console_lock);
> [  489.832292]lock((fb_notifier_list).rwsem);
> [  489.832294]lock(console_lock);
> [  489.832296]   lock((fb_notifier_list).rwsem);
> [  489.832297]
> [  489.832297]  *** DEADLOCK ***
> [  489.832297]
> [  489.832298] 4 locks held by 99video/4306:
> [  489.832304]  #0:  (>mutex){+.+.+.}, at:
> [] sysfs_write_file+0x37/0x121
> [  489.832310]  #1:  (s_active#204){.+.+.+}, at: []
> sysfs_write_file+0xd1/0x121
> [  489.832315]  #2:  (_info->lock){+.+.+.}, at:
> [] lock_fb_info+0x18/0x37
> [  489.832321]  #3:  (console_lock){+.+.+.}, at: []
> 

Linus GIT 3.8.0-rc5: INFO: possible circular locking dependency detected -- ((fb_notifier_list).rwsem){.+.+.+}, at: [] __blocking_notifier_call_chain+0x49/0x80

2013-01-27 Thread Miles Lane
Hi Daniel,
At the bottom of this message you will find dmesg output showing this
problem from the current Linus GIT tree.
Here is the test of the message you wrote about this
(http://marc.info/?l=dri-devel=135905755124554=2):
--
Patches for the know issues around console_lock vs fbdev_notifier are in -mm:

http://ozlabs.org/~akpm/mmots/broken-out/fb-rework-locking-to-fix-lock-ordering-on-takeover.patch
http://ozlabs.org/~akpm/mmots/broken-out/fb-yet-another-band-aid-for-fixing-lockdep-mess.patch

Unfortunately the patches seem to be stuck there for now despite quite
a few reports about this (including seemingly relevant background
noise about hangs in distro bugzillas).
-Daniel
--

[  489.832113] [ INFO: possible circular locking dependency detected ]
[  489.832115] 3.8.0-rc5 #99 Not tainted
[  489.832116] ---
[  489.832117] 99video/4306 is trying to acquire lock:
[  489.832129]  ((fb_notifier_list).rwsem){.+.+.+}, at:
[] __blocking_notifier_call_chain+0x49/0x80
[  489.832130]
[  489.832130] but task is already holding lock:
[  489.832136]  (console_lock){+.+.+.}, at: []
store_fbstate+0x43/0x71
[  489.832137]
[  489.832137] which lock already depends on the new lock.
[  489.832137]
[  489.832138]
[  489.832138] the existing dependency chain (in reverse order) is:
[  489.832141]
[  489.832141] -> #1 (console_lock){+.+.+.}:
[  489.832146][] lock_acquire+0xfe/0x14d
[  489.832150][] console_lock+0x64/0x66
[  489.832154][] register_con_driver+0x33/0x123
[  489.832158][] take_over_console+0x21/0x266
[  489.832161][] fbcon_takeover+0x56/0x98
[  489.832165][] fbcon_event_notify+0x3b6/0x6e4
[  489.832169][] notifier_call_chain+0x8c/0xc0
[  489.832173][]
__blocking_notifier_call_chain+0x5f/0x80
[  489.832176][] blocking_notifier_call_chain+0xf/0x11
[  489.832181][] fb_notifier_call_chain+0x16/0x18
[  489.832184][] register_framebuffer+0x216/0x27a
[  489.832189][] vesafb_probe+0x6df/0x75f
[  489.832193][] platform_drv_probe+0x34/0x5e
[  489.832196][] driver_probe_device+0x90/0x19b
[  489.832199][] __driver_attach+0x4e/0x6f
[  489.832202][] bus_for_each_dev+0x52/0x85
[  489.832205][] driver_attach+0x19/0x1b
[  489.832208][] bus_add_driver+0xf7/0x21a
[  489.832211][] driver_register+0x8c/0x110
[  489.832214][] platform_driver_register+0x41/0x43
[  489.832217][] platform_driver_probe+0x18/0x8a
[  489.832220][] vesafb_init+0x215/0x258
[  489.832224][] do_one_initcall+0x7a/0x130
[  489.832228][] kernel_init_freeable+0x109/0x191
[  489.832233][] kernel_init+0x9/0xd1
[  489.832236][] ret_from_fork+0x7c/0xb0
[  489.832240]
[  489.832240] -> #0 ((fb_notifier_list).rwsem){.+.+.+}:
[  489.832242][] __lock_acquire+0xacc/0xe0c
[  489.832245][] lock_acquire+0xfe/0x14d
[  489.832249][] down_read+0x3f/0x4b
[  489.832253][]
__blocking_notifier_call_chain+0x49/0x80
[  489.832257][] blocking_notifier_call_chain+0xf/0x11
[  489.832260][] fb_notifier_call_chain+0x16/0x18
[  489.832263][] fb_set_suspend+0x22/0x4b
[  489.832266][] store_fbstate+0x4e/0x71
[  489.832270][] dev_attr_store+0x13/0x1f
[  489.832274][] sysfs_write_file+0xe9/0x121
[  489.832278][] vfs_write+0x91/0xd0
[  489.832281][] sys_write+0x5a/0x8b
[  489.832284][] system_call_fastpath+0x16/0x1b
[  489.832285]
[  489.832285] other info that might help us debug this:
[  489.832285]
[  489.832286]  Possible unsafe locking scenario:
[  489.832286]
[  489.832287]CPU0CPU1
[  489.832288]
[  489.832290]   lock(console_lock);
[  489.832292]lock((fb_notifier_list).rwsem);
[  489.832294]lock(console_lock);
[  489.832296]   lock((fb_notifier_list).rwsem);
[  489.832297]
[  489.832297]  *** DEADLOCK ***
[  489.832297]
[  489.832298] 4 locks held by 99video/4306:
[  489.832304]  #0:  (>mutex){+.+.+.}, at:
[] sysfs_write_file+0x37/0x121
[  489.832310]  #1:  (s_active#204){.+.+.+}, at: []
sysfs_write_file+0xd1/0x121
[  489.832315]  #2:  (_info->lock){+.+.+.}, at:
[] lock_fb_info+0x18/0x37
[  489.832321]  #3:  (console_lock){+.+.+.}, at: []
store_fbstate+0x43/0x71
[  489.832321]
[  489.832321] stack backtrace:
[  489.832324] Pid: 4306, comm: 99video Not tainted 3.8.0-rc5 #99
[  489.832325] Call Trace:
[  489.832330]  [] print_circular_bug+0x1f6/0x204
[  489.832333]  [] __lock_acquire+0xacc/0xe0c
[  489.832337]  [] lock_acquire+0xfe/0x14d
[  489.832341]  [] ? __blocking_notifier_call_chain+0x49/0x80
[  489.832345]  [] down_read+0x3f/0x4b
[  489.832348]  [] ? __blocking_notifier_call_chain+0x49/0x80
[  489.832352]  []