set up conswitchp when CONFIG_VT is set
PATCH 1/1 set up conswitchp when CONFIG_VT is set
conswitchp needs to be set whenever CONFIG_VT is selected. Currently this job is done individually by each board in its setup routine, often in a wrong way.
The right thing to do is to set the pointer in the common code and remove almost two dozens of duplicated and often wrong settings.
The attached patch is for illustration only. The removal of board settings is not complete.
Comments? Objections and cheers are equally welcome. :)
Jun
arch/mips/ddb5xxx/ddb5074/setup.c renamed from arch/mips/ddb5xxx/ddb5074/setup.c.orig +0 -5
@@ -10,7 +10,6 @@#include <linux/kernel.h> #include <linux/kdev_t.h> #include <linux/types.h> -#include <linux/console.h> #include <linux/sched.h> #include <linux/pci.h> #include <linux/ide.h>
@@ -113,10 +112,6 @@ddb_set_pmr (DDB_PCIINIT0 ,DDB_PCICMD_IO ,0 ,0x10 );ddb_set_pmr (DDB_PCIINIT1 ,DDB_PCICMD_MEM ,DDB_PCI_MEM_BASE ,0x10 ); -#ifdef CONFIG_FB - conswitchp = &dummy_con; -#endif -/* Reboot on panic */ panic_timeout =180 ; }
arch/mips/ddb5xxx/ddb5476/setup.c renamed from arch/mips/ddb5xxx/ddb5476/setup.c.orig +0 -5
@@ -10,7 +10,6 @@#include <linux/kernel.h> #include <linux/kdev_t.h> #include <linux/types.h> -#include <linux/console.h> #include <linux/sched.h> #include <linux/pci.h>
@@ -166,10 +165,6 @@/* [jsun] we need to set BAR0 so that SDRAM 0 appears at 0x0 in PCI */ /* *(long*)0xbfa00218 = 0x8; */ -#ifdef CONFIG_FB - conswitchp = &dummy_con; -#endif -/* board initialization stuff */ ddb5476_board_init (); }
arch/mips/kernel/setup.c renamed from arch/mips/kernel/setup.c.orig +10 -0
@@ -32,6 +32,7 @@#include <linux/kdev_t.h> #include <linux/root_dev.h> #include <linux/highmem.h> +#include <linux/console.h> #include <asm/addrspace.h> #include <asm/bootinfo.h>
@@ -471,6 +472,15 @@set_c0_status (ST0_CU0 |ST0_KX |ST0_SX |ST0_FR );#endif +#ifdef CONFIG_VT +#if defined(CONFIG_VGA_CONSOLE ) + conswitchp = &vga_con; +#elif defined(CONFIG_DUMMY_CONSOLE ) + conswitchp = &dummy_con; +#endif +#endif + +/* call board setup routine */ do_earlyinitcalls ();strlcpy (command_line, arcs_cmdline,sizeof (command_line));
Quoted 11 lines · Jun Sun
conswitchp needs to be set whenever
CONFIG_VTis selected. Currently this job is done individually by each board in its setup routine, often in a wrong way.The right thing to do is to set the pointer in the common code and remove almost two dozens of duplicated and often wrong settings.
The attached patch is for illustration only. The removal of board settings is not complete.
Comments? Objections and cheers are equally welcome. :)
| --- linux/arch/mips/kernel/setup.c.orig Tue Nov 18 10:01:24 2003 | +++ linux/arch/mips/kernel/setup.c Wed Jan 21 16:00:47 2004 | @@ -471,6 +472,15 @@ | set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR); | #endif | | +#ifdef CONFIG_VT | +#if defined(CONFIG_VGA_CONSOLE) | + conswitchp = &vga_con; | +#elif defined(CONFIG_DUMMY_CONSOLE) | + conswitchp = &dummy_con; | +#endif | +#endif
Isn't the #ifdef CONFIG_VT superfluous?
Gr{oetje,eeting}s,
Geert
--
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
Quoted 9 lines · Geert Uytterhoeven
| +#ifdef CONFIG_VT | +#if defined(CONFIG_VGA_CONSOLE) | + conswitchp = &vga_con; | +#elif defined(CONFIG_DUMMY_CONSOLE) | + conswitchp = &dummy_con; | +#endif | +#endifIsn't the #ifdef
CONFIG_VTsuperfluous?
No; if CONFIG_VT is undefined conswitchp is undefined also; DUMMY_CONSOLE however is still selectable if CONFIG_VT is off so there could be unsatisfied references to consitchp.
ralf
Quoted 9 lines · Ralf Baechle
Quoted 8 lines · Geert Uytterhoeven
| +#ifdef CONFIG_VT | +#if defined(CONFIG_VGA_CONSOLE) | + conswitchp = &vga_con; | +#elif defined(CONFIG_DUMMY_CONSOLE) | + conswitchp = &dummy_con; | +#endif | +#endif
Quoted 5 lines
Quoted 1 line
Isn't the #ifdef
CONFIG_VTsuperfluous?No; if
CONFIG_VTis undefined conswitchp is undefined also;DUMMY_CONSOLEhowever is still selectable ifCONFIG_VTis off so there could be unsatisfied references to consitchp.
DUMMY_CONSOLE can be set in drivers/video/console/Kconfig only. drivers/video/console/Kconfig is included by drivers/video/Kconfig only, and its inclusion depends on VT.
Hence the #ifdef CONFIG_VT is superfluous, unless the above isn't true for the MIPS tree (I checked plain 2.6.1).
Gr{oetje,eeting}s,
Geert
--
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
Quoted 5 lines · Geert Uytterhoeven
DUMMY_CONSOLEcan be set indrivers/video/console/Kconfigonly.drivers/video/console/Kconfigis included bydrivers/video/Kconfigonly, and its inclusion depends on VT.
Hence the #ifdefCONFIG_VTis superfluous, unless the above isn't true for the MIPS tree (I checked plain 2.6.1).
A few systems used to hardwire CONFIG_DUMMY_CONSOLE in their Config.in / Kconfig. Seem that has been fixed, good.
Ralf
Quoted 11 lines · Ralf Baechle
Quoted 5 lines · Geert Uytterhoeven
DUMMY_CONSOLEcan be set indrivers/video/console/Kconfigonly.drivers/video/console/Kconfigis included bydrivers/video/Kconfigonly, and its inclusion depends on VT.
Hence the #ifdefCONFIG_VTis superfluous, unless the above isn't true for the MIPS tree (I checked plain 2.6.1).A few systems used to hardwire
CONFIG_DUMMY_CONSOLEin their Config.in /Kconfig. Seem that has been fixed, good.
You are both right.
In the end conswitchp needs to be set if and only if CONFIG_VT is set.