Hello, kernel test robot noticed "WARNING:at_fs/sysfs/group.c:#sysfs_remove_group" on: commit: 868bc4ac8686c4118c66bd6926b777ded345309e ("sysfs: do not create empty directories if no attributes are present") https://git.kernel.org/cgit/linux/kernel/git/gregkh/driver-core.git debugfs_cleanup in testcase: boot compiler: clang-16 test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G (please refer to attached dmesg/kmsg for entire log/backtrace) +-------------------------------------------------+------------+------------+ | | ef43695802 | 868bc4ac86 | +-------------------------------------------------+------------+------------+ | WARNING:at_fs/sysfs/group.c:#sysfs_remove_group | 0 | 8 | | RIP:sysfs_remove_group | 0 | 8 | +-------------------------------------------------+------------+------------+ 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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-lkp/202309051359.dcd93d4f-oliver.sang@xxxxxxxxx [ 17.350543][ T1] ------------[ cut here ]------------ [ 17.351171][ T1] sysfs group 'power' not found for kobject 'serial0' [ 17.351982][ T1] WARNING: CPU: 0 PID: 1 at fs/sysfs/group.c:303 sysfs_remove_group (kbuild/src/rand/fs/sysfs/group.c:301) [ 17.353035][ T1] Modules linked in: [ 17.353499][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-10211-g868bc4ac8686 #6 [ 17.354450][ T1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 [ 17.355602][ T1] RIP: 0010:sysfs_remove_group (kbuild/src/rand/fs/sysfs/group.c:301) [ 17.356262][ T1] Code: 8b 34 24 4c 89 f8 48 c1 e8 03 80 3c 18 00 74 08 4c 89 ff e8 86 14 d6 ff 49 8b 17 48 c7 c7 80 b6 f6 84 4c 89 f6 e8 f4 d5 4b ff <0f> 0b e9 fc 00 00 00 e8 a8 4d 81 ff 4c 8b 6d d0 4d 8d 7c 24 20 4c All code ======== 0: 8b 34 24 mov (%rsp),%esi 3: 4c 89 f8 mov %r15,%rax 6: 48 c1 e8 03 shr $0x3,%rax a: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) e: 74 08 je 0x18 10: 4c 89 ff mov %r15,%rdi 13: e8 86 14 d6 ff call 0xffffffffffd6149e 18: 49 8b 17 mov (%r15),%rdx 1b: 48 c7 c7 80 b6 f6 84 mov $0xffffffff84f6b680,%rdi 22: 4c 89 f6 mov %r14,%rsi 25: e8 f4 d5 4b ff call 0xffffffffff4bd61e 2a:* 0f 0b ud2 <-- trapping instruction 2c: e9 fc 00 00 00 jmp 0x12d 31: e8 a8 4d 81 ff call 0xffffffffff814dde 36: 4c 8b 6d d0 mov -0x30(%rbp),%r13 3a: 4d 8d 7c 24 20 lea 0x20(%r12),%r15 3f: 4c rex.WR Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: e9 fc 00 00 00 jmp 0x103 7: e8 a8 4d 81 ff call 0xffffffffff814db4 c: 4c 8b 6d d0 mov -0x30(%rbp),%r13 10: 4d 8d 7c 24 20 lea 0x20(%r12),%r15 15: 4c rex.WR [ 17.358463][ T1] RSP: 0000:ffffc9000001ee98 EFLAGS: 00010246 [ 17.359141][ T1] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 [ 17.360026][ T1] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 17.360926][ T1] RBP: ffffc9000001eed0 R08: 0000000000000000 R09: 0000000000000000 [ 17.361839][ T1] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff851d26c0 [ 17.362736][ T1] R13: 1ffffffff0a3a4d8 R14: ffffffff851d26a0 R15: ffff88816d32c000 [ 17.363619][ T1] FS: 0000000000000000(0000) GS:ffff8883ae800000(0000) knlGS:0000000000000000 [ 17.364612][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 17.365352][ T1] CR2: ffff88843ffff000 CR3: 0000000005c71000 CR4: 00000000000406b0 [ 17.366243][ T1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 17.367132][ T1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 17.368042][ T1] Call Trace: [ 17.368423][ T1] <TASK> [ 17.368767][ T1] ? show_regs (kbuild/src/rand/arch/x86/kernel/dumpstack.c:479) [ 17.369267][ T1] ? __warn (kbuild/src/rand/kernel/panic.c:235) [ 17.369764][ T1] ? sysfs_remove_group (kbuild/src/rand/fs/sysfs/group.c:301) [ 17.370364][ T1] ? sysfs_remove_group (kbuild/src/rand/fs/sysfs/group.c:301) [ 17.370964][ T1] ? report_bug (kbuild/src/rand/lib/bug.c:?) [ 17.371492][ T1] ? handle_bug (kbuild/src/rand/arch/x86/kernel/traps.c:237) [ 17.371993][ T1] ? exc_invalid_op (kbuild/src/rand/arch/x86/kernel/traps.c:258) [ 17.372544][ T1] ? asm_exc_invalid_op (kbuild/src/rand/arch/x86/include/asm/idtentry.h:568) [ 17.373122][ T1] ? sysfs_remove_group (kbuild/src/rand/fs/sysfs/group.c:301) [ 17.373713][ T1] ? sysfs_remove_group (kbuild/src/rand/fs/sysfs/group.c:301) [ 17.374299][ T1] ? sysfs_unmerge_group (kbuild/src/rand/fs/sysfs/group.c:?) [ 17.374900][ T1] dpm_sysfs_remove (kbuild/src/rand/drivers/base/power/sysfs.c:?) [ 17.375432][ T1] device_del (kbuild/src/rand/drivers/base/core.c:3742) [ 17.375928][ T1] ? _raw_spin_unlock_irq (kbuild/src/rand/arch/x86/include/asm/irqflags.h:42 kbuild/src/rand/arch/x86/include/asm/irqflags.h:77 kbuild/src/rand/include/linux/spinlock_api_smp.h:159 kbuild/src/rand/kernel/locking/spinlock.c:202) [ 17.376524][ T1] serdev_controller_add (kbuild/src/rand/drivers/tty/serdev/core.c:?) [ 17.377124][ T1] ? serdev_controller_alloc (kbuild/src/rand/include/linux/pm_runtime.h:120) [ 17.377764][ T1] serdev_tty_port_register (kbuild/src/rand/drivers/tty/serdev/serdev-ttyport.c:302) [ 17.378409][ T1] tty_port_register_device_attr_serdev (kbuild/src/rand/drivers/tty/tty_port.c:191) [ 17.379186][ T1] serial_core_register_port (kbuild/src/rand/include/linux/err.h:61 kbuild/src/rand/drivers/tty/serial/serial_core.c:3151 kbuild/src/rand/drivers/tty/serial/serial_core.c:3355) [ 17.379876][ T1] serial_ctrl_register_port (kbuild/src/rand/drivers/tty/serial/serial_ctrl.c:41) [ 17.380497][ T1] uart_add_one_port (kbuild/src/rand/drivers/tty/serial/serial_port.c:75) [ 17.381037][ T1] serial8250_register_8250_port (kbuild/src/rand/drivers/tty/serial/8250/8250_core.c:1141) [ 17.383151][ T1] serial_pnp_probe (kbuild/src/rand/drivers/tty/serial/8250/8250_pnp.c:448) [ 17.383823][ T1] pnp_device_probe (kbuild/src/rand/drivers/pnp/driver.c:113) [ 17.384380][ T1] ? __cfi_pnp_device_probe (kbuild/src/rand/drivers/pnp/driver.c:83) [ 17.384993][ T1] really_probe (kbuild/src/rand/drivers/base/dd.c:?) [ 17.385523][ T1] ? __kasan_check_write (kbuild/src/rand/mm/kasan/shadow.c:37) [ 17.386109][ T1] __driver_probe_device (kbuild/src/rand/drivers/base/dd.c:800) [ 17.386707][ T1] driver_probe_device (kbuild/src/rand/drivers/base/dd.c:830) [ 17.387271][ T1] __driver_attach (kbuild/src/rand/drivers/base/dd.c:1217) [ 17.387808][ T1] bus_for_each_dev (kbuild/src/rand/drivers/base/bus.c:367) [ 17.388358][ T1] ? __cfi___driver_attach (kbuild/src/rand/drivers/base/dd.c:1157) [ 17.388972][ T1] driver_attach (kbuild/src/rand/drivers/base/dd.c:1233) [ 17.389487][ T1] bus_add_driver (kbuild/src/rand/drivers/base/bus.c:674) [ 17.390031][ T1] driver_register (kbuild/src/rand/drivers/base/driver.c:247) [ 17.390573][ T1] ? __cfi_serial8250_init (kbuild/src/rand/drivers/tty/serial/8250/8250_core.c:1220) [ 17.391178][ T1] pnp_register_driver (kbuild/src/rand/drivers/pnp/driver.c:274) [ 17.391741][ T1] serial8250_pnp_init (kbuild/src/rand/drivers/tty/serial/8250/8250_pnp.c:533) [ 17.392309][ T1] serial8250_init (kbuild/src/rand/drivers/tty/serial/8250/8250_core.c:1241) [ 17.392838][ T1] do_one_initcall (kbuild/src/rand/init/main.c:1232) [ 17.393762][ T1] do_initcall_level (kbuild/src/rand/init/main.c:1293) [ 17.394329][ T1] ? kernel_init (kbuild/src/rand/init/main.c:1439) [ 17.394845][ T1] do_initcalls (kbuild/src/rand/init/main.c:1307) [ 17.395351][ T1] do_basic_setup (kbuild/src/rand/init/main.c:1330) [ 17.395871][ T1] kernel_init_freeable (kbuild/src/rand/init/main.c:1548) [ 17.396469][ T1] ? __cfi_kernel_init (kbuild/src/rand/init/main.c:1429) [ 17.397019][ T1] kernel_init (kbuild/src/rand/init/main.c:1439) [ 17.397509][ T1] ? __cfi_kernel_init (kbuild/src/rand/init/main.c:1429) [ 17.398057][ T1] ret_from_fork (kbuild/src/rand/arch/x86/kernel/process.c:153) [ 17.398552][ T1] ? __cfi_kernel_init (kbuild/src/rand/init/main.c:1429) [ 17.399110][ T1] ret_from_fork_asm (kbuild/src/rand/arch/x86/entry/entry_64.S:312) [ 17.399669][ T1] </TASK> [ 17.400010][ T1] irq event stamp: 468845 [ 17.400490][ T1] hardirqs last enabled at (468853): __up_console_sem (kbuild/src/rand/arch/x86/include/asm/irqflags.h:19) [ 17.401573][ T1] hardirqs last disabled at (468860): __up_console_sem (kbuild/src/rand/kernel/printk/printk.c:345) [ 17.402694][ T1] softirqs last enabled at (468874): __irq_exit_rcu (kbuild/src/rand/kernel/softirq.c:612) [ 17.403770][ T1] softirqs last disabled at (468869): __irq_exit_rcu (kbuild/src/rand/kernel/softirq.c:612) [ 17.404828][ T1] ---[ end trace 0000000000000000 ]--- [ 17.407738][ T1] serial 00:05: using ACPI '_SB.PCI0.S08.COM1' for 'rs485-term' GPIO lookup [ 17.408738][ T1] acpi PNP0501:01: GPIO: looking up rs485-term-gpios [ 17.409505][ T1] acpi PNP0501:01: GPIO: looking up rs485-term-gpio [ 17.410252][ T1] serial 00:05: using lookup tables for GPIO lookup [ 17.411001][ T1] serial 00:05: No GPIO consumer rs485-term found [ 17.411723][ T1] serial 00:05: using ACPI '_SB.PCI0.S08.COM1' for 'rs485-rx-during-tx' GPIO lookup [ 17.412831][ T1] acpi PNP0501:01: GPIO: looking up rs485-rx-during-tx-gpios [ 17.413677][ T1] acpi PNP0501:01: GPIO: looking up rs485-rx-during-tx-gpio [ 17.414499][ T1] serial 00:05: using lookup tables for GPIO lookup [ 17.415230][ T1] serial 00:05: No GPIO consumer rs485-rx-during-tx found [ 17.417775][ T1] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20230905/202309051359.dcd93d4f-oliver.sang@xxxxxxxxx -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki