* [PATCH] make loglevel related commandline to early_param @ 2008-02-01 10:40 Yinghai Lu 2008-02-01 12:39 ` Andi Kleen 0 siblings, 1 reply; 6+ messages in thread From: Yinghai Lu @ 2008-02-01 10:40 UTC (permalink / raw) To: Andrew Morton; +Cc: linux-kernel [PATCH] make loglevel related command_line to early_param so we can use them for early console like console=uart8250 or earlycon=uart8250 or early_printk Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> diff --git a/init/main.c b/init/main.c index cb81ed1..a774a93 100644 --- a/init/main.c +++ b/init/main.c @@ -232,22 +232,18 @@ EXPORT_SYMBOL(loops_per_jiffy); static int __init debug_kernel(char *str) { - if (*str) - return 0; console_loglevel = 10; return 1; } static int __init quiet_kernel(char *str) { - if (*str) - return 0; console_loglevel = 4; return 1; } -__setup("debug", debug_kernel); -__setup("quiet", quiet_kernel); +early_param("debug", debug_kernel); +early_param("quiet", quiet_kernel); static int __init loglevel(char *str) { @@ -255,7 +251,7 @@ static int __init loglevel(char *str) return 1; } -__setup("loglevel=", loglevel); +early_param("loglevel", loglevel); /* * Unknown boot options get handed to init, unless they look like diff --git a/kernel/printk.c b/kernel/printk.c index 58bbec6..8c25e37 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -458,7 +458,7 @@ static int __init ignore_loglevel_setup(char *str) return 1; } -__setup("ignore_loglevel", ignore_loglevel_setup); +early_param("ignore_loglevel", ignore_loglevel_setup); /* * Write out chars from start to end - 1 inclusive ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] make loglevel related commandline to early_param 2008-02-01 10:40 [PATCH] make loglevel related commandline to early_param Yinghai Lu @ 2008-02-01 12:39 ` Andi Kleen 2008-02-01 18:51 ` Yinghai Lu 2008-02-01 19:35 ` [PATCH] make loglevel related commandline to early_param v2 Yinghai Lu 0 siblings, 2 replies; 6+ messages in thread From: Andi Kleen @ 2008-02-01 12:39 UTC (permalink / raw) To: Yinghai Lu; +Cc: Andrew Morton, linux-kernel Yinghai Lu <Yinghai.Lu@Sun.COM> writes: > diff --git a/init/main.c b/init/main.c > index cb81ed1..a774a93 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -232,22 +232,18 @@ EXPORT_SYMBOL(loops_per_jiffy); > > static int __init debug_kernel(char *str) > { > - if (*str) > - return 0; > console_loglevel = 10; > return 1; The return semantics changes with early_param so you need to change that in all cases to return 0 (and negative value for errors) -Andi ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] make loglevel related commandline to early_param 2008-02-01 12:39 ` Andi Kleen @ 2008-02-01 18:51 ` Yinghai Lu 2008-02-01 19:35 ` [PATCH] make loglevel related commandline to early_param v2 Yinghai Lu 1 sibling, 0 replies; 6+ messages in thread From: Yinghai Lu @ 2008-02-01 18:51 UTC (permalink / raw) To: Andi Kleen; +Cc: Andrew Morton, linux-kernel On Friday 01 February 2008 04:39:39 am Andi Kleen wrote: > Yinghai Lu <Yinghai.Lu@Sun.COM> writes: > > > diff --git a/init/main.c b/init/main.c > > index cb81ed1..a774a93 100644 > > --- a/init/main.c > > +++ b/init/main.c > > @@ -232,22 +232,18 @@ EXPORT_SYMBOL(loops_per_jiffy); > > > > static int __init debug_kernel(char *str) > > { > > - if (*str) > > - return 0; > > console_loglevel = 10; > > return 1; > > The return semantics changes with early_param so you need to change that in all cases to return 0 > (and negative value for errors) > thanks. I will send another one. YH ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] make loglevel related commandline to early_param v2 2008-02-01 12:39 ` Andi Kleen 2008-02-01 18:51 ` Yinghai Lu @ 2008-02-01 19:35 ` Yinghai Lu 2008-02-01 19:56 ` Andrew Morton 1 sibling, 1 reply; 6+ messages in thread From: Yinghai Lu @ 2008-02-01 19:35 UTC (permalink / raw) To: Andrew Morton, Ingo Molnar; +Cc: Andi Kleen, linux-kernel [PATCH] make loglevel related commandline to early_param v2 so we can use them for early console like console=uart8250,io,0x3f8,115200n8 earlycon=uart8250,io,0x3f8,115200n8 early_printk otherwise printk(KERN_DEBUG "debug msg") will not print out to console even "debug" command line is used. andi point out early_param need to return 0 instead 1. Ingo had another patch in x86.git to process ignore_loglevel Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> diff --git a/init/main.c b/init/main.c index cb81ed1..3741bda 100644 --- a/init/main.c +++ b/init/main.c @@ -232,30 +232,26 @@ EXPORT_SYMBOL(loops_per_jiffy); static int __init debug_kernel(char *str) { - if (*str) - return 0; console_loglevel = 10; - return 1; + return 0; } static int __init quiet_kernel(char *str) { - if (*str) - return 0; console_loglevel = 4; - return 1; + return 0; } -__setup("debug", debug_kernel); -__setup("quiet", quiet_kernel); +early_param("debug", debug_kernel); +early_param("quiet", quiet_kernel); static int __init loglevel(char *str) { get_option(&str, &console_loglevel); - return 1; + return 0; } -__setup("loglevel=", loglevel); +early_param("loglevel", loglevel); /* * Unknown boot options get handed to init, unless they look like ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] make loglevel related commandline to early_param v2 2008-02-01 19:35 ` [PATCH] make loglevel related commandline to early_param v2 Yinghai Lu @ 2008-02-01 19:56 ` Andrew Morton 2008-02-01 20:21 ` Yinghai Lu 0 siblings, 1 reply; 6+ messages in thread From: Andrew Morton @ 2008-02-01 19:56 UTC (permalink / raw) To: Yinghai Lu; +Cc: mingo, andi, linux-kernel On Fri, 01 Feb 2008 11:35:35 -0800 Yinghai Lu <Yinghai.Lu@Sun.COM> wrote: > [PATCH] make loglevel related commandline to early_param v2 > > so we can use them for early console like > console=uart8250,io,0x3f8,115200n8 > earlycon=uart8250,io,0x3f8,115200n8 > early_printk > > otherwise printk(KERN_DEBUG "debug msg") will not print out to console even > "debug" command line is used. > > andi point out early_param need to return 0 instead 1. > > Ingo had another patch in x86.git to process ignore_loglevel > > Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> > > diff --git a/init/main.c b/init/main.c > index cb81ed1..3741bda 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -232,30 +232,26 @@ EXPORT_SYMBOL(loops_per_jiffy); > > static int __init debug_kernel(char *str) > { > - if (*str) > - return 0; > console_loglevel = 10; > - return 1; > + return 0; > } > > static int __init quiet_kernel(char *str) > { > - if (*str) > - return 0; > console_loglevel = 4; > - return 1; > + return 0; > } > > -__setup("debug", debug_kernel); > -__setup("quiet", quiet_kernel); > +early_param("debug", debug_kernel); > +early_param("quiet", quiet_kernel); > > static int __init loglevel(char *str) > { > get_option(&str, &console_loglevel); > - return 1; > + return 0; > } > > -__setup("loglevel=", loglevel); > +early_param("loglevel", loglevel); > > /* > * Unknown boot options get handed to init, unless they look like Your earlier patch converted ignore_loglevel but this one no longer does so. Was that deliberate? Below is the patch whcih I presently have queued. Is it OK? init/main.c | 14 +++++--------- kernel/printk.c | 5 ++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff -puN init/main.c~convert-loglevel-related-kernel-boot-parameters-to-early_param init/main.c --- a/init/main.c~convert-loglevel-related-kernel-boot-parameters-to-early_param +++ a/init/main.c @@ -232,22 +232,18 @@ EXPORT_SYMBOL(loops_per_jiffy); static int __init debug_kernel(char *str) { - if (*str) - return 0; console_loglevel = 10; - return 1; + return 0; } static int __init quiet_kernel(char *str) { - if (*str) - return 0; console_loglevel = 4; - return 1; + return 0; } -__setup("debug", debug_kernel); -__setup("quiet", quiet_kernel); +early_param("debug", debug_kernel); +early_param("quiet", quiet_kernel); static int __init loglevel(char *str) { @@ -255,7 +251,7 @@ static int __init loglevel(char *str) return 1; } -__setup("loglevel=", loglevel); +early_param("loglevel", loglevel); /* * Unknown boot options get handed to init, unless they look like diff -puN kernel/printk.c~convert-loglevel-related-kernel-boot-parameters-to-early_param kernel/printk.c --- a/kernel/printk.c~convert-loglevel-related-kernel-boot-parameters-to-early_param +++ a/kernel/printk.c @@ -447,11 +447,10 @@ static int __init ignore_loglevel_setup( { ignore_loglevel = 1; printk(KERN_INFO "debug: ignoring loglevel setting.\n"); - - return 1; + return 0; } -__setup("ignore_loglevel", ignore_loglevel_setup); +early_param("ignore_loglevel", ignore_loglevel_setup); /* * Write out chars from start to end - 1 inclusive _ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] make loglevel related commandline to early_param v2 2008-02-01 19:56 ` Andrew Morton @ 2008-02-01 20:21 ` Yinghai Lu 0 siblings, 0 replies; 6+ messages in thread From: Yinghai Lu @ 2008-02-01 20:21 UTC (permalink / raw) To: Andrew Morton; +Cc: mingo, andi, linux-kernel On Friday 01 February 2008 11:56:23 am Andrew Morton wrote: > On Fri, 01 Feb 2008 11:35:35 -0800 > Yinghai Lu <Yinghai.Lu@Sun.COM> wrote: > > > [PATCH] make loglevel related commandline to early_param v2 > > > > so we can use them for early console like > > console=uart8250,io,0x3f8,115200n8 > > earlycon=uart8250,io,0x3f8,115200n8 > > early_printk > > > > otherwise printk(KERN_DEBUG "debug msg") will not print out to console even > > "debug" command line is used. > > > > andi point out early_param need to return 0 instead 1. > > > > Ingo had another patch in x86.git to process ignore_loglevel > > ... > > Your earlier patch converted ignore_loglevel but this one no longer does > so. Was that deliberate? Ingo put one process "ingore_logleve" in x86.git last night. YH ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-02-01 20:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-01 10:40 [PATCH] make loglevel related commandline to early_param Yinghai Lu 2008-02-01 12:39 ` Andi Kleen 2008-02-01 18:51 ` Yinghai Lu 2008-02-01 19:35 ` [PATCH] make loglevel related commandline to early_param v2 Yinghai Lu 2008-02-01 19:56 ` Andrew Morton 2008-02-01 20:21 ` Yinghai Lu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox