public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] Potential deadlock bug in 'drivers/usb/musb/musb_core.c', between 'musb_g_giveback()' and 'musb_stage0_irq()'
@ 2026-04-24  4:50 Ginger
  2026-04-25  8:27 ` Michal Pecio
  0 siblings, 1 reply; 2+ messages in thread
From: Ginger @ 2026-04-24  4:50 UTC (permalink / raw)
  To: b-liu; +Cc: linux-usb, linux-kernel

Dear Linux kernel maintainers,

My research-based static analyzer found a potential deadlock bug
within the 'drivers/usb/musb' subsystem, more specifically, in
'drivers/usb/musb/musb_core.c'.
This deadlock potentially occurs with the involvement of hard irq.

Kernel version: long-term kernel v6.18.9

Potential concurrent triggering executions:
T0:
musb_stage0_irq [t1]
     --> musb_handle_intr_resume
         --> musb_g_resume
             --> spin_lock(&musb->lock); [t2]

T1:
musb_g_giveback
    --> spin_lock(&musb->lock); [t0]

If T0 (i.e., the hard irq) occurs after T1 acquires the lock and both
happen within the same CPU, then T0 will not proceed because it cannot
hold the spin lock that has already been possessed by T1, yet T1
cannot proceed because the hard irq runs disables preempts.
Simply speaking, t0 -> t1 -> t2 can lead to a deadlock.

Thank you for your time and consideration.

Best regards,
Ginger

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-25  8:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24  4:50 [bug report] Potential deadlock bug in 'drivers/usb/musb/musb_core.c', between 'musb_g_giveback()' and 'musb_stage0_irq()' Ginger
2026-04-25  8:27 ` Michal Pecio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox