[PATCH 4/6] mailbox: pcc: Mark Tx as complete in PCC IRQ handler

Sudeep Holla posted 6 patches 3 months, 3 weeks ago
[PATCH 4/6] mailbox: pcc: Mark Tx as complete in PCC IRQ handler
Posted by Sudeep Holla 3 months, 3 weeks ago
The PCC IRQ handler clears channel-in-use and notifies clients with
mbox_chan_received_data(), but it does not explicitly mark the
transmit as complete. In IRQ completion mode this could leave Tx complete
waiters hanging or lead to generic timeouts in the mailbox core.

Invoke mbox_chan_txdone() in the IRQ path once the platform has
acknowledged the transfer so the core can wake any waiters and update
state accordingly.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/mailbox/pcc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 327e022973db..33bd2d05704b 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -341,6 +341,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
 	 */
 	pchan->chan_in_use = false;
 	mbox_chan_received_data(chan, NULL);
+	mbox_chan_txdone(chan, 0);
 
 	pcc_chan_acknowledge(pchan);
 

-- 
2.34.1
Re: [PATCH 4/6] mailbox: pcc: Mark Tx as complete in PCC IRQ handler
Posted by lihuisong (C) 3 months, 3 weeks ago
在 2025/10/17 3:08, Sudeep Holla 写道:
> The PCC IRQ handler clears channel-in-use and notifies clients with
> mbox_chan_received_data(), but it does not explicitly mark the
> transmit as complete. In IRQ completion mode this could leave Tx complete
> waiters hanging or lead to generic timeouts in the mailbox core.
>
> Invoke mbox_chan_txdone() in the IRQ path once the platform has
> acknowledged the transfer so the core can wake any waiters and update
> state accordingly.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>   drivers/mailbox/pcc.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index 327e022973db..33bd2d05704b 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -341,6 +341,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
>   	 */
>   	pchan->chan_in_use = false;
>   	mbox_chan_received_data(chan, NULL);
> +	mbox_chan_txdone(chan, 0);
Normally, this interface is called by mbox client.
So, IMO, this added code is not ok for mbox client.
AFAIS, this code should be for type4, right?
If so, the mbox client of type 4 channel has  responsibility to call 
this interface.
>   
>   	pcc_chan_acknowledge(pchan);
>   
>
Re: [PATCH 4/6] mailbox: pcc: Mark Tx as complete in PCC IRQ handler
Posted by Adam Young 3 months, 3 weeks ago
Tested-by: Adam Young <admiyo@os.amperecomputing.com>

On 10/16/25 15:08, Sudeep Holla wrote:
> The PCC IRQ handler clears channel-in-use and notifies clients with
> mbox_chan_received_data(), but it does not explicitly mark the
> transmit as complete. In IRQ completion mode this could leave Tx complete
> waiters hanging or lead to generic timeouts in the mailbox core.
>
> Invoke mbox_chan_txdone() in the IRQ path once the platform has
> acknowledged the transfer so the core can wake any waiters and update
> state accordingly.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>   drivers/mailbox/pcc.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index 327e022973db..33bd2d05704b 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -341,6 +341,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
>   	 */
>   	pchan->chan_in_use = false;
>   	mbox_chan_received_data(chan, NULL);
> +	mbox_chan_txdone(chan, 0);
>   
>   	pcc_chan_acknowledge(pchan);
>   
>