On Thu, Dec 3, 2026 at 5:28 PM Lee Jones [off-list ref] wrote:
sun6i_msgbox_shutdown() disables the channel receive interrupt and
immediately flushes the receive FIFO and returns to mbox_free_channel()
without waiting for an already-executing sun6i_msgbox_irq() on another
CPU. Both contexts can concurrently read MSG_DATA_REG(n) and underflow
the FIFO, and the ISR can invoke mbox_chan_received_data() after the
client is torn down.
Call synchronize_irq(mbox->irq) after disabling the channel receive
interrupt and before flushing the FIFO.
Fixes: 25831c44b0b7 ("mailbox: sun6i-msgbox: Add a new mailbox driver")
Closes: https://sashiko.dev/#/bug/linux-bdac10dc-aab3-41b2-a13a-eb012e1fd2f9
Cc: <redacted>
Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>