From: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Aldo Ariel Panzardo <qwe.aldo@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ijae Kim <ae878000@gmail.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: m66592-udc: Free the IRQ before unmapping registers
Date: Fri, 9 Oct 2026 21:34:54 -0300 [thread overview]
Message-ID: <20261010003508.2730761-1-qwe.aldo@gmail.com> (raw)
In-Reply-To: <20261003034908.619696-1-mhun512@gmail.com>
On Fri, Oct 02, 2026 at 11:49:08PM -0400, Myeonghun Pak wrote:
> m66592_remove() unmaps the controller registers before removing its shared
> IRQ handler. Another device on the same IRQ can invoke m66592_irq() in
> that interval, and the handler reads and writes registers even when the
> controller has no enabled interrupt pending. CONFIG_DEBUG_SHIRQ can also
> invoke the handler from free_irq() after the mapping has gone away.
Confirmed against mainline: m66592_remove() calls iounmap(m66592->reg)
before free_irq(), and m66592_irq() takes m66592->lock and does register
I/O (m66592_read()/m66592_write() of INTSTS0, INTENB0, CFIFOSEL, ...)
unconditionally. request_irq() uses IRQF_SHARED, so a co-device's
interrupt -- or CONFIG_DEBUG_SHIRQ at free_irq() time -- can run the
handler against the already-unmapped mapping.
Masking the controller's interrupt sources (INTENB0 = 0) under the lock
and freeing the IRQ before iounmap() closes the window: after free_irq()
returns the handler can no longer run, and every remaining access still
happens while the MMIO mapping and private data are valid.
Reviewed-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
prev parent reply other threads:[~2026-10-10 0:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 3:49 Myeonghun Pak
2026-10-10 0:34 ` Aldo Ariel Panzardo [this message]
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=20261010003508.2730761-1-qwe.aldo@gmail.com \
--to=qwe.aldo@gmail.com \
--cc=ae878000@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mhun512@gmail.com \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®