Bluetooth: hci0: command 0x0406 tx timeout ======================================================== WARNING: possible irq lock inversion dependency detected 6.4.0-rc7-next-20230621 #1 Not tainted -------------------------------------------------------- systemd-udevd/7247 just changed the state of lock: ffffffff85814e18 (blkg_stat_lock){+.-.}-{2:2}, at: __blkcg_rstat_flush.isra.0+0x11f/0x4e0 but this lock was taken by another, HARDIRQ-safe lock in the past: (per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu)){-.-.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(blkg_stat_lock); local_irq_disable(); lock(per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu)); lock(blkg_stat_lock); lock(per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu)); *** DEADLOCK *** 3 locks held by systemd-udevd/7247: #0: ffffffff8560b580 (rcu_read_lock_sched){....}-{1:2}, at: fd_install+0x43/0x6e0 #1: ffffffff8560b520 (rcu_callback){....}-{0:0}, at: rcu_core+0x83e/0x2860 #2: ffffffff8560b640 (rcu_read_lock){....}-{1:2}, at: __blkcg_rstat_flush.isra.0+0x93/0x4e0 the shortest dependencies between 2nd lock and 1st lock: -> (per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu)){-.-.}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x19a/0x4c0 _raw_spin_lock_irqsave+0x3a/0x60 cgroup_rstat_updated+0xcb/0x2e0 __cgroup_account_cputime_field+0xa0/0x120 account_system_index_time+0x199/0x2c0 update_process_times+0x26/0x150 tick_sched_handle+0x8e/0x170 tick_sched_timer+0xe6/0x110 __hrtimer_run_queues+0x17f/0xb60 hrtimer_interrupt+0x2ef/0x750 __sysvec_apic_timer_interrupt+0xff/0x380 sysvec_apic_timer_interrupt+0x69/0x90 asm_sysvec_apic_timer_interrupt+0x1a/0x20 _raw_spin_unlock_irq+0x2b/0x40 cgroup_procs_write_finish+0x136/0x170 __cgroup_procs_write+0x371/0x6b0 cgroup_procs_write+0x26/0x60 cgroup_file_write+0x1e5/0x7c0 kernfs_fop_write_iter+0x3f7/0x610 vfs_write+0x97d/0xda0 ksys_write+0x122/0x250 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 IN-SOFTIRQ-W at: lock_acquire+0x19a/0x4c0 _raw_spin_lock_irqsave+0x3a/0x60 cgroup_rstat_updated+0xcb/0x2e0 __cgroup_account_cputime+0x75/0xc0 update_curr+0x350/0x6d0 dequeue_task_fair+0x20e/0x14a0 load_balance+0xcb4/0x2790 rebalance_domains+0x66c/0xc00 __do_softirq+0x1b7/0x7d4 irq_exit_rcu+0x93/0xc0 sysvec_apic_timer_interrupt+0x6e/0x90 asm_sysvec_apic_timer_interrupt+0x1a/0x20 default_idle+0xf/0x20 default_idle_call+0x67/0xa0 do_idle+0x305/0x3c0 cpu_startup_entry+0x18/0x20 rest_init+0x168/0x290 arch_call_rest_init+0x13/0x40 start_kernel+0x3c4/0x4e0 x86_64_start_reservations+0x18/0x30 x86_64_start_kernel+0xcf/0xe0 secondary_startup_64_no_verify+0x179/0x17b INITIAL USE at: lock_acquire+0x19a/0x4c0 _raw_spin_lock_irqsave+0x3a/0x60 cgroup_rstat_flush_locked+0x131/0xd80 cgroup_rstat_flush+0x37/0x50 do_flush_stats+0x97/0xf0 flush_memcg_stats_dwork+0x9/0x50 process_one_work+0xabf/0x1770 worker_thread+0x64f/0x12a0 kthread+0x33f/0x440 ret_from_fork+0x2c/0x50 } ... key at: [] __key.0+0x0/0x40 ... acquired at: _raw_spin_lock+0x2b/0x40 __blkcg_rstat_flush.isra.0+0x11f/0x4e0 blkcg_rstat_flush+0x87/0xb0 cgroup_rstat_flush_locked+0x706/0xd80 cgroup_rstat_flush+0x37/0x50 do_flush_stats+0x97/0xf0 mem_cgroup_wb_stats+0x3d8/0x4b0 balance_dirty_pages+0x339/0x2640 balance_dirty_pages_ratelimited_flags+0xbce/0x1130 fault_dirty_shared_page+0x2b3/0x500 do_wp_page+0x3c8/0x3a50 __handle_mm_fault+0xc5b/0x2eb0 handle_mm_fault+0x1af/0xba0 do_user_addr_fault+0x56b/0x12d0 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 -> (blkg_stat_lock){+.-.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x19a/0x4c0 _raw_spin_lock+0x2b/0x40 __blkcg_rstat_flush.isra.0+0x11f/0x4e0 __blkg_release+0xfa/0x3b0 rcu_core+0x8c8/0x2860 __do_softirq+0x1b7/0x7d4 irq_exit_rcu+0x93/0xc0 sysvec_apic_timer_interrupt+0x6e/0x90 asm_sysvec_apic_timer_interrupt+0x1a/0x20 lock_acquire+0x1c7/0x4c0 fd_install+0x76/0x6e0 do_sys_openat2+0x18f/0x1d0 __x64_sys_openat+0x143/0x200 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 IN-SOFTIRQ-W at: lock_acquire+0x19a/0x4c0 _raw_spin_lock+0x2b/0x40 __blkcg_rstat_flush.isra.0+0x11f/0x4e0 __blkg_release+0xfa/0x3b0 rcu_core+0x8c8/0x2860 __do_softirq+0x1b7/0x7d4 irq_exit_rcu+0x93/0xc0 sysvec_apic_timer_interrupt+0x6e/0x90 asm_sysvec_apic_timer_interrupt+0x1a/0x20 lock_acquire+0x1c7/0x4c0 fd_install+0x76/0x6e0 do_sys_openat2+0x18f/0x1d0 __x64_sys_openat+0x143/0x200 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 INITIAL USE at: lock_acquire+0x19a/0x4c0 _raw_spin_lock+0x2b/0x40 __blkcg_rstat_flush.isra.0+0x11f/0x4e0 blkcg_rstat_flush+0x87/0xb0 cgroup_rstat_flush_locked+0x706/0xd80 cgroup_rstat_flush+0x37/0x50 do_flush_stats+0x97/0xf0 mem_cgroup_wb_stats+0x3d8/0x4b0 balance_dirty_pages+0x339/0x2640 balance_dirty_pages_ratelimited_flags+0xbce/0x1130 fault_dirty_shared_page+0x2b3/0x500 do_wp_page+0x3c8/0x3a50 __handle_mm_fault+0xc5b/0x2eb0 handle_mm_fault+0x1af/0xba0 do_user_addr_fault+0x56b/0x12d0 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 } ... key at: [] blkg_stat_lock+0x18/0x60 ... acquired at: __lock_acquire+0x8b8/0x6340 lock_acquire+0x19a/0x4c0 _raw_spin_lock+0x2b/0x40 __blkcg_rstat_flush.isra.0+0x11f/0x4e0 __blkg_release+0xfa/0x3b0 rcu_core+0x8c8/0x2860 __do_softirq+0x1b7/0x7d4 irq_exit_rcu+0x93/0xc0 sysvec_apic_timer_interrupt+0x6e/0x90 asm_sysvec_apic_timer_interrupt+0x1a/0x20 lock_acquire+0x1c7/0x4c0 fd_install+0x76/0x6e0 do_sys_openat2+0x18f/0x1d0 __x64_sys_openat+0x143/0x200 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 stack backtrace: CPU: 1 PID: 7247 Comm: systemd-udevd Not tainted 6.4.0-rc7-next-20230621 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x91/0xf0 print_irq_inversion_bug.part.0+0x3d5/0x570 mark_lock.part.0+0x900/0x2f50 __lock_acquire+0x8b8/0x6340 lock_acquire+0x19a/0x4c0 _raw_spin_lock+0x2b/0x40 __blkcg_rstat_flush.isra.0+0x11f/0x4e0 __blkg_release+0xfa/0x3b0 rcu_core+0x8c8/0x2860 __do_softirq+0x1b7/0x7d4 irq_exit_rcu+0x93/0xc0 sysvec_apic_timer_interrupt+0x6e/0x90 asm_sysvec_apic_timer_interrupt+0x1a/0x20 RIP: 0010:lock_acquire+0x1c7/0x4c0 Code: ff ff 48 83 c4 28 65 0f c1 05 05 f6 d4 7e 83 f8 01 0f 85 8f 02 00 00 48 83 7c 24 08 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffff8880426f7ca8 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff110084def97 RCX: 0000000000000001 RDX: 1ffff1100836c80d RSI: 00072e7ca898bb4c RDI: 000000000ee55292 RBP: 0000000000000000 R08: 0000000000000000 R09: fffffbfff0ef8164 R10: ffffffff877c0b27 R11: 0000000000000001 R12: 0000000000000002 R13: 0000000000000000 R14: ffffffff8560b580 R15: 0000000000000000 fd_install+0x76/0x6e0 do_sys_openat2+0x18f/0x1d0 __x64_sys_openat+0x143/0x200 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7fe4d6f69d62 Code: c0 f6 c2 40 75 52 89 d0 45 31 d2 25 00 00 41 00 3d 00 00 41 00 74 41 64 8b 04 25 18 00 00 00 85 c0 75 65 b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 a2 00 00 00 48 8b 4c 24 38 64 48 2b 0c 25 RSP: 002b:00007ffdfcb6ed70 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe4d6f69d62 RDX: 00000000002a0000 RSI: 00005588e9c6a661 RDI: 0000000000000010 RBP: 00005588e9c6a660 R08: 00005588e7fde8f0 R09: 0073656369766564 R10: 0000000000000000 R11: 0000000000000246 R12: 00005588e9c620b4 R13: 0000000000000010 R14: 0000000000000008 R15: 00005588e9c6a661 random: crng reseeded on system resumption random: crng reseeded on system resumption Restarting kernel threads ... done. random: crng reseeded on system resumption random: crng reseeded on system resumption Restarting kernel threads ... done. random: crng reseeded on system resumption random: crng reseeded on system resumption Restarting kernel threads ... done. random: crng reseeded on system resumption random: crng reseeded on system resumption ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 48 83 c4 28 add $0x28,%rsp 4: 65 0f c1 05 05 f6 d4 xadd %eax,%gs:0x7ed4f605(%rip) # 0x7ed4f611 b: 7e c: 83 f8 01 cmp $0x1,%eax f: 0f 85 8f 02 00 00 jne 0x2a4 15: 48 83 7c 24 08 00 cmpq $0x0,0x8(%rsp) 1b: 74 01 je 0x1e 1d: fb sti 1e: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 25: fc ff df * 28: 48 01 c3 add %rax,%rbx <-- trapping instruction 2b: 48 c7 03 00 00 00 00 movq $0x0,(%rbx) 32: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx) 39: 00 3a: 48 rex.W 3b: 8b .byte 0x8b 3c: 84 .byte 0x84 3d: 24 .byte 0x24