[PATCH 0/7] riscv: Correctly handle IPIs already pending upon boot
Rick Chen
rickchen36 at gmail.com
Wed Sep 9 04:02:03 CEST 2020
Hi Sean
> On the K210, the prior stage bootloader does not clear IPIs. This presents
> a problem, because U-Boot up until this point assumes (with one exception)
> that IPIs are cleared when it starts. This series attempts to fix this in a
> robust manner, and fix several concurrency bugs I noticed while fixing
> these other areas. Heinrich previously submitted a patch addressing part of
> this problem in [1].
>
> [1] https://patchwork.ozlabs.org/project/uboot/patch/20200811035648.3284-1-xypron.glpk@gmx.de/
>
It sounds like that the bootloader does not deal with SMP flow well
and jump to u-boot-spl, right ?
I have a question that why not try to fix the prior stage bootloader
to clear IPIs correctly?
Actually I have encounter a similar SMP issue like you.
Our prior stage bootloader will jump to u-boot-spl with the incorrect
mstatus and result in the SMP working abnormal in u-boot-spl.
I mean this is an individual case, not a general case.
If we try to cover any errors which come from any prior stage bootloaders,
the SMP flow will become more and more complicated and hard to debug.
That is why it does not need implement SMP flow in U-Boot proper with
SBI v0.2 HSM extension.
Thanks,
Rick
>
> Sean Anderson (7):
> Revert "riscv: Clear pending interrupts before enabling IPIs"
> riscv: Match memory barriers between send_ipi_many and handle_ipi
> riscv: Use NULL as a sentinel value for smp_call_function
> riscv: Clear pending IPIs on initialization
> riscv: Add fence to available_harts_lock
> riscv: Ensure gp is NULL or points to valid data
> riscv: Add some comments to start.S
>
> arch/riscv/cpu/cpu.c | 18 ++++++++++++++
> arch/riscv/cpu/start.S | 47 +++++++++++++++++++++++++++++--------
> arch/riscv/lib/interrupts.c | 3 ++-
> arch/riscv/lib/smp.c | 26 +++++++++++++++++---
> 4 files changed, 80 insertions(+), 14 deletions(-)
>
> --
> 2.28.0
>
More information about the U-Boot
mailing list