* [PATCH] mailbox: pcc: Notify clients on polled completion
@ 2026-06-12 17:02 Sudeep Holla
2026-06-18 2:04 ` lihuisong (C)
0 siblings, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2026-06-12 17:02 UTC (permalink / raw)
To: linux-kernel, linux-acpi; +Cc: Sudeep Holla, Jassi Brar, 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>
---
drivers/mailbox/pcc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 636879ae1db7..7c9451ab4527 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -447,9 +447,14 @@ static int pcc_send_data(struct mbox_chan *chan, void *data)
static bool pcc_last_tx_done(struct mbox_chan *chan)
{
+ bool ret;
struct pcc_chan_info *pchan = chan->con_priv;
- return pcc_mbox_cmd_complete_check(pchan);
+ ret = pcc_mbox_cmd_complete_check(pchan);
+ if (ret && !pchan->plat_irq)
+ mbox_chan_received_data(chan, NULL);
+
+ return ret;
}
/**
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mailbox: pcc: Notify clients on polled completion
2026-06-12 17:02 [PATCH] mailbox: pcc: Notify clients on polled completion Sudeep Holla
@ 2026-06-18 2:04 ` lihuisong (C)
2026-06-18 12:06 ` Sudeep Holla
0 siblings, 1 reply; 5+ messages in thread
From: lihuisong (C) @ 2026-06-18 2:04 UTC (permalink / raw)
To: Sudeep Holla; +Cc: Jassi Brar, Cristian Marussi, linux-acpi, linux-kernel
Hi Sudeep,
On 6/13/2026 1:02 AM, 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>
> ---
> drivers/mailbox/pcc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index 636879ae1db7..7c9451ab4527 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -447,9 +447,14 @@ static int pcc_send_data(struct mbox_chan *chan, void *data)
>
> static bool pcc_last_tx_done(struct mbox_chan *chan)
> {
> + bool ret;
> struct pcc_chan_info *pchan = chan->con_priv;
>
> - return pcc_mbox_cmd_complete_check(pchan);
> + ret = pcc_mbox_cmd_complete_check(pchan);
> + if (ret && !pchan->plat_irq)
> + mbox_chan_received_data(chan, NULL);
> +
> + return ret;
> }
The mailbox_controller.h said that .last_tx_done() is used only if
txdone_poll:=true && txdone_irq:=false.
How about add a verification at the begining of this function? like "if
(chan->txdone_method != MBOX_TXDONE_BY_POLL) return false;"
And then call mbox_chan_received_data() directly if command completed.
This patch is ok to me if has above changes.
Acked-by: lihuisong@huawei.com
But pcc mbox controller can no longer work in MBOX_TXDONE_BY_ACK after
your commit:
3349f800609e (mailbox: pcc: Set txdone_irq/txdone_poll based on PCCT flags).
This may lead to above client drivers fail to send mailbox command, like
cppc_acpi,hisi_uncore_freq and kunpeng_hccs.
Because these client driver knows tx_done(knows_txdone: true), work on
this mode and need to call mbox_client_txdone.
Do you have some idea for this?
>
> /**
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mailbox: pcc: Notify clients on polled completion
2026-06-18 2:04 ` lihuisong (C)
@ 2026-06-18 12:06 ` Sudeep Holla
2026-06-22 12:54 ` lihuisong (C)
2026-06-23 8:05 ` lihuisong (C)
0 siblings, 2 replies; 5+ messages in thread
From: Sudeep Holla @ 2026-06-18 12:06 UTC (permalink / raw)
To: lihuisong (C)
Cc: Jassi Brar, Cristian Marussi, Sudeep Holla, linux-acpi, linux-kernel
On Thu, Jun 18, 2026 at 10:04:12AM +0800, lihuisong (C) wrote:
> Hi Sudeep,
>
> On 6/13/2026 1:02 AM, 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>
> > ---
> > drivers/mailbox/pcc.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> > index 636879ae1db7..7c9451ab4527 100644
> > --- a/drivers/mailbox/pcc.c
> > +++ b/drivers/mailbox/pcc.c
> > @@ -447,9 +447,14 @@ static int pcc_send_data(struct mbox_chan *chan, void *data)
> > static bool pcc_last_tx_done(struct mbox_chan *chan)
> > {
> > + bool ret;
> > struct pcc_chan_info *pchan = chan->con_priv;
> > - return pcc_mbox_cmd_complete_check(pchan);
> > + ret = pcc_mbox_cmd_complete_check(pchan);
> > + if (ret && !pchan->plat_irq)
> > + mbox_chan_received_data(chan, NULL);
> > +
> > + return ret;
> > }
> The mailbox_controller.h said that .last_tx_done() is used only if
> txdone_poll:=true && txdone_irq:=false.
> How about add a verification at the begining of this function? like "if
> (chan->txdone_method != MBOX_TXDONE_BY_POLL) return false;"
> And then call mbox_chan_received_data() directly if command completed.
>
Thanks, it does makes sense to me. I will have look.
> This patch is ok to me if has above changes.
> Acked-by: lihuisong@huawei.com
>
>
> But pcc mbox controller can no longer work in MBOX_TXDONE_BY_ACK after your
> commit:
> 3349f800609e (mailbox: pcc: Set txdone_irq/txdone_poll based on PCCT flags).
> This may lead to above client drivers fail to send mailbox command, like
> cppc_acpi,hisi_uncore_freq and kunpeng_hccs.
> Because these client driver knows tx_done(knows_txdone: true), work on this
> mode and need to call mbox_client_txdone.
> Do you have some idea for this?
I wonder if we can ask the platform to avoid generating interrupts in those
case by setting/clearing "Notify on completion" in shmem. Do you think that
would work ?
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mailbox: pcc: Notify clients on polled completion
2026-06-18 12:06 ` Sudeep Holla
@ 2026-06-22 12:54 ` lihuisong (C)
2026-06-23 8:05 ` lihuisong (C)
1 sibling, 0 replies; 5+ messages in thread
From: lihuisong (C) @ 2026-06-22 12:54 UTC (permalink / raw)
To: Sudeep Holla; +Cc: Jassi Brar, Cristian Marussi, linux-acpi, linux-kernel
On 6/18/2026 8:06 PM, Sudeep Holla wrote:
> On Thu, Jun 18, 2026 at 10:04:12AM +0800, lihuisong (C) wrote:
>> Hi Sudeep,
>>
>> On 6/13/2026 1:02 AM, 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>
>>> ---
>>> drivers/mailbox/pcc.c | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
>>> index 636879ae1db7..7c9451ab4527 100644
>>> --- a/drivers/mailbox/pcc.c
>>> +++ b/drivers/mailbox/pcc.c
>>> @@ -447,9 +447,14 @@ static int pcc_send_data(struct mbox_chan *chan, void *data)
>>> static bool pcc_last_tx_done(struct mbox_chan *chan)
>>> {
>>> + bool ret;
>>> struct pcc_chan_info *pchan = chan->con_priv;
>>> - return pcc_mbox_cmd_complete_check(pchan);
>>> + ret = pcc_mbox_cmd_complete_check(pchan);
>>> + if (ret && !pchan->plat_irq)
>>> + mbox_chan_received_data(chan, NULL);
>>> +
>>> + return ret;
>>> }
>> The mailbox_controller.h said that .last_tx_done() is used only if
>> txdone_poll:=true && txdone_irq:=false.
>> How about add a verification at the begining of this function? like "if
>> (chan->txdone_method != MBOX_TXDONE_BY_POLL) return false;"
>> And then call mbox_chan_received_data() directly if command completed.
>>
> Thanks, it does makes sense to me. I will have look.
>
>> This patch is ok to me if has above changes.
>> Acked-by: lihuisong@huawei.com
>>
>>
>> But pcc mbox controller can no longer work in MBOX_TXDONE_BY_ACK after your
>> commit:
>> 3349f800609e (mailbox: pcc: Set txdone_irq/txdone_poll based on PCCT flags).
>> This may lead to above client drivers fail to send mailbox command, like
>> cppc_acpi,hisi_uncore_freq and kunpeng_hccs.
>> Because these client driver knows tx_done(knows_txdone: true), work on this
>> mode and need to call mbox_client_txdone.
>> Do you have some idea for this?
> I wonder if we can ask the platform to avoid generating interrupts in those
> case by setting/clearing "Notify on completion" in shmem. Do you think that
> would work ?
These drivers didn't work on interrupt mode.
They poll the complete status of command.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mailbox: pcc: Notify clients on polled completion
2026-06-18 12:06 ` Sudeep Holla
2026-06-22 12:54 ` lihuisong (C)
@ 2026-06-23 8:05 ` lihuisong (C)
1 sibling, 0 replies; 5+ messages in thread
From: lihuisong (C) @ 2026-06-23 8:05 UTC (permalink / raw)
To: Sudeep Holla
Cc: Jassi Brar, Cristian Marussi, linux-acpi, linux-kernel, lihuisong
On 6/18/2026 8:06 PM, Sudeep Holla wrote:
> On Thu, Jun 18, 2026 at 10:04:12AM +0800, lihuisong (C) wrote:
>> Hi Sudeep,
>>
>> On 6/13/2026 1:02 AM, 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>
>>> ---
>>> drivers/mailbox/pcc.c | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
>>> index 636879ae1db7..7c9451ab4527 100644
>>> --- a/drivers/mailbox/pcc.c
>>> +++ b/drivers/mailbox/pcc.c
>>> @@ -447,9 +447,14 @@ static int pcc_send_data(struct mbox_chan *chan, void *data)
>>> static bool pcc_last_tx_done(struct mbox_chan *chan)
>>> {
>>> + bool ret;
>>> struct pcc_chan_info *pchan = chan->con_priv;
>>> - return pcc_mbox_cmd_complete_check(pchan);
>>> + ret = pcc_mbox_cmd_complete_check(pchan);
>>> + if (ret && !pchan->plat_irq)
>>> + mbox_chan_received_data(chan, NULL);
>>> +
>>> + return ret;
>>> }
>> The mailbox_controller.h said that .last_tx_done() is used only if
>> txdone_poll:=true && txdone_irq:=false.
>> How about add a verification at the begining of this function? like "if
>> (chan->txdone_method != MBOX_TXDONE_BY_POLL) return false;"
>> And then call mbox_chan_received_data() directly if command completed.
>>
> Thanks, it does makes sense to me. I will have look.
>
>> This patch is ok to me if has above changes.
>> Acked-by: lihuisong@huawei.com
>>
>>
>> But pcc mbox controller can no longer work in MBOX_TXDONE_BY_ACK after your
>> commit:
>> 3349f800609e (mailbox: pcc: Set txdone_irq/txdone_poll based on PCCT flags).
>> This may lead to above client drivers fail to send mailbox command, like
>> cppc_acpi,hisi_uncore_freq and kunpeng_hccs.
>> Because these client driver knows tx_done(knows_txdone: true), work on this
>> mode and need to call mbox_client_txdone.
>> Do you have some idea for this?
> I wonder if we can ask the platform to avoid generating interrupts in those
> case by setting/clearing "Notify on completion" in shmem. Do you think that
> would work ?
Hi Sudeep,
Review this logic again.
The mbox_bind_client is called on requesting PCC channel.
And mbox_bind_client could modify chan->txdone_method to
MBOX_TXDONE_BY_ACK if client knows txdone and 'txdone_method' is
MBOX_TXDONE_BY_POLL.
So I think your above commit is ok for these client drivers.
/Huisong
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-23 8:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-12 17:02 [PATCH] mailbox: pcc: Notify clients on polled completion Sudeep Holla
2026-06-18 2:04 ` lihuisong (C)
2026-06-18 12:06 ` Sudeep Holla
2026-06-22 12:54 ` lihuisong (C)
2026-06-23 8:05 ` lihuisong (C)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®