[PATCH RFC v3 11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)

Drew Fustini
2026-04-15T01:56:59Z

Call acpi_parse_rqsc() from acpi_arch_init() to discover CBQRI
controllers when an RQSC table is present. The RQSC table is optional;
AE_NOT_FOUND is silenced since many systems will not have QoS
controllers. Other ACPI failures are reported as errors.

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@kernel.org>
---
drivers/acpi/riscv/init.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/drivers/acpi/riscv/init.c b/drivers/acpi/riscv/init.c
index 7c00f7995e86..8a74dff42dce 100644
--- a/drivers/acpi/riscv/init.c
+++ b/drivers/acpi/riscv/init.c
@@ -4,12 +4,35 @@
* Author: Sunil V L <sunilvl@ventanamicro.com>
*/

+#define pr_fmt(fmt) "ACPI: RQSC: " fmt
+
#include <linux/acpi.h>
#include "init.h"

void __init acpi_arch_init(void)
{
+ struct acpi_table_header *rqsc;
+ acpi_status status;
+ int rc;
+
riscv_acpi_init_gsi_mapping();
+
if (IS_ENABLED(CONFIG_ACPI_RIMT))
riscv_acpi_rimt_init();
+
+ if (IS_ENABLED(CONFIG_RISCV_ISA_SSQOSID) && !acpi_disabled) {
+ status = acpi_get_table(ACPI_SIG_RQSC, 0, &rqsc);
+ if (status == AE_NOT_FOUND) {
+ /* RQSC is optional; silence on systems without it */
+ } else if (ACPI_FAILURE(status)) {
+ pr_err("failed to get ACPI RQSC table: %s\n",
+ acpi_format_exception(status));
+ } else {
+ rc = acpi_parse_rqsc(rqsc);
+ if (rc < 0)
+ pr_err("failed to parse ACPI RQSC table: %d\n",
+ rc);
+ acpi_put_table(rqsc);
+ }
+ }
}

--
2.43.0