public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h
@ 2022-07-13 21:53 Ben Dooks
  2022-07-14  6:33 ` Conor.Dooley
  2022-08-11 21:06 ` Palmer Dabbelt
  0 siblings, 2 replies; 6+ messages in thread
From: Ben Dooks @ 2022-07-13 21:53 UTC (permalink / raw)
  To: linux-riscv
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Sudip Mukherjee,
	Jude Onyenegecha, Ben Dooks

Running sparse shows cpu_ops_spinwait.c is missing two definitions
found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static?
arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
---
 arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/kernel/cpu_ops_spinwait.c b/arch/riscv/kernel/cpu_ops_spinwait.c
index 346847f6c41c..c662a7cf10a4 100644
--- a/arch/riscv/kernel/cpu_ops_spinwait.c
+++ b/arch/riscv/kernel/cpu_ops_spinwait.c
@@ -11,6 +11,8 @@
 #include <asm/sbi.h>
 #include <asm/smp.h>
 
+#include "head.h"
+
 const struct cpu_operations cpu_ops_spinwait;
 void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data");
 void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data");
-- 
2.35.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h
  2022-07-13 21:53 [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h Ben Dooks
@ 2022-07-14  6:33 ` Conor.Dooley
  2022-07-14  7:29   ` Ben Dooks
  2022-08-11 21:06 ` Palmer Dabbelt
  1 sibling, 1 reply; 6+ messages in thread
From: Conor.Dooley @ 2022-07-14  6:33 UTC (permalink / raw)
  To: ben.dooks, linux-riscv
  Cc: paul.walmsley, palmer, aou, sudip.mukherjee, jude.onyenegecha

On 13/07/2022 22:53, Ben Dooks wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Running sparse shows cpu_ops_spinwait.c is missing two definitions
> found in head.h, so include it to stop the following warnings:
> 
> arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static?
> arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?
> 
> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>

Hey Ben,
With this applied I still see a:
arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?

Seems to be in the same ballpack, so maybe you could fix that one too?

FWIW:
# CONFIG_RISCV_BOOT_SPINWAIT is not set
Thanks,
Conor.

> ---
>   arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/riscv/kernel/cpu_ops_spinwait.c b/arch/riscv/kernel/cpu_ops_spinwait.c
> index 346847f6c41c..c662a7cf10a4 100644
> --- a/arch/riscv/kernel/cpu_ops_spinwait.c
> +++ b/arch/riscv/kernel/cpu_ops_spinwait.c
> @@ -11,6 +11,8 @@
>   #include <asm/sbi.h>
>   #include <asm/smp.h>
> 
> +#include "head.h"
> +
>   const struct cpu_operations cpu_ops_spinwait;
>   void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data");
>   void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data");
> --
> 2.35.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h
  2022-07-14  6:33 ` Conor.Dooley
@ 2022-07-14  7:29   ` Ben Dooks
  2022-07-14  7:41     ` Conor.Dooley
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Dooks @ 2022-07-14  7:29 UTC (permalink / raw)
  To: Conor.Dooley, linux-riscv
  Cc: paul.walmsley, palmer, aou, sudip.mukherjee, jude.onyenegecha

On 14/07/2022 07:33, Conor.Dooley@microchip.com wrote:
> On 13/07/2022 22:53, Ben Dooks wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> Running sparse shows cpu_ops_spinwait.c is missing two definitions
>> found in head.h, so include it to stop the following warnings:
>>
>> arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static?
>> arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?
>>
>> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
> 
> Hey Ben,
> With this applied I still see a:
> arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?
> 
> Seems to be in the same ballpack, so maybe you could fix that one too?

I've done that as a new patch in case it needs to be moved.
Not sure head.h was the right place nor where it ended up.

-- 
Ben

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h
  2022-07-14  7:29   ` Ben Dooks
@ 2022-07-14  7:41     ` Conor.Dooley
  2022-08-11 21:06       ` Palmer Dabbelt
  0 siblings, 1 reply; 6+ messages in thread
From: Conor.Dooley @ 2022-07-14  7:41 UTC (permalink / raw)
  To: ben.dooks, linux-riscv
  Cc: paul.walmsley, palmer, aou, sudip.mukherjee, jude.onyenegecha

On 14/07/2022 08:29, Ben Dooks wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 14/07/2022 07:33, Conor.Dooley@microchip.com wrote:
>> On 13/07/2022 22:53, Ben Dooks wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>
>>> Running sparse shows cpu_ops_spinwait.c is missing two definitions
>>> found in head.h, so include it to stop the following warnings:
>>>
>>> arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static?
>>> arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?
>>>
>>> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
>>
>> Hey Ben,
>> With this applied I still see a:
>> arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?
>>
>> Seems to be in the same ballpack, so maybe you could fix that one too?
> 
> I've done that as a new patch in case it needs to be moved.
> Not sure head.h was the right place nor where it ended up.

This is a rabbit hole man. I found another one while checking by
build logs to check that that one had been fixed. I'll send a patch
this time..

For this one:
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h
  2022-07-14  7:41     ` Conor.Dooley
@ 2022-08-11 21:06       ` Palmer Dabbelt
  0 siblings, 0 replies; 6+ messages in thread
From: Palmer Dabbelt @ 2022-08-11 21:06 UTC (permalink / raw)
  To: Conor.Dooley
  Cc: ben.dooks, linux-riscv, Paul Walmsley, aou, sudip.mukherjee,
	jude.onyenegecha

On Thu, 14 Jul 2022 00:41:12 PDT (-0700), Conor.Dooley@microchip.com wrote:
> On 14/07/2022 08:29, Ben Dooks wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>> 
>> On 14/07/2022 07:33, Conor.Dooley@microchip.com wrote:
>>> On 13/07/2022 22:53, Ben Dooks wrote:
>>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>>
>>>> Running sparse shows cpu_ops_spinwait.c is missing two definitions
>>>> found in head.h, so include it to stop the following warnings:
>>>>
>>>> arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static?
>>>> arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?
>>>>
>>>> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
>>>
>>> Hey Ben,
>>> With this applied I still see a:
>>> arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?
>>>
>>> Seems to be in the same ballpack, so maybe you could fix that one too?
>> 
>> I've done that as a new patch in case it needs to be moved.
>> Not sure head.h was the right place nor where it ended up.
> 
> This is a rabbit hole man. I found another one while checking by
> build logs to check that that one had been fixed. I'll send a patch
> this time..
> 
> For this one:
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

IMO we also need something like this

    diff --git a/arch/riscv/kernel/cpu_ops.c b/arch/riscv/kernel/cpu_ops.c
    index 170d07e57721..f92c0e6eddb1 100644
    --- a/arch/riscv/kernel/cpu_ops.c
    +++ b/arch/riscv/kernel/cpu_ops.c
    @@ -15,9 +15,7 @@
     const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
    
     extern const struct cpu_operations cpu_ops_sbi;
    -#ifdef CONFIG_RISCV_BOOT_SPINWAIT
    -extern const struct cpu_operations cpu_ops_spinwait;
    -#else
    +#ifndef CONFIG_RISCV_BOOT_SPINWAIT
     const struct cpu_operations cpu_ops_spinwait = {
            .name           = "",
            .cpu_prepare    = NULL,

I squashed that in and added a CONFIG_RISCV_BOOT_SPINWAIT=y test, as 
defconfig is =n now.  I'm not seeing these warnings, but it's cleaner 
this way.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h
  2022-07-13 21:53 [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h Ben Dooks
  2022-07-14  6:33 ` Conor.Dooley
@ 2022-08-11 21:06 ` Palmer Dabbelt
  1 sibling, 0 replies; 6+ messages in thread
From: Palmer Dabbelt @ 2022-08-11 21:06 UTC (permalink / raw)
  To: ben.dooks
  Cc: linux-riscv, Paul Walmsley, aou, sudip.mukherjee,
	jude.onyenegecha, ben.dooks

On Wed, 13 Jul 2022 14:53:06 PDT (-0700), ben.dooks@sifive.com wrote:
> Running sparse shows cpu_ops_spinwait.c is missing two definitions
> found in head.h, so include it to stop the following warnings:
>
> arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static?
> arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?
>
> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
> ---
>  arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/kernel/cpu_ops_spinwait.c b/arch/riscv/kernel/cpu_ops_spinwait.c
> index 346847f6c41c..c662a7cf10a4 100644
> --- a/arch/riscv/kernel/cpu_ops_spinwait.c
> +++ b/arch/riscv/kernel/cpu_ops_spinwait.c
> @@ -11,6 +11,8 @@
>  #include <asm/sbi.h>
>  #include <asm/smp.h>
>
> +#include "head.h"
> +
>  const struct cpu_operations cpu_ops_spinwait;
>  void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data");
>  void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data");

Thanks, this is on for-next.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2022-08-11 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-13 21:53 [PATCH] RISC-V: cpu_ops_spinwait.c should include head.h Ben Dooks
2022-07-14  6:33 ` Conor.Dooley
2022-07-14  7:29   ` Ben Dooks
2022-07-14  7:41     ` Conor.Dooley
2022-08-11 21:06       ` Palmer Dabbelt
2022-08-11 21:06 ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox