Linux ACPI
 help / color / mirror / Atom feed
From: Adam Young <adam@younglogic.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Huisong Li <lihuisong@huawei.com>,
	Cristian Marussi <cristian.marussi@arm.com>
Subject: Re: [PATCH 1/3] mailbox: pcc: Notify clients on polled completion
Date: Fri, 24 Jul 2026 13:11:06 -0400	[thread overview]
Message-ID: <d26cd94e-c809-4268-8bee-e42828019127@younglogic.com> (raw)
In-Reply-To: <20260723-vegan-capybara-of-tranquility-ba5c7f@sudeepholla>


On 7/23/26 15:45, Sudeep Holla wrote:
> On Thu, Jul 23, 2026 at 12:03:45PM -0400, Adam Young wrote:
>> On 7/17/26 03:56, 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>
>>> Acked-by: Huisong Li <lihuisong@huawei.com>
>>> Signed-off-by: Sudeep Holla <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 636879ae1db7..d96b8b54e77e 100644
>>> --- a/drivers/mailbox/pcc.c
>>> +++ b/drivers/mailbox/pcc.c
>>> @@ -449,7 +449,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;
>>>    }
>>>    /**
>> My code doesn't poll, so I cannot really claim to have tested it, but it
>> does not break the existing IRQ based driver mechanism.
>>
> Thanks for testing IRQ mode.
>
>> I can claim to have read through the code and confirm that it is comparable
>> to what happens on the IRQ case:   It clears the cmd_complete field and
>> calls mbox_chan_received_data.
> Thanks for taking a look and reviewing it.
>
>> However, it does not clear pchan->chan_in_use
>> = false; (Which should now be a WRITE_ONCE) and I would like to confirm that
>> is not an oversight before providing a reviewed-by tag.
>>
> IIRC I think we set the flag only when irq > 0, no ?

That is right.  So, this code is good.

Reviewed-by: Adam Young <admiyo@os.amperecomputing.com>




>

  reply	other threads:[~2026-07-24 17:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  7:56 [PATCH 0/3] mailbox: pcc: Improve completion handling and validation Sudeep Holla
2026-07-17  7:56 ` [PATCH 1/3] mailbox: pcc: Notify clients on polled completion Sudeep Holla
2026-07-23 16:03   ` Adam Young
2026-07-23 19:45     ` Sudeep Holla
2026-07-24 17:11       ` Adam Young [this message]
2026-07-24 18:06         ` Sudeep Holla
2026-07-17  7:56 ` [PATCH 2/3] mailbox: pcc: Check shared memory signature on request Sudeep Holla
2026-07-20 11:20   ` lihuisong (C)
2026-07-20 14:58   ` Alexey Klimov
2026-07-23 15:47   ` Adam Young
2026-07-17  7:56 ` [PATCH 3/3] mailbox: pcc: Fix command timeout due to missed interrupt Sudeep Holla
2026-07-23  3:10   ` Adam Young
2026-07-23  9:16     ` Sudeep Holla
2026-07-23  9:47       ` lihuisong (C)
2026-07-23 10:19         ` Sudeep Holla
2026-07-23 15:57       ` Adam Young
2026-07-23 19:52         ` Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d26cd94e-c809-4268-8bee-e42828019127@younglogic.com \
    --to=adam@younglogic.com \
    --cc=cristian.marussi@arm.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=lihuisong@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox