Linux ACPI
 help / color / mirror / Atom feed
* [PATCH v2] mailbox: pcc: Notify clients on polled completion
@ 2026-06-27 15:00 Sudeep Holla
  2026-06-29 13:49 ` lihuisong (C)
  2026-06-29 13:54 ` lihuisong (C)
  0 siblings, 2 replies; 3+ messages in thread
From: Sudeep Holla @ 2026-06-27 15:00 UTC (permalink / raw)
  To: linux-kernel, linux-acpi
  Cc: Sudeep Holla, Jassi Brar, Huisong Li, Cristian Marussi

PCC channels without a platform interrupt rely on the mailbox
polling path to detect command completion.

That path currently only reports transmit completion to the mailbox
core, so clients that wait for their receive callback do not get
notified when the command completes.

Call mbox_chan_received_data() when polling observes completion on a
channel without a platform IRQ, matching the interrupt-driven
completion path.

Reported-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
---
v1->v2:
	- Check if MBOX_TXDONE_BY_POLL instead of absence of pchan->plat_irq

v1: https://patch.msgid.link/20260612170225.1063902-1-sudeep.holla@kernel.org

 drivers/mailbox/pcc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index bde5e0852157..bb55f15edae3 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -490,7 +490,15 @@ static bool pcc_last_tx_done(struct mbox_chan *chan)
 {
 	struct pcc_chan_info *pchan = chan->con_priv;
 
-	return pcc_mbox_cmd_complete_check(pchan);
+	if (!(chan->txdone_method & MBOX_TXDONE_BY_POLL))
+		return false;
+
+	if (!pcc_mbox_cmd_complete_check(pchan))
+		return false;
+
+	mbox_chan_received_data(chan, NULL);
+
+	return true;
 }
 
 /**
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mailbox: pcc: Notify clients on polled completion
  2026-06-27 15:00 [PATCH v2] mailbox: pcc: Notify clients on polled completion Sudeep Holla
@ 2026-06-29 13:49 ` lihuisong (C)
  2026-06-29 13:54 ` lihuisong (C)
  1 sibling, 0 replies; 3+ messages in thread
From: lihuisong (C) @ 2026-06-29 13:49 UTC (permalink / raw)
  To: Sudeep Holla, linux-kernel, linux-acpi; +Cc: Jassi Brar, Cristian Marussi


On 6/27/2026 11:00 PM, Sudeep Holla wrote:
> PCC channels without a platform interrupt rely on the mailbox
> polling path to detect command completion.
>
> That path currently only reports transmit completion to the mailbox
> core, so clients that wait for their receive callback do not get
> notified when the command completes.
>
> Call mbox_chan_received_data() when polling observes completion on a
> channel without a platform IRQ, matching the interrupt-driven
> completion path.
>
> Reported-by: Cristian Marussi <cristian.marussi@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
LGTM,
Acked-by: lihuisong@huawei.com
> ---
> v1->v2:
> 	- Check if MBOX_TXDONE_BY_POLL instead of absence of pchan->plat_irq
>
> v1: https://patch.msgid.link/20260612170225.1063902-1-sudeep.holla@kernel.org
>
>   drivers/mailbox/pcc.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index bde5e0852157..bb55f15edae3 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -490,7 +490,15 @@ static bool pcc_last_tx_done(struct mbox_chan *chan)
>   {
>   	struct pcc_chan_info *pchan = chan->con_priv;
>   
> -	return pcc_mbox_cmd_complete_check(pchan);
> +	if (!(chan->txdone_method & MBOX_TXDONE_BY_POLL))
> +		return false;
> +
> +	if (!pcc_mbox_cmd_complete_check(pchan))
> +		return false;
> +
> +	mbox_chan_received_data(chan, NULL);
> +
> +	return true;
>   }
>   
>   /**

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mailbox: pcc: Notify clients on polled completion
  2026-06-27 15:00 [PATCH v2] mailbox: pcc: Notify clients on polled completion Sudeep Holla
  2026-06-29 13:49 ` lihuisong (C)
@ 2026-06-29 13:54 ` lihuisong (C)
  1 sibling, 0 replies; 3+ messages in thread
From: lihuisong (C) @ 2026-06-29 13:54 UTC (permalink / raw)
  To: Sudeep Holla, linux-kernel, linux-acpi; +Cc: Jassi Brar, Cristian Marussi


On 6/27/2026 11:00 PM, Sudeep Holla wrote:
> PCC channels without a platform interrupt rely on the mailbox
> polling path to detect command completion.
>
> That path currently only reports transmit completion to the mailbox
> core, so clients that wait for their receive callback do not get
> notified when the command completes.
>
> Call mbox_chan_received_data() when polling observes completion on a
> channel without a platform IRQ, matching the interrupt-driven
> completion path.
>
> Reported-by: Cristian Marussi <cristian.marussi@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
LGTM,
Acked-by: Huisong Li <lihuisong@huawei.com>
>   /**

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-29 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-27 15:00 [PATCH v2] mailbox: pcc: Notify clients on polled completion Sudeep Holla
2026-06-29 13:49 ` lihuisong (C)
2026-06-29 13:54 ` lihuisong (C)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox