Re: [PATCH 3/3] mailbox: pcc: Fix command timeout due to missed interrupt

From: Sudeep Holla

Date: Thu Jul 23 2026 - 05:21:31 EST


On Wed, Jul 22, 2026 at 11:10:51PM -0400, Adam Young wrote:
>
> + /*
> + * Set chan_in_use before ringing the doorbell so a fast completion
> + * interrupt is not mistaken for a shared interrupt from another
> + * subspace. Use WRITE_ONCE() for the lockless flag update. The
> + * ordered MMIO accessor used to ring the doorbell keeps this store
> + * visible before the platform is notified.
> + */
> + if (pchan->plat_irq > 0)
> + WRITE_ONCE(pchan->chan_in_use, true);
> ret = pcc_chan_reg_read_modify_write(&pchan->db);
> if (!ret && pchan->plat_irq > 0)
> - pchan->chan_in_use = true;
> + WRITE_ONCE(pchan->chan_in_use, false);
>
> return ret;
> }
> --
> 2.43.0
> iAt the end of the above code,
> WRITE_ONCE(pchan->chan_in_use, false);
> should be
> WRITE_ONCE(pchan->chan_in_use, true);
>
> In order to keep the original semantics. The flag is cleared when the
> messages is ACKed, not here. This version causes a hang.
>

Did you run and seeing hang or just code inspection. If latter, have you
considered that modified code sets it true before doorbell is rung and
set to false only if there is a failure to ring the doorbell ?

--
Regards,
Sudeep