From: Hans de Goede <hdegoede@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Cc: Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] console: Replace #if 1 with a bool to ignore WARN_CONSOLE_UNLOCKED()
Date: Wed, 11 Jul 2018 21:38:12 +0200 [thread overview]
Message-ID: <46a85cd5-944c-138d-2c73-dae5b9851e24@redhat.com> (raw)
In-Reply-To: <20180711151755.613eba3c@gandalf.local.home>
Hi,
On 11-07-18 21:17, Steven Rostedt wrote:
>
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> There's been discussion on the fb list about the addition of
> WARN_CONSOLE_UNLOCKED() inside the fb code. The complaint is that when
> the fb module is loaded with lockless_register_fb the console lock is
> not taken for debugging reasons. With the addition of
> WARN_CONSOLE_UNLOCK() within the fb code, this causes the console to
> fill up with warnings when trying to debug the fb driver.
>
> There's also a #if 1 that enables the warning which was added before
> git history, and we look down on constant #if's in the kernel nowadays
> anyway.
>
> Remove the #if 1 and add a ignore_console_lock_warning boolean that can
> be set by drivers to ignore the warning in order to do debugging.
>
> Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a25696b5@suse.de
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Based on the fbdev discussion this seems a good idea to me
and codewise this looks good to:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> diff --git a/include/linux/console.h b/include/linux/console.h
> index dfd6b0e97855..9d4a6b985154 100644
> --- a/include/linux/console.h
> +++ b/include/linux/console.h
> @@ -200,11 +200,9 @@ void vcs_make_sysfs(int index);
> void vcs_remove_sysfs(int index);
>
> /* Some debug stub to catch some of the obvious races in the VT code */
> -#if 1
> -#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress)
> -#else
> -#define WARN_CONSOLE_UNLOCKED()
> -#endif
> +extern bool ignore_console_lock_warning;
> +#define WARN_CONSOLE_UNLOCKED() \
> + WARN_ON(!ignore_console_lock_warning && !is_console_locked() && !oops_in_progress)
>
> /* VESA Blanking Levels */
> #define VESA_NO_BLANKING 0
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 247808333ba4..d9056efc3739 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -66,6 +66,9 @@ int console_printk[4] = {
> CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */
> };
>
> +bool ignore_console_lock_warning __read_mostly;
> +EXPORT_SYMBOL(ignore_console_lock_warning);
> +
> /*
> * Low level drivers may need that to know if they can schedule in
> * their unblank() callback or not. So let's export it.
>
next prev parent reply other threads:[~2018-07-11 19:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 19:17 Steven Rostedt
2018-07-11 19:38 ` Hans de Goede [this message]
2018-07-12 1:58 ` Sergey Senozhatsky
2018-07-12 3:09 ` Steven Rostedt
2018-07-12 4:25 ` Sergey Senozhatsky
2018-07-12 7:53 ` Petr Mladek
2018-07-12 8:09 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46a85cd5-944c-138d-2c73-dae5b9851e24@redhat.com \
--to=hdegoede@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=b.zolnierkie@samsung.com \
--cc=daniel@ffwll.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®