Skip to contentSkip to conversation

fbcon: Silence fbcon logo on 'quiet' boots

PATCH Superseded Prarit Bhargava 6 participants 15 messages Oct 30, 2018 – Jan 15, 2019

Subsystems (4)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 fbcon: Silence fbcon logo on 'quiet' boots

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
---
 drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
 kernel/printk/printk.c           |  1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +8 -5
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
 	if (info_idx = -1 || info = NULL)
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;
 
 	if (var_to_display(p, &info->var, info))
 		return;
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
 	if (vc = svc && softback_buf)
kernel/printk/printk.c +1 -0
index b77150ad1965..391e390feac9 100644
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
Signature · 1 line
2.14.5
#1 lore raw

I guess you we not very productive with that first patch ;-)

-- Steve

Quoted 97 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>

---
drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
kernel/printk/printk.c | 1 +

2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +4 -1
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data
 *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than
 screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
		vc->vc_top = logo_lines;
	}
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
	if (info_idx = -1 || info = NULL)
drivers/video/fbdev/core/fbcon.c +2 -2
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;
 
 	if (var_to_display(p, &info->var, info))
		return;
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
	if (vc = svc && softback_buf)
kernel/printk/printk.c +1 -0
index b77150ad1965..391e390feac9 100644
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity and top posting.
#2 lore raw
In reply to Prarit Bhargava

I guess you we not very productive with that first patch ;-)

-- Steve

Quoted 97 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>

---
drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
kernel/printk/printk.c | 1 +

2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +4 -1
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data
 *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than
 screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
		vc->vc_top = logo_lines;
	}
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
	if (info_idx = -1 || info = NULL)
drivers/video/fbdev/core/fbcon.c +2 -2
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;
 
 	if (var_to_display(p, &info->var, info))
		return;
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
	if (vc = svc && softback_buf)
kernel/printk/printk.c +1 -0
index b77150ad1965..391e390feac9 100644
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity and top posting.
#3 lore raw
Quoted 2 lines · Steven Rostedt

I guess you we not very productive with that first patch ;-)

Hah :) It was a LONG day. :)

P.

Quoted 102 lines

-- Steve

Quoted 97 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>

---
drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
kernel/printk/printk.c | 1 +

2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +4 -1
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data
 *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than
 screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
		vc->vc_top = logo_lines;
	}
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
	if (info_idx = -1 || info = NULL)
drivers/video/fbdev/core/fbcon.c +2 -2
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;
 
 	if (var_to_display(p, &info->var, info))
		return;
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int
 init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
	if (vc = svc && softback_buf)
kernel/printk/printk.c +1 -0
index b77150ad1965..391e390feac9 100644
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
#4 lore raw
In reply to Prarit Bhargava

[ added Petr & Sergey to Cc: ]

Hi,

Quoted 56 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
---
 drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
 kernel/printk/printk.c           |  1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +5 -2
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
 	if (info_idx = -1 || info = NULL)

drivers/video/fbdev/core/fbcon.c static void fbcon_init(struct vc_data *vc, int init) · line 1067

Quoted 8 lines
drivers/video/fbdev/core/fbcon.c +2 -2
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;

"logo" variable removal is an unrelated change which actually changes the code behavior ("logo_shown" will be now modified also for "vc != svc" and "info->fix.type = FB_TYPE_TEXT" cases).

Please either drop it or explain in the patch description why it is a safe thing to do.

Quoted 16 lines
drivers/video/fbdev/core/fbcon.c +1 -1
 	if (var_to_display(p, &info->var, info))
 		return;
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
 	if (vc = svc && softback_buf)
kernel/printk/printk.c +0 -0
index b77150ad1965..391e390feac9 100644

kernel/printk/printk.c int console_printk[4] = { · line 69

Quoted 4 lines
kernel/printk/printk.c +1 -0
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);

You need printk Maintainers Ack on it.

