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 v11 13/21] riscv: Clear pending interrupts before enabling IPIs
Date: Wed, 20 May 2020 02:41:03 -0400	[thread overview]
Message-ID: <20200520064111.317605-14-seanga2@gmail.com> (raw)
In-Reply-To: <20200520064111.317605-1-seanga2@gmail.com>

On some platforms (k210), the previous stage bootloader may have not
cleared pending IPIs before transferring control to U-Boot. This can cause
race conditions, as multiple harts all attempt to initialize the IPI
controller at once. This patch clears IPIs before enabling them, ensuring
that only one hart modifies shared memory at once.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
---

Changes in v7:
- Split of into its own patch

 arch/riscv/cpu/start.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index 5f1c220e0c..f408e41ab9 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -65,6 +65,8 @@ _start:
 #else
 	li	t0, SIE_SSIE
 #endif
+	/* Clear any pending IPIs */
+	csrc	MODE_PREFIX(ip), t0
 	csrs	MODE_PREFIX(ie), t0
 #endif
 
-- 
2.26.2

  parent reply	other threads:[~2020-05-20  6:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  6:40 [PATCH v11 00/21] riscv: Add Sipeed Maix support Sean Anderson
2020-05-20  6:40 ` [PATCH v11 01/21] clk: Always use the supplied struct clk Sean Anderson
2020-05-20  6:40 ` [PATCH v11 02/21] clk: Check that ops of composite clock components exist before calling Sean Anderson
2020-05-20  6:40 ` [PATCH v11 03/21] clk: Unconditionally recursively en-/dis-able clocks Sean Anderson
2020-05-20  6:40 ` [PATCH v11 04/21] clk: Fix clk_get_by_* handling of index Sean Anderson
2020-05-20  6:40 ` [PATCH v11 05/21] clk: Add K210 pll support Sean Anderson
2020-05-20  6:40 ` [PATCH v11 06/21] clk: Add a bypass clock for K210 Sean Anderson
2020-05-20  6:40 ` [PATCH v11 07/21] clk: Add K210 clock support Sean Anderson
2020-05-20  6:40 ` [PATCH v11 08/21] dm: Add support for simple-pm-bus Sean Anderson
2020-05-20  6:40 ` [PATCH v11 09/21] dm: Fix error handling for dev_read_addr_ptr Sean Anderson
2020-05-20  6:41 ` [PATCH v11 10/21] reset: Add generic reset driver Sean Anderson
2020-05-20  6:41 ` [PATCH v11 11/21] lib: Always set errno in hcreate_r Sean Anderson
2020-05-20  6:41 ` [PATCH v11 12/21] riscv: Add headers for asm/global_data.h Sean Anderson
2020-05-20  6:41 ` Sean Anderson [this message]
2020-05-20  6:41 ` [PATCH v11 14/21] riscv: Clean up IPI initialization code Sean Anderson
2020-05-20  7:52   ` Rick Chen
2020-05-20  6:41 ` [PATCH v11 15/21] riscv: Add option to support RISC-V privileged spec 1.9 Sean Anderson
2020-05-20  6:41 ` [PATCH v11 16/21] riscv: Allow use of reset drivers Sean Anderson
2020-05-20  6:41 ` [PATCH v11 17/21] riscv: Try to get cpu frequency from a "clocks" node if it exists Sean Anderson
2020-05-20  6:41 ` [PATCH v11 18/21] riscv: Enable cpu clock if it is present Sean Anderson
2020-05-20  6:41 ` [PATCH v11 19/21] riscv: Add device tree for K210 and Sipeed Maix BitM Sean Anderson
2020-05-20  6:41 ` [PATCH v11 20/21] doc: riscv: Add documentation for Sipeed Maix Bit Sean Anderson
2020-05-20  6:41 ` [PATCH v11 21/21] riscv: Add Sipeed Maix support 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=20200520064111.317605-14-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