From 8a4088c3af85f6515c9b3e371bc6c1fae2a7e9dc Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Sun, 16 Dec 2018 13:51:16 +0530 Subject: [PATCH] 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 --- plat/common/sys/clint.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plat/common/sys/clint.c b/plat/common/sys/clint.c index b6c6e9b3..e84c3829 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)