All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP
@ 2021-05-06  2:02 Youling Tang
  2021-05-06  2:19 ` Randy Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Youling Tang @ 2021-05-06  2:02 UTC (permalink / raw)
  To: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

On the Loongson64 platform, if CONFIG_SMP is not set, the following build
error will occur:
arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' undeclared

Because the definition and declaration of secondary_kexec_args are in the
CONFIG_SMP, the secondary_kexec_args variable should be used in CONFIG_SMP.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
 arch/mips/loongson64/reset.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/mips/loongson64/reset.c b/arch/mips/loongson64/reset.c
index c97bfdc..758d5d2 100644
--- a/arch/mips/loongson64/reset.c
+++ b/arch/mips/loongson64/reset.c
@@ -126,11 +126,12 @@ static void loongson_kexec_shutdown(void)
 	for_each_possible_cpu(cpu)
 		if (!cpu_online(cpu))
 			cpu_device_up(get_cpu_device(cpu));
+
+	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
 #endif
 	kexec_args[0] = kexec_argc;
 	kexec_args[1] = fw_arg1;
 	kexec_args[2] = fw_arg2;
-	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
 	memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE);
 	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
 }
@@ -141,7 +142,9 @@ static void loongson_crash_shutdown(struct pt_regs *regs)
 	kexec_args[0] = kdump_argc;
 	kexec_args[1] = fw_arg1;
 	kexec_args[2] = fw_arg2;
+#ifdef CONFIG_SMP
 	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
+#endif
 	memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE);
 	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
 }
-- 
2.1.0


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

* Re: [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP
  2021-05-06  2:02 [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP Youling Tang
@ 2021-05-06  2:19 ` Randy Dunlap
  2021-05-06  2:34   ` Youling Tang
  2021-05-06  2:21 ` Jinyang He
  2021-05-11 20:42 ` Thomas Bogendoerfer
  2 siblings, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2021-05-06  2:19 UTC (permalink / raw)
  To: Youling Tang, Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel

On 5/5/21 7:02 PM, Youling Tang wrote:
> On the Loongson64 platform, if CONFIG_SMP is not set, the following build
> error will occur:
> arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' undeclared
> 
> Because the definition and declaration of secondary_kexec_args are in the
> CONFIG_SMP, the secondary_kexec_args variable should be used in CONFIG_SMP.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>  arch/mips/loongson64/reset.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/loongson64/reset.c b/arch/mips/loongson64/reset.c
> index c97bfdc..758d5d2 100644
> --- a/arch/mips/loongson64/reset.c
> +++ b/arch/mips/loongson64/reset.c
> @@ -126,11 +126,12 @@ static void loongson_kexec_shutdown(void)
>  	for_each_possible_cpu(cpu)
>  		if (!cpu_online(cpu))
>  			cpu_device_up(get_cpu_device(cpu));
> +
> +	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>  #endif
>  	kexec_args[0] = kexec_argc;
>  	kexec_args[1] = fw_arg1;
>  	kexec_args[2] = fw_arg2;
> -	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>  	memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE);
>  	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>  }
> @@ -141,7 +142,9 @@ static void loongson_crash_shutdown(struct pt_regs *regs)
>  	kexec_args[0] = kdump_argc;
>  	kexec_args[1] = fw_arg1;
>  	kexec_args[2] = fw_arg2;
> +#ifdef CONFIG_SMP
>  	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
> +#endif
>  	memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE);
>  	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>  }
> 


Acked-by: Randy Dunlap <rdunlap@infradead.org>

Yep, slightly better than my version:
https://lore.kernel.org/lkml/20210430205055.13594-1-rdunlap@infradead.org/

-- 
~Randy


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

* Re: [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP
  2021-05-06  2:02 [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP Youling Tang
  2021-05-06  2:19 ` Randy Dunlap
