]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 31 Jul 2018 11:06:58 +0000 (13:06 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tue, 31 Jul 2018 11:06:58 +0000 (13:06 +0200)
If the console is unlocked during registration, the console subsystem
generates significant amounts of warnings, which obfuscate actual
debugging messages. Setting ignore_console_lock_warning while debugging
console registration avoid the noise.

v3:
- manipulate ignore_console_lock_warning with atomic_{inc,dec}
v2:
- restore ignore_console_lock_warning if lock_fb_info() fails

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/core/fbmem.c

index 528dd0a89aff990e77f79a4b8468768a3cc830dc..20405421a5ed07c398036fbf3110eea18f61e2e6 100644 (file)
@@ -1690,17 +1690,22 @@ static int do_register_framebuffer(struct fb_info *fb_info)
        event.info = fb_info;
        if (!lockless_register_fb)
                console_lock();
+       else
+               atomic_inc(&ignore_console_lock_warning);
        if (!lock_fb_info(fb_info)) {
-               if (!lockless_register_fb)
-                       console_unlock();
-               return -ENODEV;
+               ret = -ENODEV;
+               goto unlock_console;
        }
+       ret = 0;
 
        fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
        unlock_fb_info(fb_info);
+unlock_console:
        if (!lockless_register_fb)
                console_unlock();
-       return 0;
+       else
+               atomic_dec(&ignore_console_lock_warning);
+       return ret;
 }
 
 static int unbind_console(struct fb_info *fb_info)