fbdev: fix info->lock deadlock in fbcon_event_notify()
commita30c3616547f64cb4d2de780dc8854202a5e8355
authorAndrea Righi <righi.andrea@gmail.com>
Mon, 13 Apr 2009 21:39:39 +0000 (13 14:39 -0700)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:51 +0000 (27 10:36 -0700)
tree55d46ef70767d5bc41393e104682fb84fdb0e9c2
parentdd3fa60c0e31f16c372799a1c3313b3247921987
fbdev: fix info->lock deadlock in fbcon_event_notify()

upstream commit: 513adb58685615b0b1d47a3f0d40f5352beff189

fb_notifier_call_chain() is called with info->lock held, i.e.  in
do_fb_ioctl() => FBIOPUT_VSCREENINFO => fb_set_var() and the some
notifier callbacks, like fbcon_event_notify(), try to re-acquire
info->lock again.

Remove the lock/unlock_fb_info() in all the framebuffer notifier
callbacks' and be sure to always call fb_notifier_call_chain() with
info->lock held.

[fixes hang caused by 66c1ca01]

Reported-by: Pavel Roskin <proski@gnu.org>
Reported-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/video/backlight/backlight.c
drivers/video/backlight/lcd.c
drivers/video/console/fbcon.c
drivers/video/fbmem.c