HomeDefectsLIN1025-2089
Acknowledged

LIN1025-2089 : BUG: sleeping function called from invalid context at /kernel/locking/spinlock_rt.c:48 during executing acpis4_rtcwake on SapphireRapids

Created: Jun 19, 2025    Updated: Oct 28, 2025
Found In Version: 10.25.33.1
Severity: Standard
Applicable for: Wind River Linux LTS 25
Component/s: BSP

Description

When doing ACPI S4 (hibernation) with RT kernel, you may see the following call trace.

BUG: sleeping function called from invalid context at /kernel/locking/spinlock_rt.c:48
in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 5743, name: rtcwake
preempt_count: 0, expected: 0
RCU nest depth: 0, expected: 0
CPU: 89 UID: 0 PID: 5743 Comm: rtcwake Tainted: G        W          6.12.33-rt6-yocto-preempt-rt #1
Tainted: [W]=WARN
Hardware name: Intel Corporation ArcherCityM/ArcherCityM, BIOS EGSDCRB1.SYS.9409.P01.2211280753 11/28/2022
Call Trace:
  <TASK>
  dump_stack_lvl+0x53/0x80
  dump_stack+0x14/0x1a
  __might_resched.cold+0xb6/0xc7
  rt_spin_lock+0x37/0x90
  cmos_interrupt+0x26/0x130
  cmos_resume+0x30f/0x330
  pnp_bus_resume+0x6a/0xb0
  ? __pfx_pnp_bus_resume+0x10/0x10
  dpm_run_callback+0x44/0x160
  device_resume+0xad/0x1f0
  dpm_resume+0x156/0x230
  hibernation_snapshot+0x2da/0x550
  hibernate.cold+0xba/0x2a7
  state_store+0xcf/0xe0
  kobj_attr_store+0x13/0x30
  sysfs_kf_write+0x3f/0x50
  kernfs_fop_write_iter+0x136/0x1e0
  vfs_write+0x28c/0x460
  ksys_write+0x7b/0x100
  __x64_sys_write+0x1d/0x30
  x64_sys_call+0x82/0x1d20
  do_syscall_64+0x54/0x110
  entry_SYSCALL_64_after_hwframe+0x76/0x7e
 RIP: 0033:0x7ff52626d717
 Code: 20 49 89 d0 48 89 fa 4c 89 df e8 54 b0 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 16 5b c3 0f 1f 40 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 e2 e8 23 ff ff ff
 RSP: 002b:00007ffdbc00edc0 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
 RAX: ffffffffffffffda RBX: 00007ff5261e0740 RCX: 00007ff52626d717
 RDX: 0000000000000005 RSI: 000055e74afc97f0 RDI: 0000000000000004
 RBP: 000055e74afc97f0 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005
 R13: 000055e74afc73d0 R14: 00007ff5263beea0 R15: 00007ffdbc00efc0
  </TASK>

Steps to Reproduce

Shared image:
http://128.224.153.118/buildarea1/SharedImage/LTS25/BSP/intel-x86-64_preempt-rt_glibc-std_GIT/20250619_180155/

build steps:

/lpg-build/cdc/fast_prod/WRL10_25/WRL10_25_GIT/wrlinux-10/setup.sh --machines intel-x86-64 --templates feature/intel-qat feature/intel-persistent-memory feature/intel-sst feature/dpdk feature/bsp-extras feature/docker feature/kexec feature/kdump feature/lxc feature/tpm2 feature/edac --layers meta-dpdk --distros wrlinux --dl-layers=1 --accept-eula=yes
source environment-setup-x86_64-wrlinuxsdk-linux
source oe-init-build-env build
echo 'PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"' >> conf/local.conf


echo 'BB_NUMBER_THREADS ?= "24"' >> conf/local.conf
echo 'PARALLEL_MAKE ?= "-j 24"' >> conf/local.conf
export https_proxy=147.11.252.42:9090
export http_proxy=147.11.252.42:9090
bitbake-layers add-layer /net/pek-lpgtest7408/buildarea1/SharedImage/wrlinux-testing-dl/
bitbake-layers add-layer /net/pek-lpgtest20/buildarea1/zwang11/WASSP_LINUX_1025/testcases/wrlinux/wr-testing/bts-dev

#####To Clone a whole new testcases layer#####
git clone --depth 1 -b master git://lxgit.wrs.com/wrlinux-testing/testcases.git ../layers/testcases/wrlinux/
bitbake-layers add-layer ../layers/testcases/wrlinux/wr-testing/bts-dev
#####End#####

echo '
require templates/feature/bts/template.conf
IMAGE_FSTYPES += " tar.bz2"
echo 'IMAGE_FSTYPES:remove = " live hddimg iso"' >> conf/local.conf
echo 'IMAGE_INSTALL:append = " intel-cmt-cat"
IMAGE_FSTYPES:remove = " live hddimg iso"
DISTRO_FEATURES += "seccomp ipv6"' >> conf/local.conf
bitbake wrlinux-image-std


On target 29248, boot it with above image from NFS(append "resume=/dev/sda9 resumewait" into kernel), then
/opt/wr-test/main_test.py -k acpis4_rtcwake:sda -q