Re: [PATCH] mailbox: pcc: Synchronize channel IRQ before unmapping shared memory
From: Sudeep Holla
Date: Thu Sep 03 2026 - 05:19:32 EST
On Thu, Sep 03, 2026 at 10:03:38AM +0100, Sudeep Holla wrote:
> On Fri, Aug 28, 2026 at 05:10:33PM +0100, Christian Loehle wrote:
> > pcc_mbox_free_channel() unmaps the PCC shared-memory region before
> > mbox_free_channel() invokes the controller shutdown callback. For
> > interrupt-capable extended subspaces, an in-flight handler may
> > consequently access the mapping after it has been invalidated.
> >
> > Release the mailbox channel first so its IRQ is disabled and synchronized
> > before unmapping the shared-memory region. Serialize PCC channel
> > acquisition and release across this sequence: once mbox_free_channel()
> > makes the channel available, another client must not replace the
> > shared-memory mapping until the old one has been unmapped.
> >
>
> Breno Leitao has already posted the fix for the unmapping before freeing
> the channel. You just need the mutex guards.
>
Failed to add the reference to it [1] earlier.
--
Regards,
Sudeep
[1] https://lore.kernel.org/all/20260812-pcc-v1-1-5a94d2cc26cc@xxxxxxxxxx