summaryrefslogtreecommitdiff
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2013-01-25 10:28:15 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-28 06:59:05 -0800
commitc30b55c385288be48f7accd16a6929ad4d983311 (patch)
tree1588731963ecab2c47c3999d7691a095ab591d0e /drivers/video/fbmem.c
parent62a3dcc78d04dcd84276eaa7a40dec1066054532 (diff)
downloadlinux-3.10-c30b55c385288be48f7accd16a6929ad4d983311.tar.gz
linux-3.10-c30b55c385288be48f7accd16a6929ad4d983311.tar.bz2
linux-3.10-c30b55c385288be48f7accd16a6929ad4d983311.zip
fb: rework locking to fix lock ordering on takeover
commit 50e244cc793d511b86adea24972f3a7264cae114 upstream. Adjust the console layer to allow a take over call where the caller already holds the locks. Make the fb layer lock in order. This is partly a band aid, the fb layer is terminally confused about the locking rules it uses for its notifiers it seems. [akpm@linux-foundation.org: remove stray non-ascii char, tidy comment] [akpm@linux-foundation.org: export do_take_over_console()] [airlied: cleanup another non-ascii char] Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Jiri Kosina <jkosina@suse.cz> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index c6ce416ab58..f04ccf7d86e 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1642,7 +1642,9 @@ static int do_register_framebuffer(struct fb_info *fb_info)
event.info = fb_info;
if (!lock_fb_info(fb_info))
return -ENODEV;
+ console_lock();
fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
+ console_unlock();
unlock_fb_info(fb_info);
return 0;
}
@@ -1845,11 +1847,8 @@ int fb_new_modelist(struct fb_info *info)
err = 1;
if (!list_empty(&info->modelist)) {
- if (!lock_fb_info(info))
- return -ENODEV;
event.info = info;
err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
- unlock_fb_info(info);
}
return err;