Re: [PATCH 0/6] mailbox: pcc: Refactor and improve initialisation and interrupt handling

From: Adam Young

Date: Wed Feb 04 2026 - 16:41:06 EST


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.