public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Young <admiyo@amperemail.onmicrosoft.com>
To: Sudeep Holla <sudeep.holla@arm.com>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Adam Young <admiyo@os.amperecomputing.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "mailbox/pcc: support mailbox management of the shared buffer"
Date: Fri, 17 Oct 2025 12:00:24 -0400	[thread overview]
Message-ID: <edad8768-b7e4-4dfb-a08f-f85bbc443eaa@amperemail.onmicrosoft.com> (raw)
In-Reply-To: <20251016-swift-of-unmatched-luck-dfdebe@sudeepholla>

Sorry, thought I was clear in  ACKing it.  Yes, please revert.

On 10/16/25 08:50, Sudeep Holla wrote:
> On Fri, Sep 26, 2025 at 04:33:11PM +0100, Sudeep Holla wrote:
>> This reverts commit 5378bdf6a611a32500fccf13d14156f219bb0c85.
>>
>> Commit 5378bdf6a611 ("mailbox/pcc: support mailbox management of the shared buffer")
>> attempted to introduce generic helpers for managing the PCC shared memory,
>> but it largely duplicates functionality already provided by the mailbox
>> core and leaves gaps:
>>
>> 1. TX preparation: The mailbox framework already supports this via
>>    ->tx_prepare callback for mailbox clients. The patch adds
>>    pcc_write_to_buffer() and expects clients to toggle pchan->chan.manage_writes,
>>    but no drivers set manage_writes, so pcc_write_to_buffer() has no users.
>>
>> 2. RX handling: Data reception is already delivered through
>>     mbox_chan_received_data() and client ->rx_callback. The patch adds an
>>     optional pchan->chan.rx_alloc, which again has no users and duplicates
>>     the existing path.
>>
>> 3. Completion handling: While adding last_tx_done is directionally useful,
>>     the implementation only covers Type 3/4 and fails to handle the absence
>>     of a command_complete register, so it is incomplete for other types.
>>
>> Given the duplication and incomplete coverage, revert this change. Any new
>> requirements should be addressed in focused follow-ups rather than bundling
>> multiple behavioral changes together.
>>
> The discussion on this revert stopped and I am not sure if we agreed to
> revert it or not.
>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>>   drivers/mailbox/pcc.c | 102 ++----------------------------------------
>>   include/acpi/pcc.h    |  29 ------------
>>   2 files changed, 4 insertions(+), 127 deletions(-)
>>
>> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
>> index 0a00719b2482..f6714c233f5a 100644
>> --- a/drivers/mailbox/pcc.c
>> +++ b/drivers/mailbox/pcc.c
>> @@ -306,22 +306,6 @@ static void pcc_chan_acknowledge(struct pcc_chan_info *pchan)
>>   		pcc_chan_reg_read_modify_write(&pchan->db);
>>   }
>>   
>> -static void *write_response(struct pcc_chan_info *pchan)
>> -{
>> -	struct pcc_header pcc_header;
>> -	void *buffer;
>> -	int data_len;
>> -
>> -	memcpy_fromio(&pcc_header, pchan->chan.shmem,
>> -		      sizeof(pcc_header));
>> -	data_len = pcc_header.length - sizeof(u32) + sizeof(struct pcc_header);
>> -
>> -	buffer = pchan->chan.rx_alloc(pchan->chan.mchan->cl, data_len);
>> -	if (buffer != NULL)
>> -		memcpy_fromio(buffer, pchan->chan.shmem, data_len);
>> -	return buffer;
>> -}
>> -
>>   /**
>>    * pcc_mbox_irq - PCC mailbox interrupt handler
>>    * @irq:	interrupt number
>> @@ -333,8 +317,6 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
>>   {
>>   	struct pcc_chan_info *pchan;
>>   	struct mbox_chan *chan = p;
>> -	struct pcc_header *pcc_header = chan->active_req;
>> -	void *handle = NULL;
>>   
>>   	pchan = chan->con_priv;
>>   
>> @@ -358,17 +340,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
>>   	 * required to avoid any possible race in updatation of this flag.
>>   	 */
>>   	pchan->chan_in_use = false;
>> -
>> -	if (pchan->chan.rx_alloc)
>> -		handle = write_response(pchan);
>> -
>> -	if (chan->active_req) {
>> -		pcc_header = chan->active_req;
>> -		if (pcc_header->flags & PCC_CMD_COMPLETION_NOTIFY)
>> -			mbox_chan_txdone(chan, 0);
> The above change in the original patch has introduced race on my platform
> where the mbox_chan_txdone() kicks the Tx while the response to the
> command is read in the below mbox_chan_received_data().
>
> So I am going to repost/resend this revert as a fix now.
>

  reply	other threads:[~2025-10-17 16:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-26 15:33 [PATCH] Revert "mailbox/pcc: support mailbox management of the shared buffer" Sudeep Holla
2025-09-29 17:11 ` Adam Young
2025-09-30  0:19   ` Jassi Brar
2025-10-01  5:25     ` Adam Young
2025-10-01 11:57       ` Sudeep Holla
2025-10-02 23:00         ` Adam Young
2025-10-01 20:32       ` Jassi Brar
2025-10-02 23:17         ` Adam Young
2025-10-05 21:29           ` Jassi Brar
2025-12-02 19:19             ` Adam Young
2025-12-03 10:31               ` Sudeep Holla
2025-09-30  9:37   ` Sudeep Holla
2025-09-30 22:12     ` Adam Young
2025-10-16 12:50 ` Sudeep Holla
2025-10-17 16:00   ` Adam Young [this message]
2025-10-17 17:44     ` 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=edad8768-b7e4-4dfb-a08f-f85bbc443eaa@amperemail.onmicrosoft.com \
    --to=admiyo@amperemail.onmicrosoft.com \
    --cc=admiyo@os.amperecomputing.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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