@ 2021-05-06  2:21 ` Jinyang He
  2021-05-06  3:02   ` Youling Tang
  2021-05-11 20:42 ` Thomas Bogendoerfer
  2 siblings, 1 reply; 6+ messages in thread
From: Jinyang He @ 2021-05-06  2:21 UTC (permalink / raw)
  To: Youling Tang, Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel, Randy Dunlap

On 05/06/2021 10:02 AM, Youling Tang wrote:

> On the Loongson64 platform, if CONFIG_SMP is not set, the following build
> error will occur:
> arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' undeclared
>
> Because the definition and declaration of secondary_kexec_args are in the
> CONFIG_SMP, the secondary_kexec_args variable should be used in CONFIG_SMP.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>   arch/mips/loongson64/reset.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/loongson64/reset.c b/arch/mips/loongson64/reset.c
> index c97bfdc..758d5d2 100644
> --- a/arch/mips/loongson64/reset.c
> +++ b/arch/mips/loongson64/reset.c
> @@ -126,11 +126,12 @@ static void loongson_kexec_shutdown(void)
>   	for_each_possible_cpu(cpu)
>   		if (!cpu_online(cpu))
>   			cpu_device_up(get_cpu_device(cpu));
> +
> +	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>   #endif
>   	kexec_args[0] = kexec_argc;
>   	kexec_args[1] = fw_arg1;
>   	kexec_args[2] = fw_arg2;
> -	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>   	memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE);
>   	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>   }
> @@ -141,7 +142,9 @@ static void loongson_crash_shutdown(struct pt_regs *regs)
>   	kexec_args[0] = kdump_argc;
>   	kexec_args[1] = fw_arg1;
>   	kexec_args[2] = fw_arg2;
> +#ifdef CONFIG_SMP
>   	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
> +#endif
>   	memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE);
>   	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>   }

Hi, Youling,

The earlier fix is here,
https://lkml.org/lkml/2021/4/30/874

Thanks.


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

* Re: [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP
  2021-05-06  2:19 ` Randy Dunlap
@ 2021-05-06  2:34   ` Youling Tang
  0 siblings, 0 replies; 6+ messages in thread
From: Youling Tang @ 2021-05-06  2:34 UTC (permalink / raw)
  To: Randy Dunlap, Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel

Hi,Randy

On 05/06/2021 10:19 AM, Randy Dunlap wrote:
> On 5/5/21 7:02 PM, Youling Tang wrote:
>> On the Loongson64 platform, if CONFIG_SMP is not set, the following build
>> error will occur:
>> arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' undeclared
>>
>> Because the definition and declaration of secondary_kexec_args are in the
>> CONFIG_SMP, the secondary_kexec_args variable should be used in CONFIG_SMP.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
>> ---
>>   arch/mips/loongson64/reset.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/mips/loongson64/reset.c b/arch/mips/loongson64/reset.c
>> index c97bfdc..758d5d2 100644
>> --- a/arch/mips/loongson64/reset.c
>> +++ b/arch/mips/loongson64/reset.c
>> @@ -126,11 +126,12 @@ static void loongson_kexec_shutdown(void)
>>   	for_each_possible_cpu(cpu)
>>   		if (!cpu_online(cpu))
>>   			cpu_device_up(get_cpu_device(cpu));
>> +
>> +	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>>   #endif
>>   	kexec_args[0] = kexec_argc;
>>   	kexec_args[1] = fw_arg1;
>>   	kexec_args[2] = fw_arg2;
>> -	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>>   	memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE);
>>   	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>>   }
>> @@ -141,7 +142,9 @@ static void loongson_crash_shutdown(struct pt_regs *regs)
>>   	kexec_args[0] = kdump_argc;
>>   	kexec_args[1] = fw_arg1;
>>   	kexec_args[2] = fw_arg2;
>> +#ifdef CONFIG_SMP
>>   	secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>> +#endif
>>   	memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE);
>>   	memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>>   }
>>
>
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
>
> Yep, slightly better than my version:
> https://lore.kernel.org/lkml/20210430205055.13594-1-rdunlap@infradead.org/
Sorry, I didn’t see the patch you sent at that time.

Thanks,
Youling.


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

* Re: [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP
  2021-05-06  2:21 ` Jinyang He
@ 2021-05-06  3:02   ` Youling Tang
  0 siblings, 0 replies; 6+ messages in thread
From: Youling Tang @ 2021-05-06  3:02 UTC (permalink / raw)
  To: Jinyang He; +Cc: linux-mips, linux-kernel

Hi, Jinyang

On 05/06/2021 10:21 AM, Jinyang He wrote:
> On 05/06/2021 10:02 AM, Youling Tang wrote:
>
>> On the Loongson64 platform, if CONFIG_SMP is not set, the following 
>> build
>> error will occur:
>> arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' 
>> undeclared
>>
>> Because the definition and declaration of secondary_kexec_args are in 
>> the
>> CONFIG_SMP, the secondary_kexec_args variable should be used in 
>> CONFIG_SMP.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
>> ---
>>   arch/mips/loongson64/reset.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/mips/loongson64/reset.c b/arch/mips/loongson64/reset.c
>> index c97bfdc..758d5d2 100644
>> --- a/arch/mips/loongson64/reset.c
>> +++ b/arch/mips/loongson64/reset.c
>> @@ -126,11 +126,12 @@ static void loongson_kexec_shutdown(void)
>>       for_each_possible_cpu(cpu)
>>           if (!cpu_online(cpu))
>>               cpu_device_up(get_cpu_device(cpu));
>> +
>> +    secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>>   #endif
>>       kexec_args[0] = kexec_argc;
>>       kexec_args[1] = fw_arg1;
>>       kexec_args[2] = fw_arg2;
>> -    secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>>       memcpy((void *)fw_arg1, kexec_argv, KEXEC_ARGV_SIZE);
>>       memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>>   }
>> @@ -141,7 +142,9 @@ static void loongson_crash_shutdown(struct 
>> pt_regs *regs)
>>       kexec_args[0] = kdump_argc;
>>       kexec_args[1] = fw_arg1;
>>       kexec_args[2] = fw_arg2;
>> +#ifdef CONFIG_SMP
>>       secondary_kexec_args[0] = TO_UNCAC(0x3ff01000);
>> +#endif
>>       memcpy((void *)fw_arg1, kdump_argv, KEXEC_ARGV_SIZE);
>>       memcpy((void *)fw_arg2, kexec_envp, KEXEC_ENVP_SIZE);
>>   }
>
> Hi, Youling,
>
> The earlier fix is here,
> https://lkml.org/lkml/2021/4/30/874
>
Thank you for reminding me.

Thanks,
Youling.
> Thanks.


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

* Re: [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP
  2021-05-06  2:02 [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP Youling Tang
  2021-05-06  2:19 ` Randy Dunlap
  2021-05-06  2:21 ` Jinyang He
@ 2021-05-11 20:42 ` Thomas Bogendoerfer
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Bogendoerfer @ 2021-05-11 20:42 UTC (permalink / raw)
  To: Youling Tang; +Cc: Huacai Chen, Jiaxun Yang, linux-mips, linux-kernel

On Thu, May 06, 2021 at 10:02:50AM +0800, Youling Tang wrote:
> On the Loongson64 platform, if CONFIG_SMP is not set, the following build
> error will occur:
> arch/mips/loongson64/reset.c:133:2: error:'secondary_kexec_args' undeclared
> 
> Because the definition and declaration of secondary_kexec_args are in the
> CONFIG_SMP, the secondary_kexec_args variable should be used in CONFIG_SMP.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>  arch/mips/loongson64/reset.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2021-05-11 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  2:02 [PATCH] MIPS: Loongson64: Fix build error 'secondary_kexec_args' undeclared under !SMP Youling Tang
2021-05-06  2:19 ` Randy Dunlap
2021-05-06  2:34   ` Youling Tang
2021-05-06  2:21 ` Jinyang He
2021-05-06  3:02   ` Youling Tang
2021-05-11 20:42 ` Thomas Bogendoerfer

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.