All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] earlyprintk: re-enable earlyprintk calling early_param
@ 2014-08-14 10:13 kpark3469
  2014-08-14 20:34 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: kpark3469 @ 2014-08-14 10:13 UTC (permalink / raw)
  To: akpm
  Cc: keun-o.park, hpa, rafael.j.wysocki, peterz, rusty,
	kirill.shutemov, oleg, prarit, linux-kernel

From: Sahara <keun-o.park@windriver.com>

Although there are many obs_kernel_param and its names are
earlyprintk and also EARLY_PRINTK is also enabled, we could not
see the early_printk output properly until now. This patch
considers earlycon as well as earlyprintk.

Signed-off-by: Sahara <keun-o.park@windriver.com>
---
 init/main.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/init/main.c b/init/main.c
index bb1aed9..235d248 100644
--- a/init/main.c
+++ b/init/main.c
@@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char *val, const char *unused)
 	for (p = __setup_start; p < __setup_end; p++) {
 		if ((p->early && parameq(param, p->str)) ||
 		    (strcmp(param, "console") == 0 &&
-		     strcmp(p->str, "earlycon") == 0)
+		     ((strcmp(p->str, "earlycon") == 0) ||
+		     (strcmp(p->str, "earlyprintk") == 0)))
 		) {
 			if (p->setup_func(val) != 0)
 				pr_warn("Malformed early option '%s'\n", param);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-14 10:13 [PATCH] earlyprintk: re-enable earlyprintk calling early_param kpark3469
@ 2014-08-14 20:34 ` Andrew Morton
  2014-08-18  2:51   ` Sahara
  2014-08-15 18:34 ` Rusty Russell
  2014-08-27 15:15 ` Thierry Reding
  2 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2014-08-14 20:34 UTC (permalink / raw)
  To: kpark3469
  Cc: keun-o.park, hpa, rafael.j.wysocki, peterz, rusty,
	kirill.shutemov, oleg, prarit, linux-kernel

On Thu, 14 Aug 2014 19:13:36 +0900 kpark3469@gmail.com wrote:

> From: Sahara <keun-o.park@windriver.com>
> 
> Although there are many obs_kernel_param and its names are
> earlyprintk and also EARLY_PRINTK is also enabled, we could not
> see the early_printk output properly until now. This patch
> considers earlycon as well as earlyprintk.

Sorry, I just don't understand this description.

What does the patch actually do?  What was the kernel behaviour without
the patch and what is the kernel behaviour with the patch?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-14 10:13 [PATCH] earlyprintk: re-enable earlyprintk calling early_param kpark3469
  2014-08-14 20:34 ` Andrew Morton
@ 2014-08-15 18:34 ` Rusty Russell
  2014-08-18  3:13   ` Sahara
  2014-08-27 15:15 ` Thierry Reding
  2 siblings, 1 reply; 11+ messages in thread
From: Rusty Russell @ 2014-08-15 18:34 UTC (permalink / raw)
  To: kpark3469, akpm
  Cc: keun-o.park, hpa, rafael.j.wysocki, peterz, kirill.shutemov,
	oleg, prarit, linux-kernel

kpark3469@gmail.com writes:
> From: Sahara <keun-o.park@windriver.com>
>
> Although there are many obs_kernel_param and its names are
> earlyprintk and also EARLY_PRINTK is also enabled, we could not
> see the early_printk output properly until now. This patch
> considers earlycon as well as earlyprintk.

Hmm, the initial "earlycon" hack slipped in when I wasn't looking.
I don't think we should extend it.

Why not make the thing(s) you want early_param()s?

Cheers,
Rusty.

> --- a/init/main.c
> +++ b/init/main.c
> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char *val, const char *unused)
>  	for (p = __setup_start; p < __setup_end; p++) {
>  		if ((p->early && parameq(param, p->str)) ||
>  		    (strcmp(param, "console") == 0 &&
> -		     strcmp(p->str, "earlycon") == 0)
> +		     ((strcmp(p->str, "earlycon") == 0) ||
> +		     (strcmp(p->str, "earlyprintk") == 0)))
>  		) {
>  			if (p->setup_func(val) != 0)
>  				pr_warn("Malformed early option '%s'\n", param);
> -- 
> 1.7.9.5

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-14 20:34 ` Andrew Morton
@ 2014-08-18  2:51   ` Sahara
  0 siblings, 0 replies; 11+ messages in thread
From: Sahara @ 2014-08-18  2:51 UTC (permalink / raw)
  To: Andrew Morton, kpark3469
  Cc: hpa, rafael.j.wysocki, peterz, rusty, kirill.shutemov, oleg,
	prarit, linux-kernel


2014년 08월 15일 05:34, Andrew Morton 쓴 글:
> On Thu, 14 Aug 2014 19:13:36 +0900 kpark3469@gmail.com wrote:
>
>> From: Sahara <keun-o.park@windriver.com>
>>
>> Although there are many obs_kernel_param and its names are
>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>> see the early_printk output properly until now. This patch
>> considers earlycon as well as earlyprintk.
> Sorry, I just don't understand this description.
>
> What does the patch actually do?  What was the kernel behaviour without
> the patch and what is the kernel behaviour with the patch?
>
Without this patch,
- earlycon case -
if early_param("earlycon", ...) is defined and
case #1: if cmdline has "earlycon", then it satisfies the condition 
"(p->early && parameq(param, p->str))". You can see early_printk().
case #2: if cmdline has "console", then it satisfies the condition 
"strcmp(param, "console") == 0 && strcmp(p->str, "earlycon") == 0". You 
can see early_printk().

- earlyprintk case -
if early_param("earlyprintk", ...) is defined and
case #1: if cmdline has "earlyprintk", then it satisfies the condition 
"(p->early && parameq(param, p->str))". You can see early_printk().
case #2: if cmdline has "console", it does not satisfies the condition, 
because it only checks out "earlycon" only.

This patch fixes the case #2 problem of earlyprintk.

Thanks.

Best Regards,
Sahara.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-15 18:34 ` Rusty Russell
@ 2014-08-18  3:13   ` Sahara
  2014-08-19  2:14     ` Keun-O Park
  0 siblings, 1 reply; 11+ messages in thread
From: Sahara @ 2014-08-18  3:13 UTC (permalink / raw)
  To: Rusty Russell, kpark3469, akpm
  Cc: hpa, rafael.j.wysocki, peterz, kirill.shutemov, oleg, prarit,
	linux-kernel


2014년 08월 16일 03:34, Rusty Russell 쓴 글:
> kpark3469@gmail.com writes:
>> From: Sahara <keun-o.park@windriver.com>
>>
>> Although there are many obs_kernel_param and its names are
>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>> see the early_printk output properly until now. This patch
>> considers earlycon as well as earlyprintk.
> Hmm, the initial "earlycon" hack slipped in when I wasn't looking.
> I don't think we should extend it.
>
> Why not make the thing(s) you want early_param()s?
>
> Cheers,
> Rusty.
The earlycon and the earlyprintk are scattered and used in many 
architectures.
It looks earlycon just could be a subset of earlyprintk.
The earlycon is for uart specific, while the earlyprintk is to support 
vga, efi, xen, serial, and so on. Especially ARM uses earlyprintk in 
many places. And, I am not sure if this is a good chance to replace all 
the earlyprintk with the earlycon. As of now, it's fair for both 
earlycon and earlyprintk.
Or perhaps removing case#2, see in my previous email to Andrew Morton, 
is better?, so users be forced to specify earlycon and earlyprintk in 
cmdline if they want to see early_printk() output.

Thanks.

Best Regards,
Sahara.

>
>> --- a/init/main.c
>> +++ b/init/main.c
>> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char *val, const char *unused)
>>   	for (p = __setup_start; p < __setup_end; p++) {
>>   		if ((p->early && parameq(param, p->str)) ||
>>   		    (strcmp(param, "console") == 0 &&
>> -		     strcmp(p->str, "earlycon") == 0)
>> +		     ((strcmp(p->str, "earlycon") == 0) ||
>> +		     (strcmp(p->str, "earlyprintk") == 0)))
>>   		) {
>>   			if (p->setup_func(val) != 0)
>>   				pr_warn("Malformed early option '%s'\n", param);
>> -- 
>> 1.7.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-18  3:13   ` Sahara
@ 2014-08-19  2:14     ` Keun-O Park
  0 siblings, 0 replies; 11+ messages in thread
From: Keun-O Park @ 2014-08-19  2:14 UTC (permalink / raw)
  To: Sahara
  Cc: Rusty Russell, Andrew Morton, hpa, rafael.j.wysocki, peterz,
	kirill.shutemov, oleg, prarit, linux-kernel

FYI only if you missed my previous 2 replies which didn't reach the
mailing list.
Thanks.



On Mon, Aug 18, 2014 at 12:13 PM, Sahara <keun-o.park@windriver.com> wrote:
>
> 2014년 08월 16일 03:34, Rusty Russell 쓴 글:
>
>> kpark3469@gmail.com writes:
>>>
>>> From: Sahara <keun-o.park@windriver.com>
>>>
>>> Although there are many obs_kernel_param and its names are
>>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>>> see the early_printk output properly until now. This patch
>>> considers earlycon as well as earlyprintk.
>>
>> Hmm, the initial "earlycon" hack slipped in when I wasn't looking.
>> I don't think we should extend it.
>>
>> Why not make the thing(s) you want early_param()s?
>>
>> Cheers,
>> Rusty.
>
> The earlycon and the earlyprintk are scattered and used in many
> architectures.
> It looks earlycon just could be a subset of earlyprintk.
> The earlycon is for uart specific, while the earlyprintk is to support vga,
> efi, xen, serial, and so on. Especially ARM uses earlyprintk in many places.
> And, I am not sure if this is a good chance to replace all the earlyprintk
> with the earlycon. As of now, it's fair for both earlycon and earlyprintk.
> Or perhaps removing case#2, see in my previous email to Andrew Morton, is
> better?, so users be forced to specify earlycon and earlyprintk in cmdline
> if they want to see early_printk() output.
>
> Thanks.
>
> Best Regards,
> Sahara.
>
>
>>
>>> --- a/init/main.c
>>> +++ b/init/main.c
>>> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char
>>> *val, const char *unused)
>>>         for (p = __setup_start; p < __setup_end; p++) {
>>>                 if ((p->early && parameq(param, p->str)) ||
>>>                     (strcmp(param, "console") == 0 &&
>>> -                    strcmp(p->str, "earlycon") == 0)
>>> +                    ((strcmp(p->str, "earlycon") == 0) ||
>>> +                    (strcmp(p->str, "earlyprintk") == 0)))
>>>                 ) {
>>>                         if (p->setup_func(val) != 0)
>>>                                 pr_warn("Malformed early option '%s'\n",
>>> param);
>>> --
>>> 1.7.9.5
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-14 10:13 [PATCH] earlyprintk: re-enable earlyprintk calling early_param kpark3469
  2014-08-14 20:34 ` Andrew Morton
  2014-08-15 18:34 ` Rusty Russell
@ 2014-08-27 15:15 ` Thierry Reding
  2014-08-29  5:28   ` Sahara
  2 siblings, 1 reply; 11+ messages in thread
From: Thierry Reding @ 2014-08-27 15:15 UTC (permalink / raw)
  To: kpark3469
  Cc: akpm, keun-o.park, hpa, rafael.j.wysocki, peterz, rusty,
	kirill.shutemov, oleg, prarit, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4536 bytes --]

On Thu, Aug 14, 2014 at 07:13:36PM +0900, kpark3469@gmail.com wrote:
> From: Sahara <keun-o.park@windriver.com>
> 
> Although there are many obs_kernel_param and its names are
> earlyprintk and also EARLY_PRINTK is also enabled, we could not
> see the early_printk output properly until now. This patch
> considers earlycon as well as earlyprintk.
> 
> Signed-off-by: Sahara <keun-o.park@windriver.com>
> ---
>  init/main.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/init/main.c b/init/main.c
> index bb1aed9..235d248 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char *val, const char *unused)
>  	for (p = __setup_start; p < __setup_end; p++) {
>  		if ((p->early && parameq(param, p->str)) ||
>  		    (strcmp(param, "console") == 0 &&
> -		     strcmp(p->str, "earlycon") == 0)
> +		     ((strcmp(p->str, "earlycon") == 0) ||
> +		     (strcmp(p->str, "earlyprintk") == 0)))
>  		) {
>  			if (p->setup_func(val) != 0)
>  				pr_warn("Malformed early option '%s'\n", param);

It seems like this patch causes the following warning for me during
boot:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.17.0-rc2-next-20140827 (thierry.reding@ulmo) (gcc version 4.9.0 (GCC) ) #18 SMP PREEMPT Wed Aug 27 17:08:12 CEST 2014
[    0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] Machine model: NVIDIA Tegra124 Jetson TK1
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] debug: ignoring loglevel setting.
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at /home/thierry.reding/src/kernel/linux-work.git/kernel/printk/printk.c:2402 register_console+0x60/0x37c()
[    0.000000] console 'earlycon0' already registered
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-rc2-next-20140827 #18
[    0.000000] [<c0015fec>] (unwind_backtrace) from [<c0011aac>] (show_stack+0x10/0x14)
[    0.000000] [<c0011aac>] (show_stack) from [<c062b700>] (dump_stack+0x98/0xd8)
[    0.000000] [<c062b700>] (dump_stack) from [<c0025ba0>] (warn_slowpath_common+0x70/0x8c)
[    0.000000] [<c0025ba0>] (warn_slowpath_common) from [<c0025bec>] (warn_slowpath_fmt+0x30/0x40)
[    0.000000] [<c0025bec>] (warn_slowpath_fmt) from [<c00639b8>] (register_console+0x60/0x37c)
[    0.000000] [<c00639b8>] (register_console) from [<c0883870>] (setup_early_printk+0x20/0x28)
[    0.000000] [<c0883870>] (setup_early_printk) from [<c087f43c>] (do_early_param+0x6c/0xd0)
[    0.000000] [<c087f43c>] (do_early_param) from [<c003cba0>] (parse_args+0x238/0x3d0)
[    0.000000] [<c003cba0>] (parse_args) from [<c087f814>] (parse_early_options+0x38/0x40)
[    0.000000] [<c087f814>] (parse_early_options) from [<c087f84c>] (parse_early_param+0x30/0x40)
[    0.000000] [<c087f84c>] (parse_early_param) from [<c088206c>] (setup_arch+0x4b4/0x974)
[    0.000000] [<c088206c>] (setup_arch) from [<c087f8f8>] (start_kernel+0x98/0x3a8)
[    0.000000] [<c087f8f8>] (start_kernel) from [<80008074>] (0x80008074)
[    0.000000] ---[ end trace cb88537fdc8fa200 ]---
[    0.000000] cma: Reserved 128 MiB at a7800000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 524032
[    0.000000] free_area_init_node: node 0, pgdat c091cc00, node_mem_map e67b7000
[    0.000000]   Normal zone: 1520 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 194560 pages, LIFO batch:31
[    0.000000]   HighMem zone: 2574 pages used for memmap
[    0.000000]   HighMem zone: 329472 pages, LIFO batch:31
[    0.000000] PERCPU: Embedded 8 pages/cpu @e6767000 s8832 r8192 d15744 u32768
[    0.000000] pcpu-alloc: s8832 r8192 d15744 u32768 alloc=8*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 522512
[    0.000000] Kernel command line: console=ttyS0,115200n8 ignore_loglevel rootwait ro earlyprintk ip=:::::eth0:dhcp root=/dev/nfs nfsroot=192.168.69.100:/srv/nfs/tegra124 drm.debug=0xf cma=128M

Reverting the patch eliminates the warning. earlyprintk does work fine
for me without this patch.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-27 15:15 ` Thierry Reding
@ 2014-08-29  5:28   ` Sahara
  2014-08-29 15:56     ` Stephen Warren
  0 siblings, 1 reply; 11+ messages in thread
From: Sahara @ 2014-08-29  5:28 UTC (permalink / raw)
  To: Thierry Reding
  Cc: kpark3469, akpm, keun-o.park, hpa, rafael.j.wysocki, peterz,
	rusty, kirill.shutemov, oleg, prarit, linux-kernel



On Wed, 27 Aug 2014, Thierry Reding wrote:

> On Thu, Aug 14, 2014 at 07:13:36PM +0900, kpark3469@gmail.com wrote:
>> From: Sahara <keun-o.park@windriver.com>
>>
>> Although there are many obs_kernel_param and its names are
>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>> see the early_printk output properly until now. This patch
>> considers earlycon as well as earlyprintk.
>>
>> Signed-off-by: Sahara <keun-o.park@windriver.com>
>> ---
>>  init/main.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/init/main.c b/init/main.c
>> index bb1aed9..235d248 100644
>> --- a/init/main.c
>> +++ b/init/main.c
>> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char 
*val, const char *unused)
>>  	for (p = __setup_start; p < __setup_end; p++) {
>>  		if ((p->early && parameq(param, p->str)) ||
>>  		    (strcmp(param, "console") == 0 &&
>> -		     strcmp(p->str, "earlycon") == 0)
>> +		     ((strcmp(p->str, "earlycon") == 0) ||
>> +		     (strcmp(p->str, "earlyprintk") == 0)))
>>  		) {
>>  			if (p->setup_func(val) != 0)
>>  				pr_warn("Malformed early option '%s'\n", 
param);
>
> It seems like this patch causes the following warning for me during
> boot:
>
> [    0.000000] Booting Linux on physical CPU 0x0
> [    0.000000] Initializing cgroup subsys cpu
> [    0.000000] Initializing cgroup subsys cpuacct
> [    0.000000] Linux version 3.17.0-rc2-next-20140827 
(thierry.reding@ulmo) (gcc version 4.9.0 (GCC) ) #18 SMP PREEMPT Wed Aug 
27 17:08:12 CEST 2014
> [    0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7), 
cr=10c5387d
> [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction 
cache
> [    0.000000] Machine model: NVIDIA Tegra124 Jetson TK1
> [    0.000000] bootconsole [earlycon0] enabled
> [    0.000000] debug: ignoring loglevel setting.
> [    0.000000] ------------[ cut here ]------------
> [    0.000000] WARNING: CPU: 0 PID: 0 at 
/home/thierry.reding/src/kernel/linux-work.git/kernel/printk/printk.c:2402 
register_console+0x60/0x37c()
> [    0.000000] console 'earlycon0' already registered
> [    0.000000] Modules linked in:
> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 
3.17.0-rc2-next-20140827 #18
> [    0.000000] [<c0015fec>] (unwind_backtrace) from [<c0011aac>] 
(show_stack+0x10/0x14)
> [    0.000000] [<c0011aac>] (show_stack) from [<c062b700>] 
(dump_stack+0x98/0xd8)
> [    0.000000] [<c062b700>] (dump_stack) from [<c0025ba0>] 
(warn_slowpath_common+0x70/0x8c)
> [    0.000000] [<c0025ba0>] (warn_slowpath_common) from [<c0025bec>] 
(warn_slowpath_fmt+0x30/0x40)
> [    0.000000] [<c0025bec>] (warn_slowpath_fmt) from [<c00639b8>] 
(register_console+0x60/0x37c)
> [    0.000000] [<c00639b8>] (register_console) from [<c0883870>] 
(setup_early_printk+0x20/0x28)
> [    0.000000] [<c0883870>] (setup_early_printk) from [<c087f43c>] 
(do_early_param+0x6c/0xd0)
> [    0.000000] [<c087f43c>] (do_early_param) from [<c003cba0>] 
(parse_args+0x238/0x3d0)
> [    0.000000] [<c003cba0>] (parse_args) from [<c087f814>] 
(parse_early_options+0x38/0x40)
> [    0.000000] [<c087f814>] (parse_early_options) from [<c087f84c>] 
(parse_early_param+0x30/0x40)
> [    0.000000] [<c087f84c>] (parse_early_param) from [<c088206c>] 
(setup_arch+0x4b4/0x974)
> [    0.000000] [<c088206c>] (setup_arch) from [<c087f8f8>] 
(start_kernel+0x98/0x3a8)
> [    0.000000] [<c087f8f8>] (start_kernel) from [<80008074>] 
(0x80008074)
> [    0.000000] ---[ end trace cb88537fdc8fa200 ]---
> [    0.000000] cma: Reserved 128 MiB at a7800000
> [    0.000000] Memory policy: Data cache writealloc
> [    0.000000] On node 0 totalpages: 524032
> [    0.000000] free_area_init_node: node 0, pgdat c091cc00, node_mem_map 
e67b7000
> [    0.000000]   Normal zone: 1520 pages used for memmap
> [    0.000000]   Normal zone: 0 pages reserved
> [    0.000000]   Normal zone: 194560 pages, LIFO batch:31
> [    0.000000]   HighMem zone: 2574 pages used for memmap
> [    0.000000]   HighMem zone: 329472 pages, LIFO batch:31
> [    0.000000] PERCPU: Embedded 8 pages/cpu @e6767000 s8832 r8192 d15744 
u32768
> [    0.000000] pcpu-alloc: s8832 r8192 d15744 u32768 alloc=8*4096
> [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on. 
Total pages: 522512
> [    0.000000] Kernel command line: console=ttyS0,115200n8 
ignore_loglevel rootwait ro earlyprintk ip=:::::eth0:dhcp root=/dev/nfs 
nfsroot=192.168.69.100:/srv/nfs/tegra124 drm.debug=0xf cma=128M
>
> Reverting the patch eliminates the warning. earlyprintk does work fine
> for me without this patch.
>
> Thierry


This warning message is caused by specifying 'earlyprintk' in
your command line args. Same problem may happen if you specify 'earlycon'
in your command line args and enable CONFIG_SERIAL_EARLYCON with
the current code without this patch. I think it's appropriate result
letting a developer know that both ways of using earlyprintk are enabled.
With current code, although a developer enables CONFIG_EARLY_PRINTK and
has "console=" arg in command line args, he/she should specify the
'earlyprintk' in command line args also to see early_printk() outputs.
With this patch, simply enabling CONFIG_EARLY_PRINTK and having 'console='
line make you be able to the early_printk().

Nonetheless I want to retract this patch. It's good for ARM, but not good
for other architectures such as x86. And, because CONFIG_EARLY_PRINTK is
depending on DEBUG_LL in ARM, making a relation with "console=" is absurd.
(see strcmp(param, "console") == 0 && strcmp(p->str, "earlyprintk") == 0)

- Sahara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-29  5:28   ` Sahara
@ 2014-08-29 15:56     ` Stephen Warren
  2014-09-01  2:28       ` Sahara
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Warren @ 2014-08-29 15:56 UTC (permalink / raw)
  To: Sahara, Thierry Reding
  Cc: akpm, keun-o.park, hpa, rafael.j.wysocki, peterz, rusty,
	kirill.shutemov, oleg, prarit, linux-kernel

On 08/28/2014 11:28 PM, Sahara wrote:
>
>
> On Wed, 27 Aug 2014, Thierry Reding wrote:
>
>> On Thu, Aug 14, 2014 at 07:13:36PM +0900, kpark3469@gmail.com wrote:
>>> From: Sahara <keun-o.park@windriver.com>
>>>
>>> Although there are many obs_kernel_param and its names are
>>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>>> see the early_printk output properly until now. This patch
>>> considers earlycon as well as earlyprintk.
>>>
>>> Signed-off-by: Sahara <keun-o.park@windriver.com>
>>> ---
>>>  init/main.c |    3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/init/main.c b/init/main.c
>>> index bb1aed9..235d248 100644
>>> --- a/init/main.c
>>> +++ b/init/main.c
>>> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char
> *val, const char *unused)
>>>      for (p = __setup_start; p < __setup_end; p++) {
>>>          if ((p->early && parameq(param, p->str)) ||
>>>              (strcmp(param, "console") == 0 &&
>>> -             strcmp(p->str, "earlycon") == 0)
>>> +             ((strcmp(p->str, "earlycon") == 0) ||
>>> +             (strcmp(p->str, "earlyprintk") == 0)))
>>>          ) {
>>>              if (p->setup_func(val) != 0)
>>>                  pr_warn("Malformed early option '%s'\n",
> param);
>>
>> It seems like this patch causes the following warning for me during
>> boot:
>>
>> [    0.000000] Booting Linux on physical CPU 0x0
>> [    0.000000] Initializing cgroup subsys cpu
>> [    0.000000] Initializing cgroup subsys cpuacct
>> [    0.000000] Linux version 3.17.0-rc2-next-20140827
> (thierry.reding@ulmo) (gcc version 4.9.0 (GCC) ) #18 SMP PREEMPT Wed Aug
> 27 17:08:12 CEST 2014
>> [    0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7),
> cr=10c5387d
>> [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction
> cache
>> [    0.000000] Machine model: NVIDIA Tegra124 Jetson TK1
>> [    0.000000] bootconsole [earlycon0] enabled
>> [    0.000000] debug: ignoring loglevel setting.
>> [    0.000000] ------------[ cut here ]------------
>> [    0.000000] WARNING: CPU: 0 PID: 0 at
> /home/thierry.reding/src/kernel/linux-work.git/kernel/printk/printk.c:2402
> register_console+0x60/0x37c()
>> [    0.000000] console 'earlycon0' already registered
>> [    0.000000] Modules linked in:
>> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
> 3.17.0-rc2-next-20140827 #18
>> [    0.000000] [<c0015fec>] (unwind_backtrace) from [<c0011aac>]
> (show_stack+0x10/0x14)
>> [    0.000000] [<c0011aac>] (show_stack) from [<c062b700>]
> (dump_stack+0x98/0xd8)
>> [    0.000000] [<c062b700>] (dump_stack) from [<c0025ba0>]
> (warn_slowpath_common+0x70/0x8c)
>> [    0.000000] [<c0025ba0>] (warn_slowpath_common) from [<c0025bec>]
> (warn_slowpath_fmt+0x30/0x40)
>> [    0.000000] [<c0025bec>] (warn_slowpath_fmt) from [<c00639b8>]
> (register_console+0x60/0x37c)
>> [    0.000000] [<c00639b8>] (register_console) from [<c0883870>]
> (setup_early_printk+0x20/0x28)
>> [    0.000000] [<c0883870>] (setup_early_printk) from [<c087f43c>]
> (do_early_param+0x6c/0xd0)
>> [    0.000000] [<c087f43c>] (do_early_param) from [<c003cba0>]
> (parse_args+0x238/0x3d0)
>> [    0.000000] [<c003cba0>] (parse_args) from [<c087f814>]
> (parse_early_options+0x38/0x40)
>> [    0.000000] [<c087f814>] (parse_early_options) from [<c087f84c>]
> (parse_early_param+0x30/0x40)
>> [    0.000000] [<c087f84c>] (parse_early_param) from [<c088206c>]
> (setup_arch+0x4b4/0x974)
>> [    0.000000] [<c088206c>] (setup_arch) from [<c087f8f8>]
> (start_kernel+0x98/0x3a8)
>> [    0.000000] [<c087f8f8>] (start_kernel) from [<80008074>]
> (0x80008074)
>> [    0.000000] ---[ end trace cb88537fdc8fa200 ]---
>> [    0.000000] cma: Reserved 128 MiB at a7800000
>> [    0.000000] Memory policy: Data cache writealloc
>> [    0.000000] On node 0 totalpages: 524032
>> [    0.000000] free_area_init_node: node 0, pgdat c091cc00, node_mem_map
> e67b7000
>> [    0.000000]   Normal zone: 1520 pages used for memmap
>> [    0.000000]   Normal zone: 0 pages reserved
>> [    0.000000]   Normal zone: 194560 pages, LIFO batch:31
>> [    0.000000]   HighMem zone: 2574 pages used for memmap
>> [    0.000000]   HighMem zone: 329472 pages, LIFO batch:31
>> [    0.000000] PERCPU: Embedded 8 pages/cpu @e6767000 s8832 r8192 d15744
> u32768
>> [    0.000000] pcpu-alloc: s8832 r8192 d15744 u32768 alloc=8*4096
>> [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
>> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
> Total pages: 522512
>> [    0.000000] Kernel command line: console=ttyS0,115200n8
> ignore_loglevel rootwait ro earlyprintk ip=:::::eth0:dhcp root=/dev/nfs
> nfsroot=192.168.69.100:/srv/nfs/tegra124 drm.debug=0xf cma=128M
>>
>> Reverting the patch eliminates the warning. earlyprintk does work fine
>> for me without this patch.
>>
>> Thierry
>
>
> This warning message is caused by specifying 'earlyprintk' in
> your command line args. Same problem may happen if you specify 'earlycon'
> in your command line args and enable CONFIG_SERIAL_EARLYCON with
> the current code without this patch. I think it's appropriate result
> letting a developer know that both ways of using earlyprintk are enabled.
> With current code, although a developer enables CONFIG_EARLY_PRINTK and
> has "console=" arg in command line args, he/she should specify the
> 'earlyprintk' in command line args also to see early_printk() outputs.
> With this patch, simply enabling CONFIG_EARLY_PRINTK and having 'console='
> line make you be able to the early_printk().
>
> Nonetheless I want to retract this patch. It's good for ARM, but not good
> for other architectures such as x86. And, because CONFIG_EARLY_PRINTK is
> depending on DEBUG_LL in ARM, making a relation with "console=" is absurd.
> (see strcmp(param, "console") == 0 && strcmp(p->str, "earlyprintk") == 0)

Even on ARM, this patch feels like the wrong thing. After all, I can 
build a DEBUG_LL enabled multi-platform kernel, and boot it on a bunch 
of different SoCs. However, earlyprintk will only work on one (or zero) 
of those SoCs, and hence shouldn't automatically enable itself; 
specifically requesting activation using the earlyprintk kernel 
command-line parameter is the correct approach.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-08-29 15:56     ` Stephen Warren
@ 2014-09-01  2:28       ` Sahara
  2014-09-02 15:12         ` Stephen Warren
  0 siblings, 1 reply; 11+ messages in thread
From: Sahara @ 2014-09-01  2:28 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Sahara, Thierry Reding, akpm, keun-o.park, hpa, rafael.j.wysocki,
	peterz, rusty, kirill.shutemov, oleg, prarit, linux-kernel



On Fri, 29 Aug 2014, Stephen Warren wrote:

> On 08/28/2014 11:28 PM, Sahara wrote:
>> 
>> 
>> On Wed, 27 Aug 2014, Thierry Reding wrote:
>> 
>>> On Thu, Aug 14, 2014 at 07:13:36PM +0900, kpark3469@gmail.com wrote:
>>>> From: Sahara <keun-o.park@windriver.com>
>>>> 
>>>> Although there are many obs_kernel_param and its names are
>>>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>>>> see the early_printk output properly until now. This patch
>>>> considers earlycon as well as earlyprintk.
>>>> 
>>>> Signed-off-by: Sahara <keun-o.park@windriver.com>
>>>> ---
>>>>  init/main.c |    3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>> 
>>>> diff --git a/init/main.c b/init/main.c
>>>> index bb1aed9..235d248 100644
>>>> --- a/init/main.c
>>>> +++ b/init/main.c
>>>> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char
>> *val, const char *unused)
>>>>      for (p = __setup_start; p < __setup_end; p++) {
>>>>          if ((p->early && parameq(param, p->str)) ||
>>>>              (strcmp(param, "console") == 0 &&
>>>> -             strcmp(p->str, "earlycon") == 0)
>>>> +             ((strcmp(p->str, "earlycon") == 0) ||
>>>> +             (strcmp(p->str, "earlyprintk") == 0)))
>>>>          ) {
>>>>              if (p->setup_func(val) != 0)
>>>>                  pr_warn("Malformed early option '%s'\n",
>> param);
>>> 
>>> It seems like this patch causes the following warning for me during
>>> boot:
>>> 
>>> [    0.000000] Booting Linux on physical CPU 0x0
>>> [    0.000000] Initializing cgroup subsys cpu
>>> [    0.000000] Initializing cgroup subsys cpuacct
>>> [    0.000000] Linux version 3.17.0-rc2-next-20140827
>> (thierry.reding@ulmo) (gcc version 4.9.0 (GCC) ) #18 SMP PREEMPT Wed Aug
>> 27 17:08:12 CEST 2014
>>> [    0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7),
>> cr=10c5387d
>>> [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction
>> cache
>>> [    0.000000] Machine model: NVIDIA Tegra124 Jetson TK1
>>> [    0.000000] bootconsole [earlycon0] enabled
>>> [    0.000000] debug: ignoring loglevel setting.
>>> [    0.000000] ------------[ cut here ]------------
>>> [    0.000000] WARNING: CPU: 0 PID: 0 at
>> /home/thierry.reding/src/kernel/linux-work.git/kernel/printk/printk.c:2402
>> register_console+0x60/0x37c()
>>> [    0.000000] console 'earlycon0' already registered
>>> [    0.000000] Modules linked in:
>>> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
>> 3.17.0-rc2-next-20140827 #18
>>> [    0.000000] [<c0015fec>] (unwind_backtrace) from [<c0011aac>]
>> (show_stack+0x10/0x14)
>>> [    0.000000] [<c0011aac>] (show_stack) from [<c062b700>]
>> (dump_stack+0x98/0xd8)
>>> [    0.000000] [<c062b700>] (dump_stack) from [<c0025ba0>]
>> (warn_slowpath_common+0x70/0x8c)
>>> [    0.000000] [<c0025ba0>] (warn_slowpath_common) from [<c0025bec>]
>> (warn_slowpath_fmt+0x30/0x40)
>>> [    0.000000] [<c0025bec>] (warn_slowpath_fmt) from [<c00639b8>]
>> (register_console+0x60/0x37c)
>>> [    0.000000] [<c00639b8>] (register_console) from [<c0883870>]
>> (setup_early_printk+0x20/0x28)
>>> [    0.000000] [<c0883870>] (setup_early_printk) from [<c087f43c>]
>> (do_early_param+0x6c/0xd0)
>>> [    0.000000] [<c087f43c>] (do_early_param) from [<c003cba0>]
>> (parse_args+0x238/0x3d0)
>>> [    0.000000] [<c003cba0>] (parse_args) from [<c087f814>]
>> (parse_early_options+0x38/0x40)
>>> [    0.000000] [<c087f814>] (parse_early_options) from [<c087f84c>]
>> (parse_early_param+0x30/0x40)
>>> [    0.000000] [<c087f84c>] (parse_early_param) from [<c088206c>]
>> (setup_arch+0x4b4/0x974)
>>> [    0.000000] [<c088206c>] (setup_arch) from [<c087f8f8>]
>> (start_kernel+0x98/0x3a8)
>>> [    0.000000] [<c087f8f8>] (start_kernel) from [<80008074>]
>> (0x80008074)
>>> [    0.000000] ---[ end trace cb88537fdc8fa200 ]---
>>> [    0.000000] cma: Reserved 128 MiB at a7800000
>>> [    0.000000] Memory policy: Data cache writealloc
>>> [    0.000000] On node 0 totalpages: 524032
>>> [    0.000000] free_area_init_node: node 0, pgdat c091cc00, node_mem_map
>> e67b7000
>>> [    0.000000]   Normal zone: 1520 pages used for memmap
>>> [    0.000000]   Normal zone: 0 pages reserved
>>> [    0.000000]   Normal zone: 194560 pages, LIFO batch:31
>>> [    0.000000]   HighMem zone: 2574 pages used for memmap
>>> [    0.000000]   HighMem zone: 329472 pages, LIFO batch:31
>>> [    0.000000] PERCPU: Embedded 8 pages/cpu @e6767000 s8832 r8192 d15744
>> u32768
>>> [    0.000000] pcpu-alloc: s8832 r8192 d15744 u32768 alloc=8*4096
>>> [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
>>> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
>> Total pages: 522512
>>> [    0.000000] Kernel command line: console=ttyS0,115200n8
>> ignore_loglevel rootwait ro earlyprintk ip=:::::eth0:dhcp root=/dev/nfs
>> nfsroot=192.168.69.100:/srv/nfs/tegra124 drm.debug=0xf cma=128M
>>> 
>>> Reverting the patch eliminates the warning. earlyprintk does work fine
>>> for me without this patch.
>>> 
>>> Thierry
>> 
>> 
>> This warning message is caused by specifying 'earlyprintk' in
>> your command line args. Same problem may happen if you specify 'earlycon'
>> in your command line args and enable CONFIG_SERIAL_EARLYCON with
>> the current code without this patch. I think it's appropriate result
>> letting a developer know that both ways of using earlyprintk are enabled.
>> With current code, although a developer enables CONFIG_EARLY_PRINTK and
>> has "console=" arg in command line args, he/she should specify the
>> 'earlyprintk' in command line args also to see early_printk() outputs.
>> With this patch, simply enabling CONFIG_EARLY_PRINTK and having 'console='
>> line make you be able to the early_printk().
>> 
>> Nonetheless I want to retract this patch. It's good for ARM, but not good
>> for other architectures such as x86. And, because CONFIG_EARLY_PRINTK is
>> depending on DEBUG_LL in ARM, making a relation with "console=" is absurd.
>> (see strcmp(param, "console") == 0 && strcmp(p->str, "earlyprintk") == 0)
>
> Even on ARM, this patch feels like the wrong thing. After all, I can build a 
> DEBUG_LL enabled multi-platform kernel, and boot it on a bunch of different 
> SoCs. However, earlyprintk will only work on one (or zero) of those SoCs, and 
> hence shouldn't automatically enable itself; specifically requesting 
> activation using the earlyprintk kernel command-line parameter is the correct 
> approach.
>

So you are saying, because DEBUG_LL didn't work on several SoCs, using the
earlyprintk in command line args is the correct approach?
You are misunderstanding how it works. On ARM with enabling multi-platform
kernel, you should choose a specific low-level debug port for DEBUG_LL.
For example, if you have OMAP ZOOM3, you should select
CONFIG_DEBUG_ZOOM_UART from menu.
If you chose a right port for your SoCs and if it didn't work properly,
that means its port code should be fixed. (Please report it.)
All the code for low-level debugging is located at arch/arm/include/debug.

- Sahara

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] earlyprintk: re-enable earlyprintk calling early_param
  2014-09-01  2:28       ` Sahara
@ 2014-09-02 15:12         ` Stephen Warren
  0 siblings, 0 replies; 11+ messages in thread
From: Stephen Warren @ 2014-09-02 15:12 UTC (permalink / raw)
  To: Sahara
  Cc: Thierry Reding, akpm, keun-o.park, hpa, rafael.j.wysocki, peterz,
	rusty, kirill.shutemov, oleg, prarit, linux-kernel

On 08/31/2014 08:28 PM, Sahara wrote:
>
>
> On Fri, 29 Aug 2014, Stephen Warren wrote:
>
>> On 08/28/2014 11:28 PM, Sahara wrote:
>>>
>>>
>>> On Wed, 27 Aug 2014, Thierry Reding wrote:
>>>
>>>> On Thu, Aug 14, 2014 at 07:13:36PM +0900, kpark3469@gmail.com wrote:
>>>>> From: Sahara <keun-o.park@windriver.com>
>>>>>
>>>>> Although there are many obs_kernel_param and its names are
>>>>> earlyprintk and also EARLY_PRINTK is also enabled, we could not
>>>>> see the early_printk output properly until now. This patch
>>>>> considers earlycon as well as earlyprintk.
>>>>>
>>>>> Signed-off-by: Sahara <keun-o.park@windriver.com>
>>>>> ---
>>>>>  init/main.c |    3 ++-
>>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/init/main.c b/init/main.c
>>>>> index bb1aed9..235d248 100644
>>>>> --- a/init/main.c
>>>>> +++ b/init/main.c
>>>>> @@ -426,7 +426,8 @@ static int __init do_early_param(char *param, char
>>> *val, const char *unused)
>>>>>      for (p = __setup_start; p < __setup_end; p++) {
>>>>>          if ((p->early && parameq(param, p->str)) ||
>>>>>              (strcmp(param, "console") == 0 &&
>>>>> -             strcmp(p->str, "earlycon") == 0)
>>>>> +             ((strcmp(p->str, "earlycon") == 0) ||
>>>>> +             (strcmp(p->str, "earlyprintk") == 0)))
>>>>>          ) {
>>>>>              if (p->setup_func(val) != 0)
>>>>>                  pr_warn("Malformed early option '%s'\n",
>>> param);
>>>>
>>>> It seems like this patch causes the following warning for me during
>>>> boot:
>>>>
>>>> [    0.000000] Booting Linux on physical CPU 0x0
>>>> [    0.000000] Initializing cgroup subsys cpu
>>>> [    0.000000] Initializing cgroup subsys cpuacct
>>>> [    0.000000] Linux version 3.17.0-rc2-next-20140827
>>> (thierry.reding@ulmo) (gcc version 4.9.0 (GCC) ) #18 SMP PREEMPT Wed Aug
>>> 27 17:08:12 CEST 2014
>>>> [    0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7),
>>> cr=10c5387d
>>>> [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT
>>>> instruction
>>> cache
>>>> [    0.000000] Machine model: NVIDIA Tegra124 Jetson TK1
>>>> [    0.000000] bootconsole [earlycon0] enabled
>>>> [    0.000000] debug: ignoring loglevel setting.
>>>> [    0.000000] ------------[ cut here ]------------
>>>> [    0.000000] WARNING: CPU: 0 PID: 0 at
>>> /home/thierry.reding/src/kernel/linux-work.git/kernel/printk/printk.c:2402
>>>
>>> register_console+0x60/0x37c()
>>>> [    0.000000] console 'earlycon0' already registered
>>>> [    0.000000] Modules linked in:
>>>> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
>>> 3.17.0-rc2-next-20140827 #18
>>>> [    0.000000] [<c0015fec>] (unwind_backtrace) from [<c0011aac>]
>>> (show_stack+0x10/0x14)
>>>> [    0.000000] [<c0011aac>] (show_stack) from [<c062b700>]
>>> (dump_stack+0x98/0xd8)
>>>> [    0.000000] [<c062b700>] (dump_stack) from [<c0025ba0>]
>>> (warn_slowpath_common+0x70/0x8c)
>>>> [    0.000000] [<c0025ba0>] (warn_slowpath_common) from [<c0025bec>]
>>> (warn_slowpath_fmt+0x30/0x40)
>>>> [    0.000000] [<c0025bec>] (warn_slowpath_fmt) from [<c00639b8>]
>>> (register_console+0x60/0x37c)
>>>> [    0.000000] [<c00639b8>] (register_console) from [<c0883870>]
>>> (setup_early_printk+0x20/0x28)
>>>> [    0.000000] [<c0883870>] (setup_early_printk) from [<c087f43c>]
>>> (do_early_param+0x6c/0xd0)
>>>> [    0.000000] [<c087f43c>] (do_early_param) from [<c003cba0>]
>>> (parse_args+0x238/0x3d0)
>>>> [    0.000000] [<c003cba0>] (parse_args) from [<c087f814>]
>>> (parse_early_options+0x38/0x40)
>>>> [    0.000000] [<c087f814>] (parse_early_options) from [<c087f84c>]
>>> (parse_early_param+0x30/0x40)
>>>> [    0.000000] [<c087f84c>] (parse_early_param) from [<c088206c>]
>>> (setup_arch+0x4b4/0x974)
>>>> [    0.000000] [<c088206c>] (setup_arch) from [<c087f8f8>]
>>> (start_kernel+0x98/0x3a8)
>>>> [    0.000000] [<c087f8f8>] (start_kernel) from [<80008074>]
>>> (0x80008074)
>>>> [    0.000000] ---[ end trace cb88537fdc8fa200 ]---
>>>> [    0.000000] cma: Reserved 128 MiB at a7800000
>>>> [    0.000000] Memory policy: Data cache writealloc
>>>> [    0.000000] On node 0 totalpages: 524032
>>>> [    0.000000] free_area_init_node: node 0, pgdat c091cc00,
>>>> node_mem_map
>>> e67b7000
>>>> [    0.000000]   Normal zone: 1520 pages used for memmap
>>>> [    0.000000]   Normal zone: 0 pages reserved
>>>> [    0.000000]   Normal zone: 194560 pages, LIFO batch:31
>>>> [    0.000000]   HighMem zone: 2574 pages used for memmap
>>>> [    0.000000]   HighMem zone: 329472 pages, LIFO batch:31
>>>> [    0.000000] PERCPU: Embedded 8 pages/cpu @e6767000 s8832 r8192
>>>> d15744
>>> u32768
>>>> [    0.000000] pcpu-alloc: s8832 r8192 d15744 u32768 alloc=8*4096
>>>> [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
>>>> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
>>> Total pages: 522512
>>>> [    0.000000] Kernel command line: console=ttyS0,115200n8
>>> ignore_loglevel rootwait ro earlyprintk ip=:::::eth0:dhcp root=/dev/nfs
>>> nfsroot=192.168.69.100:/srv/nfs/tegra124 drm.debug=0xf cma=128M
>>>>
>>>> Reverting the patch eliminates the warning. earlyprintk does work fine
>>>> for me without this patch.
>>>>
>>>> Thierry
>>>
>>>
>>> This warning message is caused by specifying 'earlyprintk' in
>>> your command line args. Same problem may happen if you specify
>>> 'earlycon'
>>> in your command line args and enable CONFIG_SERIAL_EARLYCON with
>>> the current code without this patch. I think it's appropriate result
>>> letting a developer know that both ways of using earlyprintk are
>>> enabled.
>>> With current code, although a developer enables CONFIG_EARLY_PRINTK and
>>> has "console=" arg in command line args, he/she should specify the
>>> 'earlyprintk' in command line args also to see early_printk() outputs.
>>> With this patch, simply enabling CONFIG_EARLY_PRINTK and having
>>> 'console='
>>> line make you be able to the early_printk().
>>>
>>> Nonetheless I want to retract this patch. It's good for ARM, but not
>>> good
>>> for other architectures such as x86. And, because CONFIG_EARLY_PRINTK is
>>> depending on DEBUG_LL in ARM, making a relation with "console=" is
>>> absurd.
>>> (see strcmp(param, "console") == 0 && strcmp(p->str, "earlyprintk")
>>> == 0)
>>
>> Even on ARM, this patch feels like the wrong thing. After all, I can
>> build a DEBUG_LL enabled multi-platform kernel, and boot it on a bunch
>> of different SoCs. However, earlyprintk will only work on one (or
>> zero) of those SoCs, and hence shouldn't automatically enable itself;
>> specifically requesting activation using the earlyprintk kernel
>> command-line parameter is the correct approach.
>>
>
> So you are saying, because DEBUG_LL didn't work on several SoCs, using the
> earlyprintk in command line args is the correct approach?

No, I'm saying: Kconfig options DEBUG_LL/CONFIG_EARLY_PRINTK add code 
into the kernel. The earlyprintk command-line option activates the early 
printk feature at run-time.

> You are misunderstanding how it works. On ARM with enabling multi-platform
> kernel, you should choose a specific low-level debug port for DEBUG_LL.

Actually, I am well aware of how the feature works and use it daily.

> For example, if you have OMAP ZOOM3, you should select
> CONFIG_DEBUG_ZOOM_UART from menu.
> If you chose a right port for your SoCs and if it didn't work properly,
> that means its port code should be fixed. (Please report it.)

Everything works fine for me, at least on Tegra, for both Tegra-specific 
and IIRC also for multi-platform kernels (although I don't use those often).

> All the code for low-level debugging is located at arch/arm/include/debug.

I know.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-09-02 15:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14 10:13 [PATCH] earlyprintk: re-enable earlyprintk calling early_param kpark3469
2014-08-14 20:34 ` Andrew Morton
2014-08-18  2:51   ` Sahara
2014-08-15 18:34 ` Rusty Russell
2014-08-18  3:13   ` Sahara
2014-08-19  2:14     ` Keun-O Park
2014-08-27 15:15 ` Thierry Reding
2014-08-29  5:28   ` Sahara
2014-08-29 15:56     ` Stephen Warren
2014-09-01  2:28       ` Sahara
2014-09-02 15:12         ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.