* [PATCH v2] console: Replace #if 1 with a bool to ignore
@ 2018-07-12 13:29 ` Steven Rostedt
2018-07-12 13:30 ` Steven Rostedt
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Steven Rostedt @ 2018-07-12 13:29 UTC (permalink / raw)
To: LKML
Cc: Petr Mladek, Sergey Senozhatsky, Hans de Goede, Daniel Vetter,
Thomas Zimmermann, Bartlomiej Zolnierkiewicz, Andrew Morton,
Sergey Senozhatsky, dri-devel, Linux Fbdev development list
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
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Changes since V1:
- Added comment to describe ignore_console_unlock_waring variable
- Abide by 80 character limit
Index: linux-trace.git/include/linux/console.h
===================================================================
--- linux-trace.git.orig/include/linux/console.h
+++ linux-trace.git/include/linux/console.h
@@ -200,11 +200,14 @@ 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
+#define WARN_CONSOLE_UNLOCKED() \
+ WARN_ON(!ignore_console_lock_warning && \
+ !is_console_locked() && !oops_in_progress)
+/*
+ * Set ignore_console_lock_warning to true if you need to quiet
+ * WARN_CONSOLE_UNLOCKED() for debugging purposes.
+ */
+extern bool ignore_console_lock_warning;
/* VESA Blanking Levels */
#define VESA_NO_BLANKING 0
Index: linux-trace.git/kernel/printk/printk.c
===================================================================
--- linux-trace.git.orig/kernel/printk/printk.c
+++ linux-trace.git/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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] console: Replace #if 1 with a bool to ignore
2018-07-12 13:29 ` [PATCH v2] console: Replace #if 1 with a bool to ignore Steven Rostedt
@ 2018-07-12 13:30 ` Steven Rostedt
2018-07-12 13:43 ` Petr Mladek
2018-07-18 8:15 ` Thomas Zimmermann
2018-07-24 16:13 ` Bartlomiej Zolnierkiewicz
2 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2018-07-12 13:30 UTC (permalink / raw)
To: LKML
Cc: Petr Mladek, Sergey Senozhatsky, Hans de Goede, Daniel Vetter,
Thomas Zimmermann, Bartlomiej Zolnierkiewicz, Andrew Morton,
Sergey Senozhatsky, dri-devel, Linux Fbdev development list
On Thu, 12 Jul 2018 09:29:38 -0400
Steven Rostedt <rostedt@goodmis.org> 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
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Petr,
If you want this to go by way of fbdev tree, then can you Ack it?
-- Steve
> ---
> Changes since V1:
> - Added comment to describe ignore_console_unlock_waring variable
> - Abide by 80 character limit
>
> Index: linux-trace.git/include/linux/console.h
> ===================================================================
> --- linux-trace.git.orig/include/linux/console.h
> +++ linux-trace.git/include/linux/console.h
> @@ -200,11 +200,14 @@ 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
> +#define WARN_CONSOLE_UNLOCKED() \
> + WARN_ON(!ignore_console_lock_warning && \
> + !is_console_locked() && !oops_in_progress)
> +/*
> + * Set ignore_console_lock_warning to true if you need to quiet
> + * WARN_CONSOLE_UNLOCKED() for debugging purposes.
> + */
> +extern bool ignore_console_lock_warning;
>
> /* VESA Blanking Levels */
> #define VESA_NO_BLANKING 0
> Index: linux-trace.git/kernel/printk/printk.c
> ===================================================================
> --- linux-trace.git.orig/kernel/printk/printk.c
> +++ linux-trace.git/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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] console: Replace #if 1 with a bool to ignore
2018-07-12 13:30 ` Steven Rostedt
@ 2018-07-12 13:43 ` Petr Mladek
0 siblings, 0 replies; 6+ messages in thread
From: Petr Mladek @ 2018-07-12 13:43 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Sergey Senozhatsky, Hans de Goede, Daniel Vetter,
Thomas Zimmermann, Bartlomiej Zolnierkiewicz, Andrew Morton,
Sergey Senozhatsky, dri-devel, Linux Fbdev development list
On Thu 2018-07-12 09:30:49, Steven Rostedt wrote:
> On Thu, 12 Jul 2018 09:29:38 -0400
> Steven Rostedt <rostedt@goodmis.org> 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
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> Petr,
>
> If you want this to go by way of fbdev tree, then can you Ack it?
Sure.
Acked-by: Petr Mladek <pmladek@suse.com>
I assume that it will go via fbdev tree with the other changes
unless I hear otherwise.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] console: Replace #if 1 with a bool to ignore
2018-07-12 13:29 ` [PATCH v2] console: Replace #if 1 with a bool to ignore Steven Rostedt
2018-07-12 13:30 ` Steven Rostedt
@ 2018-07-18 8:15 ` Thomas Zimmermann
2018-07-24 16:13 ` Bartlomiej Zolnierkiewicz
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2018-07-18 8:15 UTC (permalink / raw)
To: Steven Rostedt, LKML
Cc: Petr Mladek, Linux Fbdev development list, Sergey Senozhatsky,
Bartlomiej Zolnierkiewicz, dri-devel, Hans de Goede,
Andrew Morton, Sergey Senozhatsky
[-- Attachment #1.1: Type: text/plain, Size: 3292 bytes --]
Am 12.07.2018 um 15:29 schrieb Steven Rostedt:
>
> 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
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> Changes since V1:
> - Added comment to describe ignore_console_unlock_waring variable
> - Abide by 80 character limit
>
> Index: linux-trace.git/include/linux/console.h
> ===================================================================
> --- linux-trace.git.orig/include/linux/console.h
> +++ linux-trace.git/include/linux/console.h
> @@ -200,11 +200,14 @@ 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
> +#define WARN_CONSOLE_UNLOCKED() \
> + WARN_ON(!ignore_console_lock_warning && \
> + !is_console_locked() && !oops_in_progress)
> +/*
> + * Set ignore_console_lock_warning to true if you need to quiet
> + * WARN_CONSOLE_UNLOCKED() for debugging purposes.
> + */
> +extern bool ignore_console_lock_warning;
>
> /* VESA Blanking Levels */
> #define VESA_NO_BLANKING 0
> Index: linux-trace.git/kernel/printk/printk.c
> ===================================================================
> --- linux-trace.git.orig/kernel/printk/printk.c
> +++ linux-trace.git/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.
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
This resolves the problem for me.
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755; https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] console: Replace #if 1 with a bool to ignore
2018-07-12 13:29 ` [PATCH v2] console: Replace #if 1 with a bool to ignore Steven Rostedt
2018-07-12 13:30 ` Steven Rostedt
2018-07-18 8:15 ` Thomas Zimmermann
@ 2018-07-24 16:13 ` Bartlomiej Zolnierkiewicz
2018-07-24 16:18 ` Bartlomiej Zolnierkiewicz
2 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-07-24 16:13 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Petr Mladek, Sergey Senozhatsky, Hans de Goede,
Daniel Vetter, Thomas Zimmermann, Andrew Morton,
Sergey Senozhatsky, dri-devel, Linux Fbdev development list
On Thursday, July 12, 2018 09:29:38 AM 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
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Patch queued for 4.19, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] console: Replace #if 1 with a bool to ignore
2018-07-24 16:13 ` Bartlomiej Zolnierkiewicz
@ 2018-07-24 16:18 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-07-24 16:18 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Petr Mladek, Sergey Senozhatsky, Hans de Goede,
Daniel Vetter, Thomas Zimmermann, Andrew Morton,
Sergey Senozhatsky, dri-devel, Linux Fbdev development list
On Tuesday, July 24, 2018 06:13:19 PM Bartlomiej Zolnierkiewicz wrote:
> On Thursday, July 12, 2018 09:29:38 AM 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
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> Patch queued for 4.19, thanks.
Dequeued, I've just noticed a newer patch from Thomas for this issue
(I plan to apply it later this week).
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-07-24 16:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20180712132944epcas4p3091e1c7a7aa1bd4da95750908012e616@epcas4p3.samsung.com>
2018-07-12 13:29 ` [PATCH v2] console: Replace #if 1 with a bool to ignore Steven Rostedt
2018-07-12 13:30 ` Steven Rostedt
2018-07-12 13:43 ` Petr Mladek
2018-07-18 8:15 ` Thomas Zimmermann
2018-07-24 16:13 ` Bartlomiej Zolnierkiewicz
2018-07-24 16:18 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).