kernel/printk/printk.c int console_printk[4] = { · line 72

Quoted 2 lines
kernel/printk/printk.c +0 -0
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

maintainer
#5 lore raw
Quoted 75 lines · Bartlomiej Zolnierkiewicz

[ added Petr & Sergey to Cc: ]

Hi,

Quoted 56 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
---
 drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
 kernel/printk/printk.c           |  1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +5 -2
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
 	if (info_idx = -1 || info = NULL)

drivers/video/fbdev/core/fbcon.c static void fbcon_init(struct vc_data *vc, int init) · line 1067

Quoted 8 lines
drivers/video/fbdev/core/fbcon.c +2 -2
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;

"logo" variable removal is an unrelated change which actually changes the code behavior ("logo_shown" will be now modified also for "vc != svc" and "info->fix.type = FB_TYPE_TEXT" cases).

Quoted 2 lines

Please either drop it or explain in the patch description why it is a safe thing to do.

Good question! I am not familiar with fbcon code but it seems that there might be more instances and they share the behavior via this variable.

Note that console_loglevel might get modified at anytime. What if the first fbcon was initialized with a different loglevel?

Quoted 10 lines
Quoted 10 lines
drivers/video/fbdev/core/fbcon.c +1 -1
 	if (var_to_display(p, &info->var, info))
 		return;
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
Quoted 12 lines

kernel/printk/printk.c int console_printk[4] = { · line 69

Quoted 10 lines
drivers/video/fbdev/core/fbcon.c +0 -0
 	if (vc = svc && softback_buf)
kernel/printk/printk.c +1 -0
index b77150ad1965..391e390feac9 100644
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);

You need printk Maintainers Ack on it.

I am fine with the added export (as a printk maintainer).

Best Regards,
Petr

#6 lore raw

Hi Petr,

Quoted 38 lines · Petr Mladek
Quoted 27 lines · Bartlomiej Zolnierkiewicz

[ added Petr & Sergey to Cc: ]

Hi,

Quoted 21 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
Quoted 9 lines

kernel/printk/printk.c int console_printk[4] = { · line 69

Quoted 7 lines
kernel/printk/printk.c +1 -0
@@ -66,6 +66,7 @@ int console_printk[4] = {
    CONSOLE_LOGLEVEL_MIN,           /* minimum_console_loglevel */
    CONSOLE_LOGLEVEL_DEFAULT,       /* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);

You need printk Maintainers Ack on it.

Quoted 1 line

I am fine with the added export (as a printk maintainer).

EXPORT_SYMBOL_GPL()?

The file seems to use a strange mix of both...

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#8 lore raw
In reply to Bartlomiej Zolnierkiewicz

On (12/20/18 17:31), Bartlomiej Zolnierkiewicz wrote:
[..]

Quoted 8 lines

kernel/printk/printk.c int console_printk[4] = { · line 69

Quoted 6 lines

+++ b/kernel/printk/printk.c

kernel/printk/printk.c +1 -0
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);

You need printk Maintainers Ack on it.

I would prefer this to be in a separate patch, probably.

Exporting (I think EXPORT_SYMBOL_GPL would be better) console_printk[4] seems to be the simplest solution.

Alternatively, we can have a new fbcon function which would be called from quiet_kernel() and would set logo_shown accordingly.

	-ss
#7 lore raw
In reply to Petr Mladek
Quoted 76 lines · Petr Mladek
Quoted 75 lines · Bartlomiej Zolnierkiewicz

[ added Petr & Sergey to Cc: ]

Hi,

Quoted 56 lines · Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
---
 drivers/video/fbdev/core/fbcon.c | 13 ++++++++-----
 kernel/printk/printk.c           |  1 +
 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/video/fbdev/core/fbcon.c +5 -2
index 8958ccc8b1ac..08e092eaf45c 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
-	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+	int new_rows, new_cols, rows, cols, charcnt = 256;
 	int cap, ret;
 
 	if (info_idx = -1 || info = NULL)

drivers/video/fbdev/core/fbcon.c static void fbcon_init(struct vc_data *vc, int init) · line 1067

Quoted 8 lines
drivers/video/fbdev/core/fbcon.c +2 -2
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
 	    (info->fix.type = FB_TYPE_TEXT))
-		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;

"logo" variable removal is an unrelated change which actually changes the code behavior ("logo_shown" will be now modified also for "vc != svc" and "info->fix.type = FB_TYPE_TEXT" cases).

Quoted 3 lines
Quoted 2 lines

Please either drop it or explain in the patch description why it is a safe thing to do.

Hi Petr, I will drop it from the patch.

P.

Quoted 36 lines

Good question! I am not familiar with fbcon code but it seems that there might be more instances and they share the behavior via this variable.

Note that console_loglevel might get modified at anytime. What if the first fbcon was initialized with a different loglevel?

Quoted 10 lines
Quoted 10 lines
drivers/video/fbdev/core/fbcon.c +1 -1
 	if (var_to_display(p, &info->var, info))
 		return;
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 	} else
 		vc_resize(vc, new_cols, new_rows);
 
-	if (logo)
+	if (logo_shown != FBCON_LOGO_DONTSHOW)
 		fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
Quoted 12 lines

kernel/printk/printk.c int console_printk[4] = { · line 69

Quoted 10 lines
drivers/video/fbdev/core/fbcon.c +0 -0
 	if (vc = svc && softback_buf)
kernel/printk/printk.c +1 -0
index b77150ad1965..391e390feac9 100644
@@ -66,6 +66,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);

You need printk Maintainers Ack on it.

I am fine with the added export (as a printk maintainer).

Best Regards,
Petr

#9 lore raw

v4 cover Do not output logo on quiet boots

In reply to Prarit Bhargava

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk
v4: move console_printk change to separate patch, and drop logo cleanup

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>

Prarit Bhargava (2):
fbcon: Silence fbcon logo on 'quiet' boots
printk: Export console_printk

 drivers/video/fbdev/core/fbcon.c | 11 ++++++++---
 kernel/printk/printk.c           |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.2
#10 lore raw

PATCH v4 1/2 fbcon: Silence fbcon logo on 'quiet' boots

On text-based systems the 'quiet' boot option will show printk levels higher than CONSOLE_LOGLEVEL_QUIET. The displaying of the Tux logo during boot can cause some consoles to lose display data and as a result confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them. Remove extra bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export console_printk
v4: move console_printk change to separate patch, and drop logo cleanup

Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
---
 drivers/video/fbdev/core/fbcon.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/video/fbdev/core/fbcon.c +8 -3
index 8976190b6c1f..66e37bdff1d9 100644
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1059,9 +1062,11 @@ static void fbcon_init(struct vc_data *vc, int init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
-	    (info->fix.type = FB_TYPE_TEXT))
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
+	    (info->fix.type = FB_TYPE_TEXT)) {
 		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;
+	}
 
 	if (var_to_display(p, &info->var, info))
 		return;
Signature · 1 line
2.17.2
#13 lore raw

PATCH v4 2/2 printk: Export console_printk

In reply to Prarit Bhargava

The fbcon code can be built as a module and requires console_printk.

Export console_printk.

Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)
kernel/printk/printk.c +1 -0
index d3d170374ceb..8201019d1fff 100644
@@ -65,6 +65,7 @@ int console_printk[4] = {
 	CONSOLE_LOGLEVEL_MIN,		/* minimum_console_loglevel */
 	CONSOLE_LOGLEVEL_DEFAULT,	/* default_console_loglevel */
 };
+EXPORT_SYMBOL_GPL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
Signature · 1 line
2.17.2
Reviewed-by on v4 2/2
#14 lore raw

Re: [PATCH v4 2/2] printk: Export console_printk

Quoted 4 lines · Prarit Bhargava

The fbcon code can be built as a module and requires console_printk.

Export console_printk.

Quoted 14 lines
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Marko Myllynen <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Kees Cook <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Yisheng Xie <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
	-ss
#11 lore raw
In reply to Prarit Bhargava

drivers/video/fbdev/core/fbcon.c static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, · line 653

Quoted 7 lines · Prarit Bhargava

+++ b/drivers/video/fbdev/core/fbcon.c

drivers/video/fbdev/core/fbcon.c +2 -0
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;

+ if (console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
+ return;

Would this two-liner do the trick?

	-ss
Quoted 27 lines
drivers/video/fbdev/core/fbcon.c +6 -3
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1059,9 +1062,11 @@ static void fbcon_init(struct vc_data *vc, int init)
 
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
-	    (info->fix.type = FB_TYPE_TEXT))
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
+	    (info->fix.type = FB_TYPE_TEXT)) {
 		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;
+	}
 
 	if (var_to_display(p, &info->var, info))
 		return;
Signature · 1 line
2.17.2
maintainer
#12 lore raw
Quoted 12 lines · Sergey Senozhatsky
Quoted 7 lines · Prarit Bhargava

+++ b/drivers/video/fbdev/core/fbcon.c

drivers/video/fbdev/core/fbcon.c +2 -0
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
 		kfree(save);
 	}
 
+	if (logo_shown = FBCON_LOGO_DONTSHOW)
+		return;
(quoted diff) +2 -0
+	if (console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
+		return;
Quoted 1 line

Would this two-liner do the trick?

But then the other functions, like fbcon_scroll() or fbcon_switch(), would think that the logo was shown because logo_shown !FBCON_LOGO_DONTSHOW.

It might be possible to do logo_shown = FBCON_LOGO_DONTSHOW. But I am not sure if it is safe, see below.

Quoted 14 lines
	-ss
Quoted 12 lines
drivers/video/fbdev/core/fbcon.c +2 -1
+
 	if (logo_lines > vc->vc_bottom) {
 		logo_shown = FBCON_LOGO_CANSHOW;
 		printk(KERN_INFO
 		       "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
-	} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+	} else {
 		logo_shown = FBCON_LOGO_DRAW;
 		vc->vc_top = logo_lines;
 	}
@@ -1059,9 +1062,11 @@ static void fbcon_init(struct vc_data *vc, int init)
 
Quoted 8 lines

drivers/video/fbdev/core/fbcon.c static void fbcon_init(struct vc_data *vc, int init) · line 1068

Quoted 8 lines
drivers/video/fbdev/core/fbcon.c +3 -2
 	cap = info->flags;
 
-	if (vc != svc || logo_shown = FBCON_LOGO_DONTSHOW ||
-	    (info->fix.type = FB_TYPE_TEXT))
+	if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
+	    (info->fix.type = FB_TYPE_TEXT)) {
 		logo = 0;
+		logo_shown = FBCON_LOGO_DONTSHOW;

This has still the problem mentioned in the v3 feedback. It modifies the global variable logo_shown even when vc != svc. You still need check and explain why it is safe. It is not clear to me.

Best Regards,
Petr

Quoted 7 lines
Quoted 7 lines
drivers/video/fbdev/core/fbcon.c +1 -0
+	}
 
 	if (var_to_display(p, &info->var, info))
 		return;
Signature · 1 line
2.17.2