mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adam Young <admiyo@amperemail.onmicrosoft.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Adam Young <admiyo@os.amperecomputing.com>,
	Robbie King <robbiek@xsightlabs.com>,
	Huisong Li <lihuisong@huawei.com>,
	Cristian Marussi <cristian.marussi@arm.com>
Subject: Re: [PATCH 0/6] mailbox: pcc: Refactor and improve initialisation and interrupt handling
Date: Wed, 4 Feb 2026 16:40:05 -0500	[thread overview]
Message-ID: <cb6b0b57-c5b7-46c4-8909-e6955ceee401@amperemail.onmicrosoft.com> (raw)
In-Reply-To: <aXiFlkKAuV8QSgcM@bogus>

I was just looking at it.  I think reposting might cause too much churn, 
when the  crux of the matter is what to do with these three functions I 
added:

extern struct pcc_mbox_chan *
pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id);
extern void pcc_mbox_free_channel(struct pcc_mbox_chan *chan);
extern
int pcc_mbox_write_to_buffer(struct pcc_mbox_chan *pchan, int len, void 
*data);
extern
int pcc_mbox_query_bytes_available(struct pcc_mbox_chan *pchan);
extern
int pcc_mbox_read_from_buffer(struct pcc_mbox_chan *pchan, int len,
                               void *data);

In my last patch I added them as EXPORT_SYMBOL_GPL.  You mentioned you 
wanted them as inline.

We can do that, but it does mean further exposing the ACPI header file.  
THe simplest is  pcc_mbox_query_bytes_available which I have posted 
below.  As you can see, it needs the struct 
acpi_pcct_ext_pcc_shared_memory  which comes from 
include/acpi/actbl2.h.  If you are OK with adding that to 
include/acpi/pcc.h  We can inline the functions in there.

These three functions are requied as a result of the direct access to 
the shared memory buffer.


int pcc_mbox_query_bytes_available(struct pcc_mbox_chan *pchan)
{
         struct acpi_pcct_ext_pcc_shared_memory pcc_header;
         struct pcc_chan_info *pinfo = pchan->mchan->con_priv;
         int data_len;
         u64 val;

         pcc_chan_reg_read(&pinfo->cmd_complete, &val);
         if (val) {
                 pr_info("%s Buffer not enabled for reading", __func__);
                 return -1;
         }
         memcpy_fromio(&pcc_header, pchan->shmem,
                       sizeof(pcc_header));
         data_len = pcc_header.length - sizeof(u32) + sizeof(pcc_header);
         return data_len;
}




On 1/27/26 04:29, Sudeep Holla wrote:
> On Mon, Jan 26, 2026 at 12:07:26PM -0500, Adam Young wrote:
>>
>> On 1/12/26 11:55, Sudeep Holla wrote:
>>> On Thu, Nov 27, 2025 at 02:40:56PM +0000, Sudeep Holla wrote:
>>>> Hi Jassi,
>>>>
>>>> On Thu, Oct 16, 2025 at 08:08:14PM +0100, Sudeep Holla wrote:
>>>>> This series refines and stabilizes the PCC mailbox driver to improve
>>>>> initialisation order, interrupt handling, and completion signaling.
>>>>>
>>>> Are you happy to pull these patches directly from the list or do you
>>>> prefer me to send you pull request or do you want me to direct this via
>>>> ACPI/Rafael's tree. Please advice.
>>>>
>>> Hi Jassi,
>>>
>>> Sorry for the nag. I did see these patches in -next as well as your
>>> v6.19 merge window pull request which didn't make it to Linus tree.
>>> However I don't see it -next any longer. Please advice if you want
>>> anything from my side so that this can be merged for v6.20/v7.0
>>>
>> I thought you had an approach you wanted to implement for the functions that
>> provided access to the Mailbox internals: you wanted to do them inline but
>> hadn't gotten to them yet.  Is that still the case?  I will resubmit mine as
>> is with -next if that is acceptable.
>>
> Honestly, it has been a while and I have lost the context. Please post what
> you have or thinking of on top of linux-next or jassi's -next and we can start
> the discussion fresh.
>

  reply	other threads:[~2026-02-04 21:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 19:08 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)
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 [this message]
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=cb6b0b57-c5b7-46c4-8909-e6955ceee401@amperemail.onmicrosoft.com \
    --to=admiyo@amperemail.onmicrosoft.com \
    --cc=admiyo@os.amperecomputing.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=robbiek@xsightlabs.com \
    --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

all inboxes | Powered by JetHome®