Re: [PATCH 07/10] mailbox: sun6i-msgbox: Free IRQ before disabling clock on teardown

From
Chen-Yu Tsai <wens@kernel.org>
Date
2026-12-03 13:43:57
Also in
linux-sunxi, lkml, stable
Reply to
Lee Jones, 2026-12-03
On Thu, Dec 3, 2026 at 5:28 PM Lee Jones [off-list ref] wrote:
sun6i_msgbox_probe() requests the interrupt using devm_request_irq()
before initialising mbox->controller and mbox->lock, while
sun6i_msgbox_remove() manually calls mbox_controller_unregister() and
clk_disable_unprepare() before devres frees the IRQ.  An interrupt
arriving during probe failure or device removal can access unclocked
MMIO registers or freed controller data in sun6i_msgbox_irq().

Retrieve the IRQ via platform_get_irq() and register it with
request_irq() after initialising mbox->controller and mbox->lock, then
explicitly call free_irq() before disabling the clock in both the probe
error path and sun6i_msgbox_remove().

Fixes: 25831c44b0b7 ("mailbox: sun6i-msgbox: Add a new mailbox driver")
Closes: https://sashiko.dev/#/bug/linux-b10c9846-995f-40c3-a18c-97b9cb0d0611
Cc: <redacted>
Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Thread (5 messages) 5 messages, 2 authors, last reply 17h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help