public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 0/7] riscv: Correctly handle IPIs already pending upon boot
Date: Mon, 21 Sep 2020 07:51:34 -0400	[thread overview]
Message-ID: <20200921115141.70598-1-seanga2@gmail.com> (raw)

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(-)

-- 
2.28.0

             reply	other threads:[~2020-09-21 11:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 11:51 Sean Anderson [this message]
2020-09-21 11:51 ` [PATCH v3 1/7] Revert "riscv: Clear pending interrupts before enabling IPIs" Sean Anderson
2020-09-22  0:56   ` Rick Chen
2020-09-21 11:51 ` [PATCH v3 2/7] riscv: Match memory barriers between send_ipi_many and handle_ipi Sean Anderson
2020-09-21 11:51 ` [PATCH v3 3/7] riscv: Use a valid bit to ignore already-pending IPIs Sean Anderson
2020-09-21 11:51 ` [PATCH v3 4/7] riscv: Clear pending IPIs on initialization Sean Anderson
2020-09-22  0:58   ` Rick Chen
2020-09-21 11:51 ` [PATCH v3 5/7] riscv: Consolidate fences into AMOs for available_harts_lock Sean Anderson
2020-09-21 11:51 ` [PATCH v3 6/7] riscv: Ensure gp is NULL or points to valid data Sean Anderson
2020-09-22  1:05   ` Rick Chen
2020-09-21 11:51 ` [PATCH v3 7/7] riscv: Add some comments to start.S Sean Anderson
2020-09-21 16:23   ` Heinrich Schuchardt
2020-09-21 16:40     ` Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200921115141.70598-1-seanga2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox