mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: Sudeep Holla <sudeep.holla@arm.com>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Adam Young <admiyo@os.amperecomputing.com>,
	Robbie King <robbiek@xsightlabs.com>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	"Cristian Marussi" <cristian.marussi@arm.com>
Subject: Re: [PATCH 2/6] mailbox: pcc: Wire up ->last_tx_done() for PCC channels
Date: Mon, 20 Oct 2025 12:01:54 +0800	[thread overview]
Message-ID: <6d4b85ce-de35-4a38-92ff-34b2caec66d0@huawei.com> (raw)
In-Reply-To: <20251016-pcc_mb_updates-v1-2-0fba69616f69@arm.com>


在 2025/10/17 3:08, Sudeep Holla 写道:
> Some PCC users poll for completion between transfers and benefit from
> the knowledge of previous Tx completion check through the mailbox
> framework's ->last_tx_done() op.
>
> Hook up the last_tx_done callback in the PCC mailbox driver so the mailbox
> framework can correctly query the completion status of the last transmitted
> message. This aligns PCC with other controllers that already implement such
> last_tx_done status query.
>
> No functional change unless callers use ->last_tx_done(). Normal Tx and
> IRQ paths are unchanged. This change just improves synchronization and
> avoids unnecessary timeouts for non-interrupt driven channels by ensuring
> correct completion detection for PCC channels that don’t rely on interrupts.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>   drivers/mailbox/pcc.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index f6714c233f5a..2b690c268cf0 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -445,6 +445,13 @@ static int pcc_send_data(struct mbox_chan *chan, void *data)
>   	return ret;
>   }
>   
> +static bool pcc_last_tx_done(struct mbox_chan *chan)
> +{
> +	struct pcc_chan_info *pchan = chan->con_priv;
> +
The last_tx_done() is used on the condition that txdone_poll  is true 
and txdone_irq is false.
So how about add WARN_ON() for this in this API?
> +	return pcc_mbox_cmd_complete_check(pchan);
The pcc_mbox_cmd_complete_check() works on type 3/4.
I'm not sure if we need to add some comments or do some other something 
for this.
> +}
> +
>   /**
>    * pcc_startup - Called from Mailbox Controller code. Used here
>    *		to request the interrupt.
> @@ -490,6 +497,7 @@ static const struct mbox_chan_ops pcc_chan_ops = {
>   	.send_data = pcc_send_data,
>   	.startup = pcc_startup,
>   	.shutdown = pcc_shutdown,
> +	.last_tx_done = pcc_last_tx_done,
>   };
>   
>   /**
>

  parent reply	other threads:[~2025-10-20  4:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 19:08 [PATCH 0/6] mailbox: pcc: Refactor and improve initialisation and interrupt handling Sudeep Holla
2025-10-16 19:08 ` [PATCH 1/6] Revert "mailbox/pcc: support mailbox management of the shared buffer" Sudeep Holla
2025-10-17 16:54   ` Adam Young
2025-10-20  3:46   ` lihuisong (C)
2025-10-16 19:08 ` [PATCH 2/6] mailbox: pcc: Wire up ->last_tx_done() for PCC channels Sudeep Holla
2025-10-17 16:48   ` Adam Young
2025-10-17 16:59     ` Adam Young
2025-10-20  4:01   ` lihuisong (C) [this message]
2025-10-16 19:08 ` [PATCH 3/6] mailbox: pcc: Set txdone_irq/txdone_poll based on PCCT flags Sudeep Holla
2025-10-17 17:16   ` Adam Young
2025-10-20  4:02   ` lihuisong (C)
2025-10-16 19:08 ` [PATCH 4/6] mailbox: pcc: Mark Tx as complete in PCC IRQ handler Sudeep Holla
2025-10-17 16:54   ` Adam Young
2025-10-20  4:08   ` lihuisong (C)
2026-04-10  9:15     ` lihuisong (C)
2025-10-16 19:08 ` [PATCH 5/6] mailbox: pcc: Initialize SHMEM before binding the channel with the client Sudeep Holla
2025-10-17 16:59   ` Adam Young
2025-10-20  4:15   ` lihuisong (C)
2025-10-16 19:08 ` [PATCH 6/6] mailbox: pcc: Clear any pending responder interrupts before enabling it Sudeep Holla
2025-10-17 17:03   ` Adam Young
2025-10-17 16:49 ` [PATCH 0/6] mailbox: pcc: Refactor and improve initialisation and interrupt handling Adam Young
2025-11-27 14:40 ` Sudeep Holla
2026-01-12 16:55   ` Sudeep Holla
2026-01-26 17:07     ` Adam Young
2026-01-26 17:08       ` Adam Young
2026-01-27  9:29       ` Sudeep Holla
2026-02-04 21:40         ` Adam Young
2026-02-05  7:31           ` Adam Young
2026-02-24 23:13         ` Adam Young

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=6d4b85ce-de35-4a38-92ff-34b2caec66d0@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=admiyo@os.amperecomputing.com \
    --cc=cristian.marussi@arm.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robbiek@xsightlabs.com \
    --cc=sudeep.holla@arm.com \
    /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

all inboxes | Powered by JetHome®