Re: [PATCH 08/10] mailbox: sun6i-msgbox: Synchronise IRQ during channel shutdown
From: Chen-Yu Tsai
Date: Thu Dec 03 2026 - 08:50:21 EST
On Thu, Dec 3, 2026 at 5:28 PM Lee Jones <lee@xxxxxxxxxx> 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: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
Reviewed-by: Chen-Yu Tsai <wens@xxxxxxxxxx>