diff options
author | Anup Patel <anup.patel@wdc.com> | 2018-12-16 11:21:16 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2018-12-16 11:21:16 +0300 |
commit | 8a4088c3af85f6515c9b3e371bc6c1fae2a7e9dc (patch) | |
tree | 15d3ff4e4905693b2ef8164bb41309217a50bb12 /plat/common/sys | |
parent | 385b5afe7d5e8d5d552637973955155862de2a79 (diff) | |
download | opensbi-8a4088c3af85f6515c9b3e371bc6c1fae2a7e9dc.tar.xz |
plat: clint: Reduce use of atomic operation on IPI registers
Currently, we aggresively use atomic operation on CLINT IPI
register. This patch simplify CLINT IPI APIs by reducing use
of atomic operations. In future, we will gradually increase
use of atomic operations for CLINT IPI APIs.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'plat/common/sys')
-rw-r--r-- | plat/common/sys/clint.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/plat/common/sys/clint.c b/plat/common/sys/clint.c index b6c6e9b..e84c382 100644 --- a/plat/common/sys/clint.c +++ b/plat/common/sys/clint.c @@ -22,8 +22,7 @@ void clint_ipi_inject(u32 target_hart, u32 source_hart) return; /* Set CLINT IPI */ - __io_bw(); - atomic_raw_xchg_uint(&clint_ipi[target_hart], 1); + writel(1, &clint_ipi[target_hart]); } void clint_ipi_sync(u32 target_hart, u32 source_hart) @@ -41,15 +40,12 @@ void clint_ipi_sync(u32 target_hart, u32 source_hart) if (!target_ipi) break; - __io_bw(); incoming_ipi |= atomic_raw_xchg_uint(&clint_ipi[source_hart], 0); } - if (incoming_ipi) { - __io_bw(); - atomic_raw_xchg_uint(&clint_ipi[source_hart], incoming_ipi); - } + if (incoming_ipi) + writel(incoming_ipi, &clint_ipi[source_hart]); } void clint_ipi_clear(u32 target_hart) @@ -58,8 +54,7 @@ void clint_ipi_clear(u32 target_hart) return; /* Clear CLINT IPI */ - __io_bw(); - atomic_raw_xchg_uint(&clint_ipi[target_hart], 0); + writel(0, &clint_ipi[target_hart]); } int clint_warm_ipi_init(u32 target_hart) |