diff mbox series

[v2] RISC-V: Fix use of non existent CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK

Message ID 20230906123216.255932-1-wangjiexun@tinylab.org (mailing list archive)
State Superseded, archived
Headers show
Series [v2] RISC-V: Fix use of non existent CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be fixes at HEAD e0152e7481c6
conchuod/fixes_present success Fixes tag present in non-next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 2 and now 2
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 39 this patch: 39
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success Fixes tag looks correct
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Jiexun Wang Sept. 6, 2023, 12:32 p.m. UTC
If configuration options SOFTIRQ_ON_OWN_STACK and PREEMPT_RT 
are enabled simultaneously under RISC-V architecture,
it will result in a compilation failure:

arch/riscv/kernel/irq.c:64:6: error: redefinition of 'do_softirq_own_stack'
   64 | void do_softirq_own_stack(void)
      |      ^~~~~~~~~~~~~~~~~~~~
In file included from ./arch/riscv/include/generated/asm/softirq_stack.h:1,
                 from arch/riscv/kernel/irq.c:15:
./include/asm-generic/softirq_stack.h:8:20: note: previous definition of 'do_softirq_own_stack' was here
    8 | static inline void do_softirq_own_stack(void)
      |                    ^~~~~~~~~~~~~~~~~~~~
      
After changing CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK to CONFIG_SOFTIRQ_ON_OWN_STACK,
compilation can be successful.

Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK")
Signed-off-by: Jiexun Wang <wangjiexun@tinylab.org>
---
Changes in v2:
- changed to a more suitable subject line
- add a Fixes tag

---
 arch/riscv/kernel/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guo Ren Sept. 8, 2023, 9:01 a.m. UTC | #1
Thx for fixup.

Reviewed-by: Guo Ren <guoren@kernel.org>

On Wed, Sep 6, 2023 at 8:34 PM Jiexun Wang <wangjiexun@tinylab.org> wrote:
>
> If configuration options SOFTIRQ_ON_OWN_STACK and PREEMPT_RT
> are enabled simultaneously under RISC-V architecture,
> it will result in a compilation failure:
>
> arch/riscv/kernel/irq.c:64:6: error: redefinition of 'do_softirq_own_stack'
>    64 | void do_softirq_own_stack(void)
>       |      ^~~~~~~~~~~~~~~~~~~~
> In file included from ./arch/riscv/include/generated/asm/softirq_stack.h:1,
>                  from arch/riscv/kernel/irq.c:15:
> ./include/asm-generic/softirq_stack.h:8:20: note: previous definition of 'do_softirq_own_stack' was here
>     8 | static inline void do_softirq_own_stack(void)
>       |                    ^~~~~~~~~~~~~~~~~~~~
>
> After changing CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK to CONFIG_SOFTIRQ_ON_OWN_STACK,
> compilation can be successful.
>
> Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK")
> Signed-off-by: Jiexun Wang <wangjiexun@tinylab.org>
> ---
> Changes in v2:
> - changed to a more suitable subject line
> - add a Fixes tag
>
> ---
>  arch/riscv/kernel/irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
> index a8efa053c4a5..a86f272ae2c3 100644
> --- a/arch/riscv/kernel/irq.c
> +++ b/arch/riscv/kernel/irq.c
> @@ -60,7 +60,7 @@ static void init_irq_stacks(void)
>  }
>  #endif /* CONFIG_VMAP_STACK */
>
> -#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
> +#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
>  void do_softirq_own_stack(void)
>  {
>  #ifdef CONFIG_IRQ_STACKS
> --
> 2.34.1
>
Samuel Holland Sept. 9, 2023, 9:20 p.m. UTC | #2
Hi,

The patch is correct, though the subject isn't quite accurate.
CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK exists; it is defined in arch/Kconfig.
It's just the wrong option to use to guard the function definition.

On 9/6/23 07:32, Jiexun Wang wrote:
> If configuration options SOFTIRQ_ON_OWN_STACK and PREEMPT_RT 
> are enabled simultaneously under RISC-V architecture,
> it will result in a compilation failure:
> 
> arch/riscv/kernel/irq.c:64:6: error: redefinition of 'do_softirq_own_stack'
>    64 | void do_softirq_own_stack(void)
>       |      ^~~~~~~~~~~~~~~~~~~~
> In file included from ./arch/riscv/include/generated/asm/softirq_stack.h:1,
>                  from arch/riscv/kernel/irq.c:15:
> ./include/asm-generic/softirq_stack.h:8:20: note: previous definition of 'do_softirq_own_stack' was here
>     8 | static inline void do_softirq_own_stack(void)
>       |                    ^~~~~~~~~~~~~~~~~~~~
>       
> After changing CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK to CONFIG_SOFTIRQ_ON_OWN_STACK,
> compilation can be successful.
> 
> Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK")
> Signed-off-by: Jiexun Wang <wangjiexun@tinylab.org>
> ---
> Changes in v2:
> - changed to a more suitable subject line
> - add a Fixes tag
> 
> ---
>  arch/riscv/kernel/irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
> index a8efa053c4a5..a86f272ae2c3 100644
> --- a/arch/riscv/kernel/irq.c
> +++ b/arch/riscv/kernel/irq.c
> @@ -60,7 +60,7 @@ static void init_irq_stacks(void)
>  }
>  #endif /* CONFIG_VMAP_STACK */
>  
> -#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
> +#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK

It would be good to fix the #endif comment at the bottom of the function
as well.

Regards,
Samuel

>  void do_softirq_own_stack(void)
>  {
>  #ifdef CONFIG_IRQ_STACKS
Conor Dooley Sept. 9, 2023, 9:38 p.m. UTC | #3
On 9 September 2023 22:20:41 IST, Samuel Holland <samuel@sholland.org> wrote:
>Hi,
>
>The patch is correct, though the subject isn't quite accurate.
>CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK exists; it is defined in arch/Kconfig.
>It's just the wrong option to use to guard the function definition.

That's partially my fault, I suggested using something along these lines on the previous
version.
I blame being supposed to be on holidays!
Jiexun Wang Sept. 10, 2023, 12:16 a.m. UTC | #4
On Sat, 9 Sep 2023 16:20:41 -0500, Samuel Holland wrote:
>Hi,
>
>The patch is correct, though the subject isn't quite accurate.
>CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK exists; it is defined in arch/Kconfig.
>It's just the wrong option to use to guard the function definition.
>

I think I should send a new version of the patch with the subject:
RISC-V: Fix wrong use of CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK. 
Does this subject look more appropriate?

>On 9/6/23 07:32, Jiexun Wang wrote:
>> If configuration options SOFTIRQ_ON_OWN_STACK and PREEMPT_RT 
>> are enabled simultaneously under RISC-V architecture,
>> it will result in a compilation failure:
>> 
>> arch/riscv/kernel/irq.c:64:6: error: redefinition of 'do_softirq_own_stack'
>>    64 | void do_softirq_own_stack(void)
>>       |      ^~~~~~~~~~~~~~~~~~~~
>> In file included from ./arch/riscv/include/generated/asm/softirq_stack.h:1,
>>                  from arch/riscv/kernel/irq.c:15:
>> ./include/asm-generic/softirq_stack.h:8:20: note: previous definition of 'do_softirq_own_stack' was here
>>     8 | static inline void do_softirq_own_stack(void)
>>       |                    ^~~~~~~~~~~~~~~~~~~~
>>       
>> After changing CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK to CONFIG_SOFTIRQ_ON_OWN_STACK,
>> compilation can be successful.
>> 
>> Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK")
>> Signed-off-by: Jiexun Wang <wangjiexun@tinylab.org>
>> ---
>> Changes in v2:
>> - changed to a more suitable subject line
>> - add a Fixes tag
>> 
>> ---
>>  arch/riscv/kernel/irq.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
>> index a8efa053c4a5..a86f272ae2c3 100644
>> --- a/arch/riscv/kernel/irq.c
>> +++ b/arch/riscv/kernel/irq.c
>> @@ -60,7 +60,7 @@ static void init_irq_stacks(void)
>>  }
>>  #endif /* CONFIG_VMAP_STACK */
>>  
>> -#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
>> +#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
>
>It would be good to fix the #endif comment at the bottom of the function
>as well.

Thanks, I will fix this as well.

Best regards,
Jiexun Wang

>
>Regards,
>Samuel
>
>>  void do_softirq_own_stack(void)
>>  {
diff mbox series

Patch

diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
index a8efa053c4a5..a86f272ae2c3 100644
--- a/arch/riscv/kernel/irq.c
+++ b/arch/riscv/kernel/irq.c
@@ -60,7 +60,7 @@  static void init_irq_stacks(void)
 }
 #endif /* CONFIG_VMAP_STACK */
 
-#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void)
 {
 #ifdef CONFIG_IRQ_STACKS