Skip to content

riscv: Correctly handle IPIs already pending upon boot

Sean Anderson u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 0 repliesNew
  2. v27 patches 0 repliesSuperseded
  3. v10 of 7 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Rename riscv_ipi_init_secondary_hart to dummy_pending_ipi_clear
- Only compile dummy_pending_ipi_clear when SMP is enabled
- Clarify XIP comment
- Updated and expanded most commit messages

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Revert "riscv: Clear pending interrupts before enabling IPIs"arch/riscv/cpu/start.S+0 -21 reply
2/7riscv: Match memory barriers between send_ipi_many and handle_ipiarch/riscv/lib/smp.c+2 -00 replies
3/7riscv: Use a valid bit to ignore already-pending IPIsarch/riscv/include/asm/smp.h arch/riscv/lib/smp.c+21 -20 replies
4/7riscv: Clear pending IPIs on initializationarch/riscv/cpu/cpu.c+20 -01 reply
5/7riscv: Consolidate fences into AMOs for available_harts_lockarch/riscv/cpu/start.S+3 -60 replies
6/7riscv: Ensure gp is NULL or points to valid dataarch/riscv/cpu/start.S arch/riscv/lib/interrupts.c+27 -41 reply
7/7riscv: Add some comments to start.Sarch/riscv/cpu/start.S+17 -21 reply
7/7riscv: Add some comments to start.S+0 -00 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchBin MengRick ChenLeo Liang
1/7R-b R-b
2/7R-b R-b R-b
3/7R-b R-b R-b
4/7R-b R-b
5/7R-b R-b
6/7R-b R-b
7/7R-b R-b R-b
7/7R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/7] riscv: Correctly handle IPIs already pending upon boot

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 at gmx.de/

Changes in v3:
- Rename riscv_ipi_init_secondary_hart to dummy_pending_ipi_clear
- Only compile dummy_pending_ipi_clear when SMP is enabled
- Clarify XIP comment
- Updated and expanded most commit messages

Changes in v2:
- Use a valid bit instead of addr to validate IPIs
- Make riscv_ipi_init_secondary_hart static
- Remove fences after amoswaps
- Set gp early with XIP
- Clarify comments regarding tp

Sean Anderson (7):
Revert "riscv: Clear pending interrupts before enabling IPIs"
riscv: Match memory barriers between send_ipi_many and handle_ipi
riscv: Use a valid bit to ignore already-pending IPIs
riscv: Clear pending IPIs on initialization
riscv: Consolidate fences into AMOs for 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         | 20 +++++++++++++
 arch/riscv/cpu/start.S       | 58 ++++++++++++++++++++++++++++--------
 arch/riscv/include/asm/smp.h |  7 +++++
 arch/riscv/lib/interrupts.c  |  3 +-
 arch/riscv/lib/smp.c         | 16 +++++++++-
 5 files changed, 89 insertions(+), 15 deletions(-)
Signature · 1 line
2.28.0