]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: proton-pack: Fix hard lockup due to print in scheduler context
authorshechenglong <shechenglong@xfusion.com>
Fri, 31 Oct 2025 09:15:06 +0000 (17:15 +0800)
committerWill Deacon <will@kernel.org>
Fri, 7 Nov 2025 14:49:12 +0000 (14:49 +0000)
commit7f1635737823a6c0c412ccf3767a12bec642c10f
tree35f1551177c9cc65884e671886cebfc4142ff964
parent62e72463ca714073962eda450e80c5d71dfb0dcb
arm64: proton-pack: Fix hard lockup due to print in scheduler context

Relocate the printk() calls from spectre_v4_mitigations_off() and
spectre_v2_mitigations_off() into setup_system_capabilities() function,
preventing hard lockups caused by printk calls in scheduler context:

  | _raw_spin_lock_nested+168
  | ttwu_queue+180 (rq_lock(rq, &rf); 2nd acquiring the rq->__lock)
  | try_to_wake_up+548
  | wake_up_process+32
  | __up+88
  | up+100
  | __up_console_sem+96
  | console_unlock+696
  | vprintk_emit+428
  | vprintk_default+64
  | vprintk_func+220
  | printk+104
  | spectre_v4_enable_task_mitigation+344
  | __switch_to+100
  | __schedule+1028 (rq_lock(rq, &rf); 1st acquiring the rq->__lock)
  | schedule_idle+48
  | do_idle+388
  | cpu_startup_entry+44
  | secondary_start_kernel+352

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: shechenglong <shechenglong@xfusion.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/spectre.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/proton-pack.c