From: James S. <jsi...@ac...> - 2000-07-01 13:27:32
|
---------- Forwarded message ---------- Date: Fri, 30 Jun 2000 12:58:47 +0200 From: Benjamin Herrenschmidt <bh...@ca...> To: tor...@tr..., al...@lx... Cc: lin...@vg... Subject: [PATCH] Small kernel/printk.c fix Hi Linus & Alan. Here's a small change to kernel/printk.c that I expect harmless. Basically, it reverts the console registration mecanism to a clean state when the last console is unregistered. It helps implementing a very small early boot debug mecanism I use on the PPC tree that enables very-early use of printk but which, without this patch, cause problems when the real VT takes over. (Since it's a small mecanism, it's implemented as a console structure, implementing a consw would be really way too much for what it's meant for and would bloat the code). I usually keep this patch in my tree, but having it merged would help me reducing the diffs between my own tree and the main one and would allow this useful mecanism to be merged in the main PPC branch. Here's the 2.2.x version (as of 2.2.17pre7) --- linuxppc_2_2/kernel/printk.c Fri Jun 30 12:00:07 2000 +++ ben_kernel/kernel/printk.c Tue Jun 27 15:10:30 2000 @@ -468,7 +468,14 @@ } } } - + + /* If last console is removed, we re-enable picking the first + * one that gets registered. Without that, pmac early boot console + * would prevent fbcon from taking over. + */ + if (console_drivers == NULL) + preferred_console = -1; + spin_unlock_irqrestore(&console_lock,flags); return res; } Here's the 2.4 version (as of test2) --- printk.c.orig Fri Jun 30 12:47:25 2000 +++ printk.c Fri Jun 30 12:46:52 2000 @@ -471,6 +471,14 @@ } } + /* If last console is removed, we re-enable picking the first + * one that gets registered. Without that, pmac early boot console + * would prevent fbcon from taking over. + */ + if (console_drivers == NULL) + preferred_console = -1; + + spin_unlock_irqrestore(&console_lock, flags); return res; } Regards, Ben. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to maj...@vg... Please read the FAQ at http://www.tux.org/lkml/ |