linux-imx/rust/helpers
Eder Zulian 00ccce23e1 rust: helpers: Avoid raw_spin_lock initialization for PREEMPT_RT
[ Upstream commit 5c2e7736e20d9b348a44cafbfa639fe2653fbc34 ]

When PREEMPT_RT=y, spin locks are mapped to rt_mutex types, so using
spinlock_check() + __raw_spin_lock_init() to initialize spin locks is
incorrect, and would cause build errors.

Introduce __spin_lock_init() to initialize a spin lock with lockdep
rquired information for PREEMPT_RT builds, and use it in the Rust
helper.

Fixes: d2d6422f8b ("x86: Allow to enable PREEMPT_RT.")
Closes: https://lore.kernel.org/oe-kbuild-all/202409251238.vetlgXE9-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Eder Zulian <ezulian@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Tested-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20241107163223.2092690-2-ezulian@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-05 14:01:23 +01:00
..
blk.c
bug.c
build_assert.c
build_bug.c
err.c
helpers.c rust: rbtree: add red-black tree implementation backed by the C version 2024-08-31 17:35:08 +02:00
kunit.c
mutex.c rust: mutex: fix __mutex_init() usage in case of PREEMPT_RT 2024-09-26 21:22:15 +02:00
page.c
rbtree.c rust: rbtree: add red-black tree implementation backed by the C version 2024-08-31 17:35:08 +02:00
refcount.c
signal.c
slab.c
spinlock.c rust: helpers: Avoid raw_spin_lock initialization for PREEMPT_RT 2024-12-05 14:01:23 +01:00
task.c
uaccess.c
wait.c
workqueue.c