include/asm-generic/qrwlock.h was trying to get arch_spin_is_locked via asm-generic/qspinlock.h. However, this does not work because architectures might be using queued rwlocks but not queued spinlocks (csky), or because they might be defining their own queued_* macros before including asm/qspinlock.h. To fix this, ensure that asm/spinlock.h always includes qrwlock.h after defining arch_spin_is_locked (either directly for csky, or via asm/qspinlock.h for other architectures). The only inclusion elsewhere is in kernel/locking/qrwlock.c. That one is really unnecessary because the file is only compiled in SMP configurations (config QUEUED_RWLOCKS depends on SMP) and in that case linux/spinlock.h already includes asm/qrwlock.h if needed, via asm/spinlock.h.
Unified · Split
| @@ -5,8 +5,8 @@ · 4 unmodified lines | |||
| 5 | #ifndef __ASM_SPINLOCK_H | 5 | #ifndef __ASM_SPINLOCK_H |
| 6 | #define __ASM_SPINLOCK_H | 6 | #define __ASM_SPINLOCK_H |
| 7 | 7 | ||
| 8 | #include <asm/qrwlock.h> | ||
| 9 | #include <asm/qspinlock.h> | 8 | #include <asm/qspinlock.h> |
| 9 | #include <asm/qrwlock.h> | ||
| 10 | 10 | ||
| 11 | /* See include/linux/spinlock.h */ | 11 | /* See include/linux/spinlock.h */ |
| 12 | #define smp_mb__after_spinlock() smp_mb() | 12 | #define smp_mb__after_spinlock() smp_mb() |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | |||
| 10 | #define _ASM_SPINLOCK_H | 10 | #define _ASM_SPINLOCK_H |
| 11 | 11 | ||
| 12 | #include <asm/processor.h> | 12 | #include <asm/processor.h> |
| 13 | #include <asm/qrwlock.h> | ||
| 14 | 13 | ||
| 15 | #include <asm-generic/qspinlock_types.h> | 14 | #include <asm-generic/qspinlock_types.h> |
| 16 | 15 | ||
| @@ -27,5 +26,6 @@ static inline void queued_spin_unlock(struct qspinlock *lock) · 10 unmodified lines | |||
| 27 | } | 26 | } |
| 28 | 27 | ||
| 29 | #include <asm/qspinlock.h> | 28 | #include <asm/qspinlock.h> |
| 29 | #include <asm/qrwlock.h> | ||
| 30 | 30 | ||
| 31 | #endif /* _ASM_SPINLOCK_H */ | 31 | #endif /* _ASM_SPINLOCK_H */ |
| @@ -11,8 +11,8 @@ · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | #include <asm/processor.h> | 12 | #include <asm/processor.h> |
| 13 | #include <asm/barrier.h> | 13 | #include <asm/barrier.h> |
| 14 | #include <asm/qrwlock.h> | ||
| 15 | #include <asm/qspinlock.h> | 14 | #include <asm/qspinlock.h> |
| 15 | #include <asm/qrwlock.h> | ||
| 16 | 16 | ||
| 17 | #endif /* !(__ASSEMBLY__) */ | 17 | #endif /* !(__ASSEMBLY__) */ |
| 18 | 18 | ||
| @@ -12,8 +12,8 @@ · 11 unmodified lines | |||
| 12 | #define _XTENSA_SPINLOCK_H | 12 | #define _XTENSA_SPINLOCK_H |
| 13 | 13 | ||
| 14 | #include <asm/barrier.h> | 14 | #include <asm/barrier.h> |
| 15 | #include <asm/qrwlock.h> | ||
| 16 | #include <asm/qspinlock.h> | 15 | #include <asm/qspinlock.h> |
| 16 | #include <asm/qrwlock.h> | ||
| 17 | 17 | ||
| 18 | #define smp_mb__after_spinlock() smp_mb() | 18 | #define smp_mb__after_spinlock() smp_mb() |
| 19 | 19 | ||
| @@ -14,7 +14,8 @@ · 13 unmodified lines | |||
| 14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
| 15 | 15 | ||
| 16 | #include <asm-generic/qrwlock_types.h> | 16 | #include <asm-generic/qrwlock_types.h> |
| 17 | #include <asm-generic/qspinlock.h> | 17 | |
| 18 | /* Must be included from asm/spinlock.h after defining arch_spin_is_locked. */ | ||
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| 20 | * Writer states & reader shift and bias. | 21 | * Writer states & reader shift and bias. |
| @@ -12,7 +12,6 @@ · 11 unmodified lines | |||
| 12 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
| 13 | #include <linux/hardirq.h> | 13 | #include <linux/hardirq.h> |
| 14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
| 15 | #include <asm/qrwlock.h> | ||
| 16 | 15 | ||
| 17 | /** | 16 | /** |
| 18 | * queued_read_lock_slowpath - acquire read lock of a queue rwlock | 17 | * queued_read_lock_slowpath - acquire read lock of a queue rwlock |