@@ -4666,6 +4666,9 @@
quiet [KNL] Disable most log messages
+ qspinlock [RISCV] Forces kernel to use queued_spinlock when
+ CONFIG_RISCV_COMBO_SPINLOCKS=y.
+
r128= [HW,DRM]
radix_hcall_invalidate=on [PPC/PSERIES]
@@ -30,4 +30,6 @@ DECLARE_PER_CPU(long, misaligned_access_speed);
/* Per-cpu ISA extensions. */
extern struct riscv_isainfo hart_isa[NR_CPUS];
+extern bool force_qspinlock;
+
#endif
@@ -99,6 +99,17 @@ static bool riscv_isa_extension_check(int id)
return true;
}
+#ifdef CONFIG_QUEUED_SPINLOCKS
+bool force_qspinlock = false;
+static int __init force_queued_spinlock(char *p)
+{
+ force_qspinlock = true;
+ pr_info("Force kernel to use queued_spinlock");
+ return 0;
+}
+early_param("qspinlock", force_queued_spinlock);
+#endif
+
void __init riscv_fill_hwcap(void)
{
struct device_node *node;
@@ -331,7 +342,9 @@ void __init riscv_fill_hwcap(void)
* spinlock value, the only way is to change from queued_spinlock to
* ticket_spinlock, but can not be vice.
*/
- set_bit(RISCV_ISA_EXT_XTICKETLOCK, isainfo->isa);
+ if (!force_qspinlock) {
+ set_bit(RISCV_ISA_EXT_XTICKETLOCK, isainfo->isa);
+ }
#endif
/*