From: Ginger <ginger.jzllee@gmail.com>
To: sean.wang@mediatek.com
Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
dmaengine@vger.kernel.org
Subject: [bug report] Potential deadlock bug in 'drivers/dma/mediatek/mtk-hsdma.c', between 'mtk_hsdma_irq()' and 'mtk_hsdma_free_active_desc()'
Date: Fri, 24 Apr 2026 16:49:23 +0800 [thread overview]
Message-ID: <CAGp+u1bXAX4qJRnLvfaYdfjE7JYzfCw03_4+bumhaQpwNTzvzg@mail.gmail.com> (raw)
Dear Linux kernel maintainers,
My research-based static analyzer found a potential deadlock bug
within the ''drivers/dma/mediatek' subsystem, more specifically, in
''drivers/dma/mediatek/mtk-hsdma.c'.
This deadlock potentially occurs with the involvement of hard irq.
Kernel version: long-term kernel v6.18.9
Potential concurrent triggering executions:
T0:
mtk_hsdma_irq [t1]
--> mtk_hsdma_free_rooms_in_ring
--> spin_lock(&hvc->vc.lock); [t2]
T1:
mtk_hsdma_free_active_desc
--> spin_lock(&hvc->vc.lock); [t0]
T1 can run in the normal process context and does not disable hardware
irqs in acquiring the spin lock. If T0 (i.e., the hard irq context)
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.
Thank you for your time and consideration.
Best regards,
Ginger
reply other threads:[~2026-04-24 8:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGp+u1bXAX4qJRnLvfaYdfjE7JYzfCw03_4+bumhaQpwNTzvzg@mail.gmail.com \
--to=ginger.jzllee@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).