[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9edf77f-41d8-4e3c-b621-e2d37604a410@arm.com>
Date: Wed, 12 Nov 2025 14:55:47 +0000
From: Ben Horgan <ben.horgan@....com>
To: "Shaopeng Tan (Fujitsu)" <tan.shaopeng@...itsu.com>,
"james.morse@....com" <james.morse@....com>
Cc: "amitsinght@...vell.com" <amitsinght@...vell.com>,
"baisheng.gao@...soc.com" <baisheng.gao@...soc.com>,
"baolin.wang@...ux.alibaba.com" <baolin.wang@...ux.alibaba.com>,
"bobo.shaobowang@...wei.com" <bobo.shaobowang@...wei.com>,
"carl@...amperecomputing.com" <carl@...amperecomputing.com>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"dakr@...nel.org" <dakr@...nel.org>,
"dave.martin@....com" <dave.martin@....com>,
"david@...hat.com" <david@...hat.com>,
"dfustini@...libre.com" <dfustini@...libre.com>,
"fenghuay@...dia.com" <fenghuay@...dia.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"gshan@...hat.com" <gshan@...hat.com>,
"guohanjun@...wei.com" <guohanjun@...wei.com>,
"jeremy.linton@....com" <jeremy.linton@....com>,
"jonathan.cameron@...wei.com" <jonathan.cameron@...wei.com>,
"kobak@...dia.com" <kobak@...dia.com>,
"lcherian@...vell.com" <lcherian@...vell.com>,
"lenb@...nel.org" <lenb@...nel.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lpieralisi@...nel.org" <lpieralisi@...nel.org>,
"peternewman@...gle.com" <peternewman@...gle.com>,
"quic_jiles@...cinc.com" <quic_jiles@...cinc.com>,
"rafael@...nel.org" <rafael@...nel.org>, "robh@...nel.org"
<robh@...nel.org>, "rohit.mathew@....com" <rohit.mathew@....com>,
"scott@...amperecomputing.com" <scott@...amperecomputing.com>,
"sdonthineni@...dia.com" <sdonthineni@...dia.com>,
"sudeep.holla@....com" <sudeep.holla@....com>,
"will@...nel.org" <will@...nel.org>,
"xhao@...ux.alibaba.com" <xhao@...ux.alibaba.com>
Subject: Re: [PATCH 09/33] ACPI / MPAM: Parse the MPAM table
Hi Shaopeng,
On 11/12/25 07:01, Shaopeng Tan (Fujitsu) wrote:
> Hello Ben,
>
>> From: James Morse <james.morse@....com>
>>
>> Add code to parse the arm64 specific MPAM table, looking up the cache level
>> from the PPTT and feeding the end result into the MPAM driver.
>>
>> This happens in two stages. Platform devices are created first for the MSC
>> devices. Once the driver probes it calls acpi_mpam_parse_resources() to
>> discover the RIS entries the MSC contains.
>>
>> For now the MPAM hook mpam_ris_create() is stubbed out, but will update the
>> MPAM driver with optional discovered data about the RIS entries.
>>
>> CC: Carl Worth <carl@...amperecomputing.com>
>> Link: https://developer.arm.com/documentation/den0065/3-0bet/?lang=en
>> Reviewed-by: Lorenzo Pieralisi <lpieralisi@...nel.org>
>> Tested-by: Fenghua Yu <fenghuay@...dia.com>
>> Tested-by: Shaopeng Tan <tan.shaopeng@...fujitsu.com>
>> Tested-by: Peter Newman <peternewman@...gle.com>
>> Signed-off-by: James Morse <james.morse@....com>
>> Signed-off-by: Ben Horgan <ben.horgan@....com>
>> +static struct platform_device * __init acpi_mpam_parse_msc(struct
>> +acpi_mpam_msc_node *tbl_msc) {
>> + struct platform_device *pdev __free(platform_device_put) =
>> + platform_device_alloc("mpam_msc", tbl_msc->identifier);
>> + int next_res = 0, next_prop = 0, err;
>> + /* pcc, nrdy, affinity and a sentinel */
>> + struct property_entry props[4] = { 0 };
>> + /* mmio, 2xirq, no sentinel. */
>> + struct resource res[3] = { 0 };
>> + struct acpi_device *companion;
>> + enum mpam_msc_iface iface;
>> + char uid[16];
>> + u32 acpi_id;
>> +
>> + if (!pdev)
>> + return ERR_PTR(-ENOMEM);
>> +
>> + /* Some power management is described in the namespace: */
>> + err = snprintf(uid, sizeof(uid), "%u", tbl_msc->identifier);
>
> It's a bit strange to store the uid length in the variable err.
A little, yes. The value is only used for error checking and it's not
that uncommon so I'll leave it as is.
linux$ git grep 'err = snprintf' | wc -l
17
> Reviewed-by: Shaopeng Tan <tan.shaopeng@...fujitsu.com>
>
Thanks!
Thanks,
Ben
Powered by blists - more mailing lists