From 223293205a7265c8b02882461ba8996650048ade Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 06:33:33 +0000
Subject: [PATCH] audio ok
---
kernel/include/linux/spinlock_rt.h | 45 ++++++++++++++++++++++-----------------------
1 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/kernel/include/linux/spinlock_rt.h b/kernel/include/linux/spinlock_rt.h
index 3696a77..3085132 100644
--- a/kernel/include/linux/spinlock_rt.h
+++ b/kernel/include/linux/spinlock_rt.h
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
#ifndef __LINUX_SPINLOCK_RT_H
#define __LINUX_SPINLOCK_RT_H
@@ -19,10 +20,10 @@
} while (0)
extern void __lockfunc rt_spin_lock(spinlock_t *lock);
-extern unsigned long __lockfunc rt_spin_lock_trace_flags(spinlock_t *lock);
extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass);
+extern void __lockfunc rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock);
extern void __lockfunc rt_spin_unlock(spinlock_t *lock);
-extern void __lockfunc rt_spin_unlock_wait(spinlock_t *lock);
+extern void __lockfunc rt_spin_lock_unlock(spinlock_t *lock);
extern int __lockfunc rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags);
extern int __lockfunc rt_spin_trylock_bh(spinlock_t *lock);
extern int __lockfunc rt_spin_trylock(spinlock_t *lock);
@@ -68,6 +69,12 @@
rt_spin_lock_nested(lock, subclass); \
} while (0)
+# define spin_lock_nest_lock(lock, subclass) \
+ do { \
+ typecheck(struct lockdep_map *, &(subclass)->dep_map); \
+ rt_spin_lock_nest_lock(lock, &(subclass)->dep_map); \
+ } while (0)
+
# define spin_lock_irqsave_nested(lock, flags, subclass) \
do { \
typecheck(unsigned long, flags); \
@@ -75,14 +82,15 @@
rt_spin_lock_nested(lock, subclass); \
} while (0)
#else
-# define spin_lock_nested(lock, subclass) spin_lock(lock)
-# define spin_lock_bh_nested(lock, subclass) spin_lock_bh(lock)
+# define spin_lock_nested(lock, subclass) spin_lock(((void)(subclass), (lock)))
+# define spin_lock_nest_lock(lock, subclass) spin_lock(((void)(subclass), (lock)))
+# define spin_lock_bh_nested(lock, subclass) spin_lock_bh(((void)(subclass), (lock)))
# define spin_lock_irqsave_nested(lock, flags, subclass) \
do { \
typecheck(unsigned long, flags); \
flags = 0; \
- spin_lock(lock); \
+ spin_lock(((void)(subclass), (lock))); \
} while (0)
#endif
@@ -92,20 +100,6 @@
flags = 0; \
spin_lock(lock); \
} while (0)
-
-static inline unsigned long spin_lock_trace_flags(spinlock_t *lock)
-{
- unsigned long flags = 0;
-#ifdef CONFIG_TRACE_IRQFLAGS
- flags = rt_spin_lock_trace_flags(lock);
-#else
- spin_lock(lock); /* lock_local */
-#endif
- return flags;
-}
-
-/* FIXME: we need rt_spin_lock_nest_lock */
-#define spin_lock_nest_lock(lock, nest_lock) spin_lock_nested(lock, 0)
#define spin_unlock(lock) rt_spin_unlock(lock)
@@ -127,10 +121,15 @@
#define spin_trylock_bh(lock) __cond_lock(lock, rt_spin_trylock_bh(lock))
#define spin_trylock_irq(lock) spin_trylock(lock)
-#define spin_trylock_irqsave(lock, flags) \
- rt_spin_trylock_irqsave(lock, &(flags))
-
-#define spin_unlock_wait(lock) rt_spin_unlock_wait(lock)
+#define spin_trylock_irqsave(lock, flags) \
+({ \
+ int __locked; \
+ \
+ typecheck(unsigned long, flags); \
+ flags = 0; \
+ __locked = spin_trylock(lock); \
+ __locked; \
+})
#ifdef CONFIG_GENERIC_LOCKBREAK
# define spin_is_contended(lock) ((lock)->break_lock)
--
Gitblit v1.6.2