[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYJT6pjtWZIUBc1J@x1>
Date: Tue, 3 Feb 2026 12:00:42 -0800
From: Drew Fustini <fustini@...nel.org>
To: yunhui cui <cuiyunhui@...edance.com>
Cc: Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Alexandre Ghiti <alex@...ti.fr>,
Radim Krčmář <rkrcmar@...tanamicro.com>,
Samuel Holland <samuel.holland@...ive.com>,
Adrien Ricciardi <aricciardi@...libre.com>,
Nicolas Pitre <npitre@...libre.com>,
Kornel Dulęba <mindal@...ihalf.com>,
Atish Patra <atish.patra@...ux.dev>,
Atish Kumar Patra <atishp@...osinc.com>,
Vasudevan Srinivasan <vasu@...osinc.com>,
Ved Shanbhogue <ved@...osinc.com>,
Chen Pei <cp0613@...ux.alibaba.com>,
Liu Zhiwei <zhiwei_liu@...ux.alibaba.com>,
Weiwei Li <liwei1518@...il.com>, guo.wenjia23@....com.cn,
liu.qingtao2@....com.cn,
Reinette Chatre <reinette.chatre@...el.com>,
Tony Luck <tony.luck@...el.com>, Babu Moger <babu.moger@....com>,
Peter Newman <peternewman@...gle.com>,
Fenghua Yu <fenghua.yu@...el.com>,
James Morse <james.morse@....com>, Ben Horgan <ben.horgan@....com>,
Dave Martin <Dave.Martin@....com>, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, x86@...nel.org,
Rob Herring <robh@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Robert Moore <robert.moore@...el.com>,
Sunil V L <sunilvl@...tanamicro.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
linux-acpi@...r.kernel.org, acpica-devel@...ts.linux.dev,
devicetree@...r.kernel.org
Subject: Re: [External] [PATCH RFC v2 16/17] acpi: riscv: Parse RISC-V
Quality of Service Controller (RQSC) table
On Mon, Feb 02, 2026 at 07:08:48PM +0800, yunhui cui wrote:
> Hi Drew,
>
> On Thu, Jan 29, 2026 at 4:28 AM Drew Fustini <fustini@...nel.org> wrote:
> >
> > Add driver to parse the ACPI RISC-V Quality of Service Controller (RQSC)
> > table which describes the capacity and bandwidth QoS controllers in a
> > system. The QoS controllers implement the RISC-V Capacity and Bandwidth
> > Controller QoS Register Interface (CBQRI) specification.
> >
> > Link: https://github.com/riscv-non-isa/riscv-cbqri/releases/tag/v1.0
> > Link: https://github.com/riscv-non-isa/riscv-rqsc/blob/main/src/
> > Signed-off-by: Drew Fustini <fustini@...nel.org>
> > ---
> > MAINTAINERS | 1 +
> > arch/riscv/include/asm/acpi.h | 10 ++++
> > drivers/acpi/riscv/Makefile | 2 +-
> > drivers/acpi/riscv/rqsc.c | 112 ++++++++++++++++++++++++++++++++++++++++++
> > 4 files changed, 124 insertions(+), 1 deletion(-)
> >
[..]
> > +int acpi_parse_rqsc(struct acpi_table_header *table)
> > +{
> > + struct acpi_table_rqsc *rqsc;
> > + int err;
> > +
> > + BUG_ON(acpi_disabled);
> > + if (!table) {
> > + rqsc = acpi_get_rqsc();
> > + if (!rqsc)
> > + return -ENOENT;
> > + } else {
> > + rqsc = (struct acpi_table_rqsc *)table;
> > + }
> > +
> > + for (int i = 0; i < rqsc->num; i++) {
> > + struct cbqri_controller_info *ctrl_info;
> > +
> > + ctrl_info = kzalloc(sizeof(*ctrl_info), GFP_KERNEL);
> > + if (!ctrl_info)
> > + return -ENOMEM;
> > +
> > + ctrl_info->type = rqsc->f[i].type;
> > + ctrl_info->addr = rqsc->f[i].reg[1];
> > + ctrl_info->size = CBQRI_CTRL_SIZE;
> > + ctrl_info->rcid_count = rqsc->f[i].rcid;
> > + ctrl_info->mcid_count = rqsc->f[i].mcid;
> > +
> > + pr_info("Found controller with type %u addr 0x%lx size %lu rcid %u mcid %u",
> > + ctrl_info->type, ctrl_info->addr, ctrl_info->size,
> > + ctrl_info->rcid_count, ctrl_info->mcid_count);
> > +
> > + if (ctrl_info->type == CBQRI_CONTROLLER_TYPE_CAPACITY) {
> > + ctrl_info->cache.cache_id = rqsc->f[i].res.id1;
> > + ctrl_info->cache.cache_level =
> > + find_acpi_cache_level_from_id(ctrl_info->cache.cache_id);
> > +
> > + struct acpi_pptt_cache *cache;
> > +
> > + cache = find_acpi_cache_from_id(ctrl_info->cache.cache_id);
> > + if (cache) {
> > + ctrl_info->cache.cache_size = cache->size;
> > + } else {
> > + pr_warn("%s(): failed to determine size for cache id 0x%x",
> > + __func__, ctrl_info->cache.cache_id);
> > + ctrl_info->cache.cache_size = 0;
> > + }
> > +
> > + pr_info("Cache controller has ID 0x%x level %u size %u ",
> > + ctrl_info->cache.cache_id, ctrl_info->cache.cache_level,
> > + ctrl_info->cache.cache_size);
> > +
> > + /*
> > + * For CBQRI, any cpu (technically a hart in RISC-V terms)
> > + * can access the memory-mapped registers of any CBQRI
> > + * controller in the system.
> > + */
> > + err = cpumask_parse("FF", &ctrl_info->cache.cpu_mask);
>
> Hardcode? acpi_pptt_get_cpumask_from_cache_id(ctrl_info->cache.cache_id,
> &ctrl_info->cache.cpu_mask); ?
Thanks, I will give that a try as the current value 0xFF is not flexible.
Drew
Powered by blists - more mailing lists