rfc: remove early_printk from a few arches? (blackfin, m68k, mips)
Subsystems (2)
It seems like early_printk can be configured into a few architectures but also appear not to be used.
$ git grep -w "early_printk"
arch/arm/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/arm/kernel/early_printk.c: * linux/arch/arm/kernel/early_printk.c
arch/arm/mach-socfpga/socfpga.c: early_printk("Early printk initialized\n");
arch/blackfin/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/blackfin/kernel/bfin_dma.c:#include <asm/early_printk.h>
arch/blackfin/kernel/early_printk.c: * derived from arch/x86/kernel/early_printk.c
arch/blackfin/kernel/early_printk.c:#include <asm/early_printk.h>
arch/blackfin/kernel/setup.c:#include <asm/early_printk.h>
arch/blackfin/kernel/shadow_console.c:#include <asm/early_printk.h>
arch/blackfin/mm/init.c:#include <asm/early_printk.h>
arch/ia64/sn/kernel/setup.c: * IO on SN2 is done via SAL calls, early_printk won't work without this.
arch/m68k/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/microblaze/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c: early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");
arch/microblaze/kernel/cpu/cpuinfo-static.c: early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
arch/microblaze/kernel/setup.c:/* initialize device tree for usage in early_printk */
arch/mips/ath25/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/ath79/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/bcm63xx/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h: * during early_printk no ioremap possible at this early stage
arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h: * during early_printk no ioremap is possible
arch/mips/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/lantiq/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/loongson/common/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/ralink/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/tile/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/tile/kernel/early_printk.c: early_printk("Kernel panic - not syncing: %pV", &vaf);
arch/um/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/unicore32/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/unicore32/kernel/early_printk.c: * linux/arch/unicore32/kernel/early_printk.c
arch/x86/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/x86/kernel/e820.c: early_printk(msg);
arch/x86/kernel/head64.c: early_printk("Kernel alive\n");
arch/x86/kernel/head_64.S: call early_printk
arch/x86/platform/efi/Makefile:obj-$(CONFIG_EARLY_PRINTK_EFI) += early_printk.o
drivers/tty/serial/8250/8250_early.c: * and on early_printk.c by Andi Kleen.
drivers/tty/serial/sn_console.c: * synchronous (raw) and asynchronous (buffered). initially, early_printk
drivers/tty/serial/sn_console.c: /* without early_printk, we may be invoked late enough to race
drivers/tty/serial/sn_console.c: /* early_printk invocation may have done this for us */
include/linux/printk.h:void early_printk(const char *fmt, ...);
include/linux/printk.h:void early_printk(const char *s, ...) { }
kernel/events/core.c: early_printk("perf interrupt took too long (%lld > %lld), lowering "
kernel/locking/lockdep.c: * We cannot printk in early bootup code. Not even early_printk()
kernel/printk/printk.c:asmlinkage __visible void early_printk(const char *fmt, ...)
kernel/printk/printk.c: * early_printk) - sometimes before setup_arch() completes - be careful
kernel/printk/printk.c: * There are two types of consoles - bootconsoles (early_printk) andThese seem to the only uses:
arch/arm/mach-socfpga/socfpga.c: early_printk("Early printk initialized\n");
[]arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c: early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");arch/microblaze/kernel/cpu/cpuinfo-static.c: early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
[]arch/tile/kernel/early_printk.c: early_printk("Kernel panic - not syncing: %pV", &vaf);
[]arch/x86/kernel/e820.c: early_printk(msg);arch/x86/kernel/head64.c: early_printk("Kernel alive\n");arch/x86/kernel/head_64.S: call early_printk
[]kernel/events/core.c: early_printk("perf interrupt took too long (%lld > %lld), lowering "
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Is early_printk really used by these architectures? Should it be removed?
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
[snip]
Quoted 1 line
arch/mips/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Nowadays I try to use OF_EARLYCON whenever possible, but when that has been unavailable, I have used arch/mips/kernel/early_printk.c to get console output before the serial driver is initialized. It runs very early in the boot sequence and has very few dependencies, which makes it useful for board bringup.
At least on MIPS, the EARLY_PRINTK implementation registers itself as a console and works with standard printk() calls. It doesn't rely on arch/driver code explicitly calling early_printk().
Side note: looking through kernel/printk/printk.c it looks like there's a space missing in the description string:
MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to"
"print all kernel messages to the console.");
But since CONFIG_PRINTK is a bool option, I don't know if the description string actually shows up anywhere. Should it be converted into a comment?
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
[snip]
Quoted 1 line
arch/mips/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Nowadays I try to use OF_EARLYCON whenever possible, but when that has been unavailable, I have used arch/mips/kernel/early_printk.c to get console output before the serial driver is initialized. It runs very early in the boot sequence and has very few dependencies, which makes it useful for board bringup.
At least on MIPS, the EARLY_PRINTK implementation registers itself as a console and works with standard printk() calls. It doesn't rely on arch/driver code explicitly calling early_printk().
Side note: looking through kernel/printk/printk.c it looks like there's a space missing in the description string:
MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to"
"print all kernel messages to the console.");
But since CONFIG_PRINTK is a bool option, I don't know if the description string actually shows up anywhere. Should it be converted into a comment?
Quoted 5 lines · Kevin Cernekee
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
Quoted 8 lines
[snip]
Quoted 1 line
arch/mips/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Nowadays I try to use
OF_EARLYCONwhenever possible, but when that has been unavailable, I have usedarch/mips/kernel/early_printk.cto get console output before the serial driver is initialized. It runs very early in the boot sequence and has very few dependencies, which makes it useful for board bringup.
EARLY_PRINTK on MIPS is enabled just after prom_init(), well before OF_EARLYCON is usable. I'd prefer if it stayed that way.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 5 lines · Kevin Cernekee
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
Quoted 8 lines
[snip]
Quoted 1 line
arch/mips/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Nowadays I try to use
OF_EARLYCONwhenever possible, but when that has been unavailable, I have usedarch/mips/kernel/early_printk.cto get console output before the serial driver is initialized. It runs very early in the boot sequence and has very few dependencies, which makes it useful for board bringup.
EARLY_PRINTK on MIPS is enabled just after prom_init(), well before OF_EARLYCON is usable. I'd prefer if it stayed that way.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
...
Quoted 1 line
These seem to the only uses:
...
Quoted 2 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Hint: CONFIG_EARLY_PRINTK covers far more than early_printk()
Quoted 2 lines
Is
early_printkreally used by these architectures? Should it be removed?
Sure, if you have a good reason to remove working functionality.
Thanks,
tglx
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
...
Quoted 1 line
These seem to the only uses:
...
Quoted 2 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Hint: CONFIG_EARLY_PRINTK covers far more than early_printk()
Quoted 2 lines
Is
early_printkreally used by these architectures? Should it be removed?
Sure, if you have a good reason to remove working functionality.
Thanks,
tglx
Quoted 4 lines · Thomas Gleixner
Quoted 3 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.
Quoted 8 lines
Quoted 1 line
$ git grep -w "early_printk"...
Quoted 1 line
These seem to the only uses:
...
Quoted 2 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Hint:
CONFIG_EARLY_PRINTKcovers far more thanearly_printk()
I know this.
Note also I didn't specify CONFIG_EARLY_PRINTK,
just early_printk.
Quoted 4 lines
Quoted 2 lines
Is
early_printkreally used by these architectures? Should it be removed?Sure, if you have a good reason to remove working functionality.
Unused.
Ideally, all direct early_printk() uses would go away. This would just be a starting point to minimize code.
Quoted 4 lines · Thomas Gleixner
Quoted 3 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.
Quoted 8 lines
Quoted 1 line
$ git grep -w "early_printk"...
Quoted 1 line
These seem to the only uses:
...
Quoted 2 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Hint:
CONFIG_EARLY_PRINTKcovers far more thanearly_printk()
I know this.
Note also I didn't specify CONFIG_EARLY_PRINTK,
just early_printk.
Quoted 4 lines
Quoted 2 lines
Is
early_printkreally used by these architectures? Should it be removed?Sure, if you have a good reason to remove working functionality.
Unused.
Ideally, all direct early_printk() uses would go away. This would just be a starting point to minimize code.
Quoted 19 lines · Joe Perches
Quoted 4 lines · Thomas Gleixner
Quoted 3 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.Quoted 8 lines
Quoted 1 line
$ git grep -w "early_printk"...
Quoted 1 line
These seem to the only uses:
...
Quoted 2 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Hint:
CONFIG_EARLY_PRINTKcovers far more thanearly_printk()I know this.
Note also I didn't specify
CONFIG_EARLY_PRINTK,
justearly_printk.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Is
early_printkreally used by these architectures? Should it be removed?Sure, if you have a good reason to remove working functionality.
Unused.
What exactly are you proposing to remove? I see no unused code related to early printk (in any variant) under arch/mips.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 19 lines · Joe Perches
Quoted 4 lines · Thomas Gleixner
Quoted 3 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.Quoted 8 lines
Quoted 1 line
$ git grep -w "early_printk"...
Quoted 1 line
These seem to the only uses:
...
Quoted 2 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Hint:
CONFIG_EARLY_PRINTKcovers far more thanearly_printk()I know this.
Note also I didn't specify
CONFIG_EARLY_PRINTK,
justearly_printk.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Is
early_printkreally used by these architectures? Should it be removed?Sure, if you have a good reason to remove working functionality.
Unused.
What exactly are you proposing to remove? I see no unused code related to early printk (in any variant) under arch/mips.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 1 line · Måns Rullgård
What exactly are you proposing to remove?
Optionally compile out kernel/printk/printk.c:early_printk() even if CONFIG_EARLY_PRINTK is enabled.
Quoted 2 lines
I see no unused code related
to early printk (in any variant) underarch/mips.
I think there could be yet another CONFIG option to specifically enable the early_printk function for the arches that use it.
The kernel/printk/early_printk() function seems used only by arm/microblaze/tile/x86.
Quoted 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
[...]
Quoted 1 line
arch/m68k/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
[...]
Quoted 12 lines
These seem to the only uses:
arch/arm/mach-socfpga/socfpga.c:early_printk("Early printk initialized\n");
[]arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");arch/microblaze/kernel/cpu/cpuinfo-static.c:early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
[]arch/tile/kernel/early_printk.c:early_printk("Kernel panic - not syncing: %pV", &vaf);
[]arch/x86/kernel/e820.c: early_printk(msg); arch/x86/kernel/head64.c: early_printk("Kernel alive\n"); arch/x86/kernel/head_64.S: call early_printk
Quoted 8 lines
[]
kernel/events/core.c: early_printk("perf interrupt took too long (%lld > %lld), lowering "So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Is
early_printkreally used by these architectures? Should it be removed?
The m68k "early_printk" match is not about the early_printk() function, but about
the early printk functionality. Hence nothing to remove there.
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 4 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk"
[...]
Quoted 1 line
arch/m68k/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
[...]
Quoted 12 lines
These seem to the only uses:
arch/arm/mach-socfpga/socfpga.c:early_printk("Early printk initialized\n");
[]arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");arch/microblaze/kernel/cpu/cpuinfo-static.c:early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
[]arch/tile/kernel/early_printk.c:early_printk("Kernel panic - not syncing: %pV", &vaf);
[]arch/x86/kernel/e820.c: early_printk(msg); arch/x86/kernel/head64.c: early_printk("Kernel alive\n"); arch/x86/kernel/head_64.S: call early_printk
Quoted 8 lines
[]
kernel/events/core.c: early_printk("perf interrupt took too long (%lld > %lld), lowering "So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Is
early_printkreally used by these architectures? Should it be removed?
The m68k "early_printk" match is not about the early_printk() function, but about
the early printk functionality. Hence nothing to remove there.
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 7 lines · Joe Perches
Quoted 1 line · Måns Rullgård
What exactly are you proposing to remove?
Optionally compile out kernel/printk/printk.c:early_printk() even if
CONFIG_EARLY_PRINTKis enabled.
Quoted 6 lines
Quoted 2 lines
I see no unused code related
to early printk (in any variant) underarch/mips.I think there could be yet another CONFIG option to specifically enable the
early_printkfunction for the arches that use it.
Why bother? On MIPS it would save 132 bytes of compiled code.
Quoted 2 lines
The kernel/printk/early_printk() function seems used only by arm/microblaze/tile/x86.
Rather than introduce more config complexity, you could try to remove the 7 remaining uses of early_printk().
- arch/arm/mach-socfpga
Single early_printk("Early printk initialized\n") call serving no apparent purpose can probably be safely deleted. Since there are no other early_printk() calls, this information seems rather useless.
- arch/microblaze, arch/tile, arch/x86
These all do a register_console() for the early console, so regular printk() should work. Moreover, x86 allows multiple early consoles, but calling early_printk() will only output to the last one specified.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 6 lines · Måns Rullgård
Quoted 2 lines · Joe Perches
The kernel/printk/early_printk() function seems
used only by arm/microblaze/tile/x86.Rather than introduce more config complexity, you could try to remove the 7 remaining uses of
early_printk().
That's the general idea actually.
Dunno if that's possible at one go though.
cheers, Joe
Quoted 66 lines · Joe Perches
It seems like
early_printkcan be configured into a few architectures but also appear not to be used.$ git grep -w "early_printk" arch/arm/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/arm/kernel/early_printk.c: * linux/arch/arm/kernel/early_printk.c arch/arm/mach-socfpga/socfpga.c: early_printk("Early printk initialized\n"); arch/blackfin/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/blackfin/kernel/bfin_dma.c:#include <asm/early_printk.h> arch/blackfin/kernel/early_printk.c: * derived from arch/x86/kernel/early_printk.c arch/blackfin/kernel/early_printk.c:#include <asm/early_printk.h> arch/blackfin/kernel/setup.c:#include <asm/early_printk.h> arch/blackfin/kernel/shadow_console.c:#include <asm/early_printk.h> arch/blackfin/mm/init.c:#include <asm/early_printk.h> arch/ia64/sn/kernel/setup.c: * IO on SN2 is done via SAL calls, early_printk won't work without this. arch/m68k/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/microblaze/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c: early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n"); arch/microblaze/kernel/cpu/cpuinfo-static.c: early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n"); arch/microblaze/kernel/setup.c:/* initialize device tree for usage in early_printk */ arch/mips/ath25/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/mips/ath79/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/mips/bcm63xx/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h: * during early_printk no ioremap possible at this early stage arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h: * during early_printk no ioremap is possible arch/mips/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/mips/lantiq/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/mips/loongson/common/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/mips/ralink/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/tile/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/tile/kernel/early_printk.c: early_printk("Kernel panic - not syncing: %pV", &vaf); arch/um/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/unicore32/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/unicore32/kernel/early_printk.c: * linux/arch/unicore32/kernel/early_printk.c arch/x86/kernel/Makefile:obj-$(CONFIG_EARLY_PRINTK) += early_printk.o arch/x86/kernel/e820.c: early_printk(msg); arch/x86/kernel/head64.c: early_printk("Kernel alive\n"); arch/x86/kernel/head_64.S: call early_printk arch/x86/platform/efi/Makefile:obj-$(CONFIG_EARLY_PRINTK_EFI) += early_printk.o drivers/tty/serial/8250/8250_early.c: * and on early_printk.c by Andi Kleen. drivers/tty/serial/sn_console.c: * synchronous (raw) and asynchronous (buffered). initially, early_printk drivers/tty/serial/sn_console.c: /* without early_printk, we may be invoked late enough to race drivers/tty/serial/sn_console.c: /* early_printk invocation may have done this for us */ include/linux/printk.h:void early_printk(const char *fmt, ...); include/linux/printk.h:void early_printk(const char *s, ...) { } kernel/events/core.c: early_printk("perf interrupt took too long (%lld > %lld), lowering " kernel/locking/lockdep.c: * We cannot printk in early bootup code. Not even early_printk() kernel/printk/printk.c:asmlinkage __visible void early_printk(const char *fmt, ...) kernel/printk/printk.c: * early_printk) - sometimes before setup_arch() completes - be careful kernel/printk/printk.c: * There are two types of consoles - bootconsoles (early_printk) andThese seem to the only uses:
arch/arm/mach-socfpga/socfpga.c:early_printk("Early printk initialized\n");
[]arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");arch/microblaze/kernel/cpu/cpuinfo-static.c:early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
[]arch/tile/kernel/early_printk.c:early_printk("Kernel panic - not syncing: %pV", &vaf);
[]arch/x86/kernel/e820.c:early_printk(msg);arch/x86/kernel/head64.c:early_printk("Kernel alive\n");arch/x86/kernel/head_64.S: callearly_printk
[]kernel/events/core.c: early_printk("perf interrupt took too long (%lld > %lld), lowering "
Quoted 5 lines
So blackfin, m68k, and mips seems to have it possible to enable, but also don't appear at first glance to use it,
Is
early_printkreally used by these architectures? Should it be removed?
early_printk() is for debugging. Actually, feel free to remove:
arch/arm/mach-socfpga/socfpga.c: early_printk("Early printk initialized\n");
Its debugging output I added and should have been removed. So... early_printk()s _should_ be unused in the mainline code, but functionality should be kept, so that when someone needs it, he can enable it.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 21 lines · Måns Rullgård
Quoted 7 lines · Joe Perches
Quoted 1 line · Måns Rullgård
What exactly are you proposing to remove?
Optionally compile out kernel/printk/printk.c:early_printk() even if
CONFIG_EARLY_PRINTKis enabled.Quoted 6 lines
Quoted 2 lines
I see no unused code related
to early printk (in any variant) underarch/mips.I think there could be yet another CONFIG option to specifically enable the
early_printkfunction for the arches that use it.Why bother? On MIPS it would save 132 bytes of compiled code.
Quoted 2 lines
The kernel/printk/early_printk() function seems used only by arm/microblaze/tile/x86.
Quoted 7 lines
Rather than introduce more config complexity, you could try to remove the 7 remaining uses of
early_printk().-
arch/arm/mach-socfpga
Singleearly_printk("Early printk initialized\n")call serving no apparent purpose can probably be safely deleted. Since there are no otherearly_printk()calls, this information seems rather useless.
Feel free to do that, but please keep early_printk() available...
...so that I can debug the socfpga early boot when needed.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html