Thread (7 messages) 7 messages, 2 authors, 2022-10-27

Re: [PATCH printk v2 38/38] printk, xen: fbfront: create/use safe function for forcing preferred

From: Petr Mladek <pmladek@suse.com>
Date: 2022-10-27 14:27:44
Also in: dri-devel, lkml

On Thu 2022-10-27 15:41:23, John Ogness wrote:
On 2022-10-27, Petr Mladek [off-list ref] wrote:
quoted
quoted
-	if (c) {
-		unregister_console(c);
-		c->flags |= CON_CONSDEV;
-		c->flags &= ~CON_PRINTBUFFER; /* don't print again */
-		register_console(c);
-	}
+	if (c)
+		console_force_preferred(c);
I would prefer to fix this a clean way.

[...]

I would suggest to implement:

[...]

It is a more code. But it is race-free. Also it is much more clear
what is going on.

How does this sound, please?
I wasn't sure if any of the other preferred-console magic in
register_console() was needed, which is why I kept a full
register_console() call. But if it really is just about forcing it the
head and setting a new CON_CONSDEV, then your suggestion is much
simpler. Thanks.
I believe that it is just this. I have spent a lot of time
investigating these hacks when thinking about refactoring
of register_console().

Best Regards,
Petr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help