From e1c13aed4a1641550e8c9518c96f016e1d52d09b Mon Sep 17 00:00:00 2001 From: Yijie Yang Date: Tue, 11 Aug 2026 16:46:47 +0800 Subject: dt-bindings: interconnect: qcom-bwmon: Add Maili cpu-bwmon compatible Add the Qualcomm Maili SoC compatible string for the CPU bandwidth monitor (BWMONv4). This falls back to the sdm845-bwmon compatible, consistent with the existing pattern used by other recent SoCs such as sm8750 and kaanapali. Signed-off-by: Yijie Yang Acked-by: Krzysztof Kozlowski Reviewed-by: Jingyi Wang Link: https://patch.msgid.link/20260811-bwmon-v2-1-80f7f150ab9e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- tools/perf/util/rwsem.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tools/perf/util/rwsem.c (limited to 'tools/perf/util/rwsem.c') diff --git a/tools/perf/util/rwsem.c b/tools/perf/util/rwsem.c new file mode 100644 index 000000000..9d2683239 --- /dev/null +++ b/tools/perf/util/rwsem.c @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "util.h" +#include "rwsem.h" + +#if RWS_ERRORCHECK +#include "mutex.h" +#endif + +int init_rwsem(struct rw_semaphore *sem) +{ +#if RWS_ERRORCHECK + mutex_init(&sem->mtx); + return 0; +#else + return pthread_rwlock_init(&sem->lock, NULL); +#endif +} + +int exit_rwsem(struct rw_semaphore *sem) +{ +#if RWS_ERRORCHECK + mutex_destroy(&sem->mtx); + return 0; +#else + return pthread_rwlock_destroy(&sem->lock); +#endif +} + +int down_read(struct rw_semaphore *sem) + NO_THREAD_SAFETY_ANALYSIS +{ +#if RWS_ERRORCHECK + mutex_lock(&sem->mtx); + return 0; +#else + return perf_singlethreaded ? 0 : pthread_rwlock_rdlock(&sem->lock); +#endif +} + +int up_read(struct rw_semaphore *sem) + NO_THREAD_SAFETY_ANALYSIS +{ +#if RWS_ERRORCHECK + mutex_unlock(&sem->mtx); + return 0; +#else + return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); +#endif +} + +int down_write(struct rw_semaphore *sem) + NO_THREAD_SAFETY_ANALYSIS +{ +#if RWS_ERRORCHECK + mutex_lock(&sem->mtx); + return 0; +#else + return perf_singlethreaded ? 0 : pthread_rwlock_wrlock(&sem->lock); +#endif +} + +int up_write(struct rw_semaphore *sem) + NO_THREAD_SAFETY_ANALYSIS +{ +#if RWS_ERRORCHECK + mutex_unlock(&sem->mtx); + return 0; +#else + return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); +#endif +} -- cgit v1.3.1