[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240301130532.3953167-1-chenhuacai@loongson.cn>
Date: Fri, 1 Mar 2024 21:05:31 +0800
From: Huacai Chen <chenhuacai@...ngson.cn>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>,
Arnd Bergmann <arnd@...db.de>
Cc: Huacai Chen <chenhuacai@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
Guo Ren <guoren@...nel.org>,
Rui Wang <wangrui@...ngson.cn>,
WANG Xuerui <kernel@...0n.name>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org,
Huacai Chen <chenhuacai@...ngson.cn>
Subject: [PATCH 1/2] mmiowb: Rename mmiowb_spin_{lock, unlock}() to mmiowb_in_{lock, unlock}()
We are extending mmiowb tracking system from spinlock to mutex, so
rename mmiowb_spin_{lock, unlock}() to mmiowb_in_{lock, unlock}() to
reflect the fact. No functional changes.
Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
---
include/asm-generic/mmiowb.h | 8 ++++----
include/linux/spinlock.h | 6 +++---
kernel/locking/spinlock_debug.c | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/asm-generic/mmiowb.h b/include/asm-generic/mmiowb.h
index 5698fca3bf56..eb2335f9f35e 100644
--- a/include/asm-generic/mmiowb.h
+++ b/include/asm-generic/mmiowb.h
@@ -40,13 +40,13 @@ static inline void mmiowb_set_pending(void)
ms->mmiowb_pending = ms->nesting_count;
}
-static inline void mmiowb_spin_lock(void)
+static inline void mmiowb_in_lock(void)
{
struct mmiowb_state *ms = __mmiowb_state();
ms->nesting_count++;
}
-static inline void mmiowb_spin_unlock(void)
+static inline void mmiowb_in_unlock(void)
{
struct mmiowb_state *ms = __mmiowb_state();
@@ -59,7 +59,7 @@ static inline void mmiowb_spin_unlock(void)
}
#else
#define mmiowb_set_pending() do { } while (0)
-#define mmiowb_spin_lock() do { } while (0)
-#define mmiowb_spin_unlock() do { } while (0)
+#define mmiowb_in_lock() do { } while (0)
+#define mmiowb_in_unlock() do { } while (0)
#endif /* CONFIG_MMIOWB */
#endif /* __ASM_GENERIC_MMIOWB_H */
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 3fcd20de6ca8..60eda70cddd0 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -185,7 +185,7 @@ static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock)
{
__acquire(lock);
arch_spin_lock(&lock->raw_lock);
- mmiowb_spin_lock();
+ mmiowb_in_lock();
}
static inline int do_raw_spin_trylock(raw_spinlock_t *lock)
@@ -193,14 +193,14 @@ static inline int do_raw_spin_trylock(raw_spinlock_t *lock)
int ret = arch_spin_trylock(&(lock)->raw_lock);
if (ret)
- mmiowb_spin_lock();
+ mmiowb_in_lock();
return ret;
}
static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
{
- mmiowb_spin_unlock();
+ mmiowb_in_unlock();
arch_spin_unlock(&lock->raw_lock);
__release(lock);
}
diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c
index 87b03d2e41db..632a88322433 100644
--- a/kernel/locking/spinlock_debug.c
+++ b/kernel/locking/spinlock_debug.c
@@ -114,7 +114,7 @@ void do_raw_spin_lock(raw_spinlock_t *lock)
{
debug_spin_lock_before(lock);
arch_spin_lock(&lock->raw_lock);
- mmiowb_spin_lock();
+ mmiowb_in_lock();
debug_spin_lock_after(lock);
}
@@ -123,7 +123,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock)
int ret = arch_spin_trylock(&lock->raw_lock);
if (ret) {
- mmiowb_spin_lock();
+ mmiowb_in_lock();
debug_spin_lock_after(lock);
}
#ifndef CONFIG_SMP
@@ -137,7 +137,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock)
void do_raw_spin_unlock(raw_spinlock_t *lock)
{
- mmiowb_spin_unlock();
+ mmiowb_in_unlock();
debug_spin_unlock(lock);
arch_spin_unlock(&lock->raw_lock);
}
--
2.43.0
Powered by blists - more mailing lists