From nobody Sat Feb 7 07:11:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6E183783A4; Wed, 28 Jan 2026 20:28:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769632089; cv=none; b=tt3VlrD4eNrVFt9uomlE2Ua9NumFzancFaE+Rn76vUOZQ0HHrc0VzAEwr1xcEtNouCgevqzXPPUuKpwlu+Ys6IWUovYSNyIw5WuepfdsKhdxgru/Tpy+Sryj6ZpjD8CZTb8i9Ifeqq5vL2EhL9r6OjgwMk0WUTIzpbVvWbXYdK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769632089; c=relaxed/simple; bh=jw+AW2ohMGVwE01frppRYwsxi/H3/LBPifNRE5CWvac=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qfZxSixkHYqA8NwXrjSVzAUs5KTBYbtYuWggckdfibKAKccQ49FFsz87aeJXTL4cz07f+1+JJYqj4eiRXpzQ1GCqkTOCw9lj6wEn88Hn5kW2vZSJWoD+SZA8U/6aIU/Uhoi+8NQKBUpP1p0k4T5QRc5MaWmIA3OGL7QimTvoV4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PFEyCSFY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PFEyCSFY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58B83C16AAE; Wed, 28 Jan 2026 20:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769632088; bh=jw+AW2ohMGVwE01frppRYwsxi/H3/LBPifNRE5CWvac=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PFEyCSFY9buxPwA/UYfJ9y6TzNhi5d7Mf6yymH4zM5ftIqAxhd1mF4xPxnGghHzhn wVGMsgsb4yUrKbkbpI+5juyIXr2R4W2x0YmNhly8WM/cqyQJc6hvE7b0fQEYN8AR3y Di/wJ+Zuj1HCiTCTrlhcodoqTVkKv+tFGNa17wxeALUAzDSeX6fKk9NKtpJ8Aggmp0 PeLCIOKP+Z3m9OdCjPGIk5OMnC/GWqilwJHyt9zs8u3apVLhdEATe7N9OPz9t/zM3i lAZx3dNodfFAy350LNxRgFjbn34XG+sijz9MRiyIArDCul9XidFcPasnQGQ6CPi/Cx MepzuFjh+aGUg== From: Drew Fustini Date: Wed, 28 Jan 2026 12:27:31 -0800 Subject: [PATCH RFC v2 10/17] RISC-V: QoS: add late_initcall to setup resctrl interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-ssqosid-cbqri-v2-10-dca586b091b9@kernel.org> References: <20260128-ssqosid-cbqri-v2-0-dca586b091b9@kernel.org> In-Reply-To: <20260128-ssqosid-cbqri-v2-0-dca586b091b9@kernel.org> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , =?utf-8?q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , Samuel Holland , Adrien Ricciardi , Nicolas Pitre , =?utf-8?q?Kornel_Dul=C4=99ba?= , Atish Patra , Atish Kumar Patra , Vasudevan Srinivasan , Ved Shanbhogue , yunhui cui , Chen Pei , Liu Zhiwei , Weiwei Li , guo.wenjia23@zte.com.cn, liu.qingtao2@zte.com.cn, Reinette Chatre , Tony Luck , Babu Moger , Peter Newman , Fenghua Yu , James Morse , Ben Horgan , Dave Martin , Drew Fustini , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, Rob Herring , "Rafael J. Wysocki" , Len Brown , Robert Moore , Sunil V L , Krzysztof Kozlowski , Conor Dooley Cc: Paul Walmsley , linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, devicetree@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1362; i=fustini@kernel.org; h=from:subject:message-id; bh=jw+AW2ohMGVwE01frppRYwsxi/H3/LBPifNRE5CWvac=; b=owGbwMvMwCV2+43O4ZsaG3kYT6slMWRWFQbkXNyQ4ne0/N2Myrrrzzb82uG803Fee4CQVrjJ5 PURjJKzOkpZGMS4GGTFFFk2fci7sMQr9OuC+S+2wcxhZQIZwsDFKQATifnOyDBdaNvy9TZJU7fN cne4bfFXNnyS2tGelI9iyy8+8vf+OzGL4X9e5UnDRbFBxsbK4pN3Osyqf3m/y7RColuJ64Bh0sl tW3kB X-Developer-Key: i=fustini@kernel.org; a=openpgp; fpr=1B6F948213EA489734F3997035D5CD577C1E6010 Add late_initcall which checks if the Ssqosid extension is present, and if so, calls resctrl setup and sets cpu hotplug state to "qos:online". Co-developed-by: Adrien Ricciardi Signed-off-by: Adrien Ricciardi Signed-off-by: Drew Fustini --- arch/riscv/kernel/qos/qos.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/riscv/kernel/qos/qos.c b/arch/riscv/kernel/qos/qos.c index 7b06f7ae9056..2cd5d7be1d10 100644 --- a/arch/riscv/kernel/qos/qos.c +++ b/arch/riscv/kernel/qos/qos.c @@ -1,5 +1,32 @@ // SPDX-License-Identifier: GPL-2.0-only +#include +#include +#include +#include +#include + +#include #include =20 +#include "internal.h" + /* cached value of sqoscfg csr for each cpu */ DEFINE_PER_CPU(u32, cpu_srmcfg); + +static int __init qos_arch_late_init(void) +{ + int err; + + if (!riscv_isa_extension_available(NULL, SSQOSID)) + return -ENODEV; + + err =3D qos_resctrl_setup(); + if (err !=3D 0) + return err; + + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "qos:online", qos_resctrl_online_c= pu, + qos_resctrl_offline_cpu); + + return err; +} +late_initcall(qos_arch_late_init); --=20 2.43.0