diff mbox series

[6/7] riscv: Remove CONFIG_IS_ENABLED(SMP) in global data

Message ID 1586353273-12255-6-git-send-email-bmeng.cn@gmail.com
State New
Headers show
Series [1/7] riscv: qemu: Remove the simple-bus driver for the SoC node | expand

Commit Message

Bin Meng April 8, 2020, 1:41 p.m. UTC
Currently generic-asm-offsets.h and asm-offsets.h are generated based
on U-Boot proper config options. The same asm-offsets files are used
when building U-Boot SPL/TPL.

But the generated macros, e.g.: GD_AVAILABLE_HARTS, create potential
mismatch if U-Boot proper has different config options from U-Boot
SPL/TPL, like in this case, SMP.

Remove CONFIG_IS_ENABLED(SMP) in global data to get a consistent value
of GD_AVAILABLE_HARTS.

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

 arch/riscv/include/asm/global_data.h | 2 --
 1 file changed, 2 deletions(-)

Comments

Atish Patra April 11, 2020, 1:01 a.m. UTC | #1
On Wed, Apr 8, 2020 at 6:42 AM Bin Meng <bmeng.cn at gmail.com> wrote:
>
> Currently generic-asm-offsets.h and asm-offsets.h are generated based
> on U-Boot proper config options. The same asm-offsets files are used
> when building U-Boot SPL/TPL.
>
> But the generated macros, e.g.: GD_AVAILABLE_HARTS, create potential
> mismatch if U-Boot proper has different config options from U-Boot
> SPL/TPL, like in this case, SMP.
>
> Remove CONFIG_IS_ENABLED(SMP) in global data to get a consistent value
> of GD_AVAILABLE_HARTS.
>
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> ---
>
>  arch/riscv/include/asm/global_data.h | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h
> index 72fb4b4..dc9ba1f 100644
> --- a/arch/riscv/include/asm/global_data.h
> +++ b/arch/riscv/include/asm/global_data.h
> @@ -24,9 +24,7 @@ struct arch_global_data {
>  #ifdef CONFIG_ANDES_PLMT
>         void __iomem *plmt;     /* plmt base address */
>  #endif
> -#if CONFIG_IS_ENABLED(SMP)
>         struct ipi_data ipi[CONFIG_NR_CPUS];
> -#endif
>  #ifndef CONFIG_XIP
>         ulong available_harts;
>  #endif

CONFIG_NR_CPUS is only defined for SMP/SPL_SMP. It will result in
compilation error if somebody tries to compile non-smp u-boot.

How about moving available_harts to the top right after boot_hart?

> --
> 2.7.4
>


--
Regards,
Atish
Bin Meng April 11, 2020, 4:23 a.m. UTC | #2
On Sat, Apr 11, 2020 at 9:02 AM Atish Patra <atishp at atishpatra.org> wrote:
>
> On Wed, Apr 8, 2020 at 6:42 AM Bin Meng <bmeng.cn at gmail.com> wrote:
> >
> > Currently generic-asm-offsets.h and asm-offsets.h are generated based
> > on U-Boot proper config options. The same asm-offsets files are used
> > when building U-Boot SPL/TPL.
> >
> > But the generated macros, e.g.: GD_AVAILABLE_HARTS, create potential
> > mismatch if U-Boot proper has different config options from U-Boot
> > SPL/TPL, like in this case, SMP.
> >
> > Remove CONFIG_IS_ENABLED(SMP) in global data to get a consistent value
> > of GD_AVAILABLE_HARTS.
> >
> > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> > ---
> >
> >  arch/riscv/include/asm/global_data.h | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h
> > index 72fb4b4..dc9ba1f 100644
> > --- a/arch/riscv/include/asm/global_data.h
> > +++ b/arch/riscv/include/asm/global_data.h
> > @@ -24,9 +24,7 @@ struct arch_global_data {
> >  #ifdef CONFIG_ANDES_PLMT
> >         void __iomem *plmt;     /* plmt base address */
> >  #endif
> > -#if CONFIG_IS_ENABLED(SMP)
> >         struct ipi_data ipi[CONFIG_NR_CPUS];
> > -#endif
> >  #ifndef CONFIG_XIP
> >         ulong available_harts;
> >  #endif
>
> CONFIG_NR_CPUS is only defined for SMP/SPL_SMP. It will result in
> compilation error if somebody tries to compile non-smp u-boot.
>

Yes, I noticed when I looked at the CI testing results. Will fix in v2.

> How about moving available_harts to the top right after boot_hart?
>

Sound good to me.

Regards,
Bin
diff mbox series

Patch

diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h
index 72fb4b4..dc9ba1f 100644
--- a/arch/riscv/include/asm/global_data.h
+++ b/arch/riscv/include/asm/global_data.h
@@ -24,9 +24,7 @@  struct arch_global_data {
 #ifdef CONFIG_ANDES_PLMT
 	void __iomem *plmt;	/* plmt base address */
 #endif
-#if CONFIG_IS_ENABLED(SMP)
 	struct ipi_data ipi[CONFIG_NR_CPUS];
-#endif
 #ifndef CONFIG_XIP
 	ulong available_harts;
 #endif