Re: [PATCH] kernel: resourse: Add conditional handling for ACPI device

kernel test robot
2025-10-20T08:46:20Z

Hello,

kernel test robot noticed "BUG:sleeping_function_called_from_invalid_context_at_include/linux/sched/mm.h" on:

commit: 871e73eea694be4705a5e3ebc9119e6c76c7b246 ("[PATCH] kernel: resourse: Add conditional handling for ACPI device")
url: https://github.com/intel-lab-lkp/linux/commits/Szuying-Chen/kernel-resourse-Add-conditional-handling-for-ACPI-device/20251017-103749
base: https://git.kernel.org/cgit/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/all/20251017023531.5616-1-Chloe_Chen@asmedia.com.tw/
patch subject: [PATCH] kernel: resourse: Add conditional handling for ACPI device

in testcase: boot

config: i386-randconfig-141-20251019
compiler: gcc-14
test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 4G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+-------------------------------------------------------------------------------+------------+------------+
| | 4d30e94233 | 871e73eea6 |
+-------------------------------------------------------------------------------+------------+------------+
| BUG:sleeping_function_called_from_invalid_context_at_include/linux/sched/mm.h | 0 | 12 |
+-------------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202510201616.6e6b62a1-lkp@intel.com

[ 0.605114][ T1] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:323
[ 0.606472][ T1] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0
[ 0.607674][ T1] preempt_count: 1, expected: 0
[ 0.608383][ T1] 2 locks held by swapper/0/1:
[ 0.609070][ T1] #0: 82a715b8 (acpi_scan_lock){+.+.}-{4:4}, at: acpi_scan_init (drivers/acpi/scan.c:2748)
[ 0.609944][ T1] #1: 82686c74 (resource_lock){++++}-{3:3}, at: insert_resource_conflict (kernel/resource.c:960)
[ 0.611267][ T1] CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.18.0-rc1-00168-g871e73eea694 #1 NONE 6a82e794814861a45fb7fec961bde07e21f033c5
[ 0.611273][ T1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 0.611275][ T1] Call Trace:
[ 0.611277][ T1] ? show_stack (arch/x86/kernel/dumpstack.c:319)
[ 0.611285][ T1] dump_stack_lvl (lib/dump_stack.c:122)
[ 0.611290][ T1] dump_stack (lib/dump_stack.c:130)
[ 0.611293][ T1] __might_resched.cold (kernel/sched/core.c:8926)
[ 0.611297][ T1] __might_sleep (kernel/sched/core.c:8855)
[ 0.611303][ T1] __kmalloc_node_track_caller_noprof (include/linux/sched/mm.h:323 (discriminator 1) mm/slub.c:4906 (discriminator 1) mm/slub.c:5241 (discriminator 1) mm/slub.c:5626 (discriminator 1) mm/slub.c:5736 (discriminator 1))
[ 0.611310][ T1] kstrdup (mm/util.c:64 (discriminator 2) mm/util.c:84 (discriminator 2))
[ 0.611314][ T1] ? __request_resource (kernel/resource.c:187 kernel/resource.c:226)
[ 0.611319][ T1] __request_resource (kernel/resource.c:187 kernel/resource.c:226)
[ 0.611321][ T1] ? insert_resource_conflict (kernel/resource.c:960)
[ 0.611325][ T1] __insert_resource (kernel/resource.c:896)
[ 0.611330][ T1] insert_resource_conflict (kernel/resource.c:960)
[ 0.611333][ T1] acpi_pci_root_create (drivers/acpi/pci_root.c:952 drivers/acpi/pci_root.c:1023)
[ 0.611342][ T1] pci_acpi_scan_root (arch/x86/pci/acpi.c:582)
[ 0.611350][ T1] acpi_pci_root_add.cold (drivers/acpi/pci_root.c:729)
[ 0.611359][ T1] acpi_bus_attach (drivers/acpi/scan.c:2261 drivers/acpi/scan.c:2309)
[ 0.611365][ T1] ? sb_notify_work (drivers/acpi/bus.c:1142)
[ 0.611368][ T1] acpi_dev_for_one_check (drivers/acpi/bus.c:1146)
[ 0.611371][ T1] device_for_each_child (drivers/base/core.c:4017)
[ 0.611378][ T1] acpi_dev_for_each_child (drivers/acpi/bus.c:1158)
[ 0.611381][ T1] ? get_acpi_device (drivers/acpi/scan.c:2274)
[ 0.611384][ T1] acpi_bus_attach (drivers/acpi/scan.c:2331)
[ 0.611389][ T1] ? klist_next (lib/klist.c:403)
[ 0.611392][ T1] ? sb_notify_work (drivers/acpi/bus.c:1142)
[ 0.611396][ T1] acpi_dev_for_one_check (drivers/acpi/bus.c:1146)
[ 0.611398][ T1] device_for_each_child (drivers/base/core.c:4017)
[ 0.611404][ T1] acpi_dev_for_each_child (drivers/acpi/bus.c:1158)
[ 0.611406][ T1] ? get_acpi_device (drivers/acpi/scan.c:2274)
[ 0.611410][ T1] acpi_bus_attach (drivers/acpi/scan.c:2331)
[ 0.611416][ T1] acpi_bus_scan (drivers/acpi/scan.c:2541 drivers/acpi/scan.c:2614)
[ 0.611422][ T1] acpi_scan_init (drivers/acpi/scan.c:2748 (discriminator 1))
[ 0.611425][ T1] ? acpi_viot_early_init (drivers/acpi/viot.c:263)
[ 0.611429][ T1] acpi_init (drivers/acpi/bus.c:1470)
[ 0.611431][ T1] ? acpi_arch_init+0x4/0x4
[ 0.611433][ T1] ? acpi_arch_init+0x4/0x4
[ 0.611435][ T1] do_one_initcall (init/main.c:1283)
[ 0.611444][ T1] ? do_initcalls (init/main.c:1343 init/main.c:1361)
[ 0.611449][ T1] do_initcalls (init/main.c:1344 (discriminator 3) init/main.c:1361 (discriminator 3))
[ 0.611454][ T1] kernel_init_freeable (init/main.c:1597)
[ 0.611457][ T1] ? rest_init (init/main.c:1475)
[ 0.611461][ T1] kernel_init (init/main.c:1485)
[ 0.611464][ T1] ret_from_fork (arch/x86/kernel/process.c:164)
[ 0.611466][ T1] ? rest_init (init/main.c:1475)
[ 0.611470][ T1] ret_from_fork_asm (arch/x86/entry/entry_32.S:737)
[ 0.611473][ T1] entry_INT80_32 (arch/x86/entry/entry_32.S:945)

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20251020/202510201616.6e6b62a1-lkp@intel.com

--
0-DAY CI Kernel Test Service