From nobody Mon Sep 28 17:48:33 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 579DD3C8716 for ; Wed, 19 Aug 2026 16:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158579; cv=none; b=Pt1tCrQZk1z7FGzRLY1qZ2n5uvi6PW7Mk3Vpy35g4DVmaS8dnI/l0j7gfmL2CrVso5zHR/lQAn/ndoNJHgt6zHoJ2EroNhGKV1qGobNILGLDKpZ5Moj51RPULHeBIQCdtWvquBaAdz0EXGgBPk61kjncHZbKXY5dKuPcLxQi7Vo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158579; c=relaxed/simple; bh=9xyRHdCgfMca3bMdWZS8InA9gKlr/oUn9ZYnEn8KGeU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ocZZ22xA9Ufw6U8o6v565Xzy1D4pyGRb0pTZLDb/+fEnN9DLlWvXtFo9CXbGMFBPxm7+Oqy/M1R5ixU1j/0X0jJR4vgZ2c5PRp2QNIHit9ThSU0BrcPZrWPV8GvpOmUH0r2ie50sKSjnOxteJrXW3s1xDfLR2GKCHWYGgbcujtM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=HHUXrl9p; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YEIWSQRp; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="HHUXrl9p"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YEIWSQRp" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67JF2c1j1174009 for ; Wed, 19 Aug 2026 16:56:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=GvKKPhwjd49 meQYxdaIJIhbpEz/EwQIgAg0VwR46sfE=; b=HHUXrl9pI8YvE06iplCm1N7srKI P07VGc/qiCN6FdJpENu5NDLCocT8Dc3IKXz+d13w5kDRYkZeZg3wgQ5mwRAb1vwZ HyYWBSjfWjn/s2DZfVYYtLSxyxaZGIlOkmPjIT/4vKr6mHOMPuNtG4lu7tRE+4dt F6CMRnmMb49ZKr0r4eYJh9lktoa+CJ3T5/0DBbPiYEJuutG8+EZJQUlnUV3yp41P iZ+YuJrSzzfQw6PUqc/ImWr0TB3kygKvGTVLjxhTOklrsoLetBc0rMfQ54Nk5U73 sklhgxqHqRWEajJ7ongjBgNPfxQJXnABFBF/cgsEw5j14UxxOTi3CmDxp0Q== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5esj0kxp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 19 Aug 2026 16:56:16 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-930a098ea19so197704485a.1 for ; Wed, 19 Aug 2026 09:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787158575; x=1787763375; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GvKKPhwjd49meQYxdaIJIhbpEz/EwQIgAg0VwR46sfE=; b=YEIWSQRpb9VnIGegpyJgAixh3MtYB93/mfjmqjq+cPuJNkk0NOFHpU8IImXL7nwOR2 UYuPmhAyNHYxCRdQh1Ra3HjlA+wO+2VTZcpGCwmMzLrYgsuxtB2yEtUfOK1bokaWEoFD s08U85wYm8hbUo6cTeq+NvnMRt5InDBa4NqRQJA1THq208Jyt5us6YdCIJ//pTH78JqK LFonhQO2v3E89SF5Zk1nxU4x5gz3eOtRF45C9f4uFVPsohLfWTx7eUpLGDftEN9wzJtI qMV5u/Ro0+olNrD3fp7XNKpiK+wrlnp/l9N5MHz9D/IIlhlLyMQALo2gjKFTtrTK3uSR 9b8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787158575; x=1787763375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=GvKKPhwjd49meQYxdaIJIhbpEz/EwQIgAg0VwR46sfE=; b=XRlgojXb35Nwc7vsD03ETTo/bPye7tQ7Ftmt7AcldF3P7J7Dn2HIX/on8QJdfrZwtv UkdOUb4gHkMI/rtotpyWuqoDZjpW9HKcAe4GAma8DbnSgvpyY3so0LeBITGtHoMP8xpA 09U4wUbA19bW+NN+qaBcwdFr8DFIAzvjMbguX2cHFtHXPsabCXDtwvcRiQHkKv3ji2Gg uqLIzrPf0VyehzkEybxEUE68v4mqVCHTLnQMhVlevlVB8NnEsBlyJIUMnQ5O21+Qqx07 u4365FJF07uXi8YpWpQjhNk1gKShE7Dhos1n/fisDIuCTMjKdr/70vMTOfrgOYgdqqOe /r4g== X-Gm-Message-State: AOJu0YysHm9aXCJC3vKy1Locm7l2MD8Atikcj8sLOHNg6IULdZuWKJHK lQ2BuWMdgHARcgiIhYjkSykZJ/uBLjYXo+SYPzY8Eu++AlZMtxLAG4WvsP3T0OB8qaAtnGvfgiQ I3jOxA5MWicJapsN9ojbpUg1C6lpOktJ6/dvyIIcjnvIgUdPpj1rmmGijpzrF9WlPlbj6yAADtg c= X-Gm-Gg: AR+sD12pkBUD0vBN58W+7ZRj1eCC78f8ABer02Mub+DcbzDei2RWKV3aCEYXWkyS5c/ 801RxvIllwWLvKGoJgCN4l5T1nxyBxaKytoIjJr6zxb1kh9t0xuL9nlttCgSVW8FCU89uqnQOQE 7rpvDN2BgkNTOf1Ril6X+870FTtagj6J5ET1qjMYQZBIqSul+IZQ3bT3Z9a18a+L64ATigyixoO x+x8u09FrTk1B3QxSuzvBjElvI69XeLUG1WJMVfJ/Ugk9tkkKTWiFOM61fxUyedS5+8o5ws6Z12 pRGc9yxf0qWRKsj+eKk3DQM8qHHygdlOjSqe0mvwaDGwtPAa4YI0TbLnDkEQHkbTPwrPIqnjNuT wPDeECXzMEeL+KpZKzHKcK8rnKQhv X-Received: by 2002:a05:620a:1a02:b0:92e:6637:da3 with SMTP id af79cd13be357-9371e6ee95dmr490167985a.38.1787158575135; Wed, 19 Aug 2026 09:56:15 -0700 (PDT) X-Received: by 2002:a05:620a:1a02:b0:92e:6637:da3 with SMTP id af79cd13be357-9371e6ee95dmr490161685a.38.1787158574597; Wed, 19 Aug 2026 09:56:14 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2e33:a343:bae0:905b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1441c78sm6952317f8f.2.2026.08.19.09.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 09:56:13 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@oss.qualcomm.com, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 1/4] powercap: dtpm: Remove duplicate RK3399 CPU hierarchy nodes Date: Wed, 19 Aug 2026 18:56:02 +0200 Message-ID: <20260819165605.1398880-2-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> References: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: xYTuzIZIq_hqE--Ln1hmQWMBy-8V4PfM X-Authority-Analysis: v=2.4 cv=EaL4hvmC c=1 sm=1 tr=0 ts=6a85e030 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=mWFzwBaPd1sawqwuj-4A:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX9+JMod5OQVk+ a5MPMltR61MjgMww+6VGwsC8OMa0asdmr2d9wp/lkNqgiFp+tl09N7XSsqdjrUw9NybRlT924NQ qzizBETEizqszZVMvHXXsHnhvSabfIHQCRfAVvij1kfInF9QaIxTF17T+1SwiDf74yN24G09xxX GBNigZXS7ABJ2/As2QD1iA1bppH83b5XivoM1HA4i5iEF63FSj49vmjhjCffmVH4Dg9jTp11MXD 6Vqk+u2zbNhxW8ks00+B8s9BuyZLCROrhDvX285PM8g7tW+zdzA69z/8dKsZYHnRoEJf3UYW+aW 8BiBUchhexG7cls/ARWjR0X164q00JjzmZZd+ooFijQxbl0lP3EdC258WLJyd3d2EVLCawop5qF VT3ungxIi8hQIz8y20aNy4YBxxgIdfpqLoIEH1uH7kpyTAOunegmBz7ER0QbkoekQsYheX9SiZI 0qUgIsbRXDHFUkeQq8w== X-Proofpoint-Spam-Info: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX+dZDDWgJ5Vp9 mvp7E4N9F5saUJwwiX2JubPAPHeiqdwPVKX2OgxAj+J189g0Hcop/roBEfMi4MD0wDxRLHsFNaf 32g7slAm6E0LBDaxoMl7pKIdFFY5A9o= X-Proofpoint-ORIG-GUID: xYTuzIZIq_hqE--Ln1hmQWMBy-8V4PfM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_04,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 adultscore=0 suspectscore=0 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608190131 Content-Type: text/plain; charset="utf-8" The DTPM CPU backend registers one powercap zone per cpufreq policy, not per CPU. On RK3399, CPUs sharing the same cpufreq policy therefore map to the same DTPM zone. Remove the redundant CPU nodes from the RK3399 hierarchy and keep only one CPU node per cpufreq policy. This avoids registering the same DTPM CPU zone multiple times while preserving the two CPU clusters and the GPU in the hierarchy. Signed-off-by: Daniel Lezcano --- drivers/soc/rockchip/dtpm.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/soc/rockchip/dtpm.c b/drivers/soc/rockchip/dtpm.c index b36d4f752c30..e6a0c607334b 100644 --- a/drivers/soc/rockchip/dtpm.c +++ b/drivers/soc/rockchip/dtpm.c @@ -20,25 +20,13 @@ static struct dtpm_node __initdata rk3399_hierarchy[] = =3D { [2] =3D { .name =3D "/cpus/cpu@0", .type =3D DTPM_NODE_DT, .parent =3D &rk3399_hierarchy[1] }, - [3] =3D { .name =3D "/cpus/cpu@1", + [3] =3D { .name =3D "/cpus/cpu@100", .type =3D DTPM_NODE_DT, .parent =3D &rk3399_hierarchy[1] }, - [4] =3D { .name =3D "/cpus/cpu@2", + [4] =3D { .name =3D "/gpu@ff9a0000", .type =3D DTPM_NODE_DT, .parent =3D &rk3399_hierarchy[1] }, - [5] =3D { .name =3D "/cpus/cpu@3", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [6] =3D { .name =3D "/cpus/cpu@100", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [7] =3D { .name =3D "/cpus/cpu@101", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [8] =3D { .name =3D "/gpu@ff9a0000", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [9] =3D { /* sentinel */ } + [5] =3D { /* sentinel */ } }; =20 static struct of_device_id __initdata rockchip_dtpm_match_table[] =3D { --=20 2.43.0 From nobody Mon Sep 28 17:48:33 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 AE29448A2A9 for ; Wed, 19 Aug 2026 16:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158581; cv=none; b=T6Pur5kxLkNkGWsUB6FnWtxsM7h7PaZPKyzrIXSRjZCCfJVG6pN8i8waf26KhL0eKi4y17B+D+N7sLJFCtE7r4sAkYAihSr0u+BQ0RB7Wjeipb02O2+DsNS0ryRoTqwrh4JEa43TxWMyobvV6dBDmMVphNCxq8CaLDgVGX21mUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158581; c=relaxed/simple; bh=d4z/t7Syx8TEgyQCSRPsF3wN17m41lysMVALd8mRK2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gtE64H2FOYFdfncLaERPtvys9DmHyUGbqc+1qj7NidW0xLntDmhxoiRUCa1xxft4lnmPWm2FEjdTW7GtMKghCUce8VYfFqrVoGdQrnTKrTUlsP7Bowxcmlaoidggce81kJjlxZrMf+qXx8/oewfHF8W8+nu2TIcUhrGeyR+P3T4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=pni0W7hg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Sv4MRbaK; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="pni0W7hg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Sv4MRbaK" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67JF1BT83869651 for ; Wed, 19 Aug 2026 16:56:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=OMTyHQQCfMh 7kqySui+IAhPuachiF8Vbnkdm627Ftss=; b=pni0W7hg1uYWYUBbfg5KofXMImV BjTGpbmmxKQ4M75ej5fGFSyFRrCKB612KVkc185Di74AE2Z/aMuWaANY7i0X7uii AjAm2+lVnIZMcxuVeaRGvEkjJ8DlLYBkH/FORC5hS0uVbora0ACbjsBNNntIdziW 7Dmsnioit/MX7U7UGQEuL+O48fJG7BajrV3My02tP6fZLOR8D/aTy4K33B5qo9S4 aRFd7uzjyBhZLNxl6BEb7lqjP+Rqc5sN84vyosciXYtVOpOAUcDBH0zrCQGYbN/M tYJeCWdoPxGlETN4Nr5bd6g8BdKdu9UxJ/5xR9NgRlOuufQ6dNqBvrRHvzQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5ervgmyv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 19 Aug 2026 16:56:17 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-92e695a3b28so10485485a.1 for ; Wed, 19 Aug 2026 09:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787158577; x=1787763377; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OMTyHQQCfMh7kqySui+IAhPuachiF8Vbnkdm627Ftss=; b=Sv4MRbaKyyqBGl8mtk5pPhVKmqqmIDnVUUYD6EyxjSF/oGmTFZJljv5ToqeLvuINDk DQs/QQ5ShhhO21UAtTJ8irQU737oGB0+3AF8xoturS5GXxT3ZL4ehWfQS3NIsJsoX40Q LlFrYz/fZpOBB6nGeFyrtHIyBzgNhYuMDKOhAU1k5xwWXQF4PbJ7v4ruzJmCPTXGysne ge7XVIdR6u4ObijNW/QEf+PQP0sSLS+MEhwhpyiykMehaz/O5BLpsQ9Nk8EA4Cc9q0j1 3pjJv/YZJfffE98ddPLjgAvPwWzWqPE9W1qorZx1QH9MoJEysHjiOfv8IDKHOk6+I4k5 0m0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787158577; x=1787763377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OMTyHQQCfMh7kqySui+IAhPuachiF8Vbnkdm627Ftss=; b=EpD2oh15h07QY4YShEMZM/oDPgPu77DevUTSgpGrpM+OHEPd3qwU0kjYuwx94X/1T8 ypHynxFslKEnii8Rv8d3ZwYvxpa+kfSJiByPGkpG3dJfFlXxVrMDihWnYp1xMrxC10Jk LDIXwWP7RC6WUSHCMhQ40QhsxhbCubBiN5V9bDDoUhnLCGl5GMshD4xDpjoPYnbUf23v C121pJye27+38azqpwfR/tMTcr59UieyTuEVwURTJ2fqhKsrtTYW5Ifc8wN1g9ZXEy42 UhBmzyMi8tfrPHh4fkPVSmCHCheFqSLj66xCM/U8ueE8roH8QhC4ycyio8Hcm1Hkvlc7 bpmw== X-Gm-Message-State: AOJu0YxLQ2f2/U2Aux0YliehdiOeUGSuEbODjo1D8QJHoljKrelZOOj3 00Niya2mZAElwkBPSmByMZE0zGI4oZj5+fDP6ImzxPHPecokU2WAHLVQhUpfT5wBlF7O8F8eghf 5FXqY1Q0Edk6/LAFscFP6VyUaKqKDKRoW9f10+8ENCCag0F3+lPXM/7xpwndpdR6W3ng= X-Gm-Gg: AR+sD11+B6QQCqmFSINJFzZ4iP29awHrJEgSDeoIoN7fNyMlo0uwwb6CZ1otZJrBm3X APlF1QnMPKs2vchwput7PhKjr0KZSreiwuviCvz2StMB42JIADcvHqbrM9epf9AWPzYgt1lvWUW uYAeYxsXPEbdZOmWD47uuPqSrImEMCnE9tq5Xe9a/qjmUtkAkM3jRq+nNIdYf8KA2EnYdfJsJkp psRu89du8MHUAzZmZrNzw863qTLoafmKhPsvgfns+ld2jbwdw2So01pNQww44bxkQDC0WKDn4Ku +ukH+lrW5wXNLC3FLxwXXlFzb0uj2oHV6GzCPR/yBQFddPiRZr/+SNTHlnzyBA0X4DC06VExWvD yBeCIV8pBP7aQkEzznrnVVLdZ1fQ3 X-Received: by 2002:a05:620a:268f:b0:92b:6e09:b0d9 with SMTP id af79cd13be357-9372858eaaemr57889885a.21.1787158576109; Wed, 19 Aug 2026 09:56:16 -0700 (PDT) X-Received: by 2002:a05:620a:268f:b0:92b:6e09:b0d9 with SMTP id af79cd13be357-9372858eaaemr57882485a.21.1787158575513; Wed, 19 Aug 2026 09:56:15 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2e33:a343:bae0:905b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1441c78sm6952317f8f.2.2026.08.19.09.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 09:56:15 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@oss.qualcomm.com, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 2/4] powercap: dtpm: Use generic powercap hierarchy helpers Date: Wed, 19 Aug 2026 18:56:03 +0200 Message-ID: <20260819165605.1398880-3-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> References: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: PzENGmpxWJMlWox262XbFu-g3DivEInL X-Authority-Analysis: v=2.4 cv=VZ3H+lp9 c=1 sm=1 tr=0 ts=6a85e031 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=j7aLo_kv3ohkNa-rISMA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfXxa/ePQrFpi0+ VvUqDQVkRy/72ph9r+JxQW0RPfg8q3m92KY0zlDzwQTdeTAedLRjsveV31HlJbN+fVOuFbu6CIr 46+52/EP72R6LIwWGOJMXlHfc53euYkScxODCy1M+/tA/9kVXIhIIhap2va8Rckaoulmnj22XWe oAyJ/KoIXK+k7zJCF+TDd+eIHcEjvAXWiub65kDjsOz2mA6sB9OtLlVrXlH5cWKtXKNuKvvvOH3 JB7pnF+prlfM9d5kDe47oq1/+xURVZ+ykCcfy9gOQmcu8JtAKA+EVtC1Tx0Df7mSdt9CNG3VYc7 9L87B7AHnYUOHBtS3/UE/tcdYtPqEa1SyMeSttEqYs+K2/cDYiK6ObUnvG8h3a8FQJNQ3pRa3wc b7jldayp3uZYaZjl0H/XUTf8lE8MKBzMDZI3m8xaCzarj1PRJE+yKb8QbUlc/4Md1gFFsiyPEuy gYnzSiH/EkvuGYyOCKw== X-Proofpoint-ORIG-GUID: PzENGmpxWJMlWox262XbFu-g3DivEInL X-Proofpoint-Spam-Info: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX4bhS0j9UYL/w w1/2Rcahrx/xa+7ThGjqmIZPDvCSMyPEN/1ywgWnMjNEU2WXJTh9wmgFfP5jdt1FnzaV1c68Tpx GwZnv1OH5RZ+HhAEQsBdBA4IbNYt7kg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_04,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608190131 Content-Type: text/plain; charset="utf-8" DTPM implements its own hierarchy creation and destruction logic while the powercap core now provides generic helpers for this purpose. Convert DTPM to use the generic powercap hierarchy infrastructure. Duplicate the platform hierarchy before creating it, and use powercap_hierarchy_create() and powercap_hierarchy_destroy() to manage the DTPM zones. Add DTPM callbacks to create and destroy the zones associated with each powercap hierarchy node. Adapt the CPU and devfreq backends to return the created DTPM instance and use the node name provided by the hierarchy. Convert the Rockchip RK3399 description to struct powercap_hierarchy and keep the device tree path as DTPM-specific node data. This removes the DTPM-specific hierarchy traversal and destruction code and leaves the hierarchy management to the powercap core. Signed-off-by: Daniel Lezcano --- drivers/powercap/dtpm.c | 165 ++++++++++++++------------------ drivers/powercap/dtpm_cpu.c | 22 ++--- drivers/powercap/dtpm_devfreq.c | 22 +++-- drivers/soc/rockchip/dtpm.c | 67 +++++++++---- include/linux/dtpm.h | 5 +- 5 files changed, 147 insertions(+), 134 deletions(-) diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index b7a65e543f19..d719f9595ec5 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -35,6 +35,7 @@ static const char *constraint_name[] =3D { =20 static DEFINE_MUTEX(dtpm_lock); static struct powercap_control_type *pct; +static struct powercap_hierarchy *dtpm_hierarchy; static struct dtpm *root; =20 static int get_time_window_us(struct powercap_zone *pcz, int cid, u64 *win= dow) @@ -412,8 +413,7 @@ int dtpm_register(const char *name, struct dtpm *dtpm, = struct dtpm *parent) return 0; } =20 -static struct dtpm *dtpm_setup_virtual(const struct dtpm_node *hierarchy, - struct dtpm *parent) +static struct dtpm *dtpm_setup_virtual(const char *name, struct dtpm *pare= nt) { struct dtpm *dtpm; int ret; @@ -423,10 +423,9 @@ static struct dtpm *dtpm_setup_virtual(const struct dt= pm_node *hierarchy, return ERR_PTR(-ENOMEM); dtpm_init(dtpm, NULL); =20 - ret =3D dtpm_register(hierarchy->name, dtpm, parent); + ret =3D dtpm_register(name, dtpm, parent); if (ret) { - pr_err("Failed to register dtpm node '%s': %d\n", - hierarchy->name, ret); + pr_err("Failed to register dtpm node '%s': %d\n", name, ret); kfree(dtpm); return ERR_PTR(ret); } @@ -434,90 +433,84 @@ static struct dtpm *dtpm_setup_virtual(const struct d= tpm_node *hierarchy, return dtpm; } =20 -static struct dtpm *dtpm_setup_dt(const struct dtpm_node *hierarchy, +static struct dtpm *dtpm_setup_dt(const char *name, const char *path, struct dtpm *parent) { struct device_node *np; - int i, ret; + struct dtpm *dtpm =3D NULL; + int i; =20 - np =3D of_find_node_by_path(hierarchy->name); + np =3D of_find_node_by_path(path); if (!np) { - pr_err("Failed to find '%s'\n", hierarchy->name); + pr_err("Failed to find '%s'\n", path); return ERR_PTR(-ENXIO); } =20 for (i =3D 0; i < ARRAY_SIZE(dtpm_subsys); i++) { + struct dtpm *tmp; =20 if (!dtpm_subsys[i]->setup) continue; =20 - ret =3D dtpm_subsys[i]->setup(parent, np); - if (ret) { - pr_err("Failed to setup '%s': %d\n", dtpm_subsys[i]->name, ret); - of_node_put(np); - return ERR_PTR(ret); + tmp =3D dtpm_subsys[i]->setup(parent, np, name); + if (IS_ERR(tmp)) { + pr_err("Failed to setup '%s': %ld\n", + dtpm_subsys[i]->name, PTR_ERR(tmp)); + dtpm =3D tmp; + break; + } + + if (tmp) { + dtpm =3D tmp; + break; } } =20 of_node_put(np); =20 - /* - * By returning a NULL pointer, we let know the caller there - * is no child for us as we are a leaf of the tree - */ - return NULL; + return dtpm; } =20 -typedef struct dtpm * (*dtpm_node_callback_t)(const struct dtpm_node *, st= ruct dtpm *); - -static dtpm_node_callback_t dtpm_node_callback[] =3D { - [DTPM_NODE_VIRTUAL] =3D dtpm_setup_virtual, - [DTPM_NODE_DT] =3D dtpm_setup_dt, -}; - -static int dtpm_for_each_child(const struct dtpm_node *hierarchy, - const struct dtpm_node *it, struct dtpm *parent) +static struct powercap_zone * +dtpm_node_create(struct powercap_control_type *pct, const char *name, + void *data, struct powercap_zone *parent) { + struct dtpm_node *node =3D data; + struct dtpm *dtpm_parent =3D parent ? to_dtpm(parent) : NULL; struct dtpm *dtpm; - int i, ret; =20 - for (i =3D 0; hierarchy[i].name; i++) { + if (!node) + return ERR_PTR(-EINVAL); + + switch (node->type) { + case DTPM_NODE_VIRTUAL: + dtpm =3D dtpm_setup_virtual(name, dtpm_parent); + break; + case DTPM_NODE_DT: + dtpm =3D dtpm_setup_dt(name, node->path, dtpm_parent); + break; + default: + return ERR_PTR(-EINVAL); + } =20 - if (hierarchy[i].parent !=3D it) - continue; + if (IS_ERR(dtpm)) + return ERR_CAST(dtpm); =20 - dtpm =3D dtpm_node_callback[hierarchy[i].type](&hierarchy[i], parent); + if (!dtpm) + return ERR_PTR(-ENODEV); =20 - /* - * A NULL pointer means there is no children, hence we - * continue without going deeper in the recursivity. - */ - if (!dtpm) - continue; + return &dtpm->zone; +} =20 - /* - * There are multiple reasons why the callback could - * fail. The generic glue is abstracting the backend - * and therefore it is not possible to report back or - * take a decision based on the error. In any case, - * if this call fails, it is not critical in the - * hierarchy creation, we can assume the underlying - * service is not found, so we continue without this - * branch in the tree but with a warning to log the - * information the node was not created. - */ - if (IS_ERR(dtpm)) { - pr_warn("Failed to create '%s' in the hierarchy\n", - hierarchy[i].name); - continue; - } +static void dtpm_node_destroy(struct powercap_control_type *pct, + struct powercap_zone *zone, void *data) +{ + struct dtpm *dtpm =3D to_dtpm(zone); =20 - ret =3D dtpm_for_each_child(hierarchy, &hierarchy[i], dtpm); - if (ret) - return ret; - } + if (dtpm =3D=3D root) + root =3D NULL; =20 - return 0; + dtpm_unregister(dtpm); } =20 /** @@ -528,27 +521,16 @@ static int dtpm_for_each_child(const struct dtpm_node= *hierarchy, * description of the different node in the hierarchy. It creates the * tree in the sysfs filesystem under the powercap dtpm entry. * - * The expected tree has the format: - * - * struct dtpm_node hierarchy[] =3D { - * [0] { .name =3D "topmost", type =3D DTPM_NODE_VIRTUAL }, - * [1] { .name =3D "package", .type =3D DTPM_NODE_VIRTUAL, .parent =3D &hi= erarchy[0] }, - * [2] { .name =3D "/cpus/cpu0", .type =3D DTPM_NODE_DT, .parent =3D &hier= archy[1] }, - * [3] { .name =3D "/cpus/cpu1", .type =3D DTPM_NODE_DT, .parent =3D &hier= archy[1] }, - * [4] { .name =3D "/cpus/cpu2", .type =3D DTPM_NODE_DT, .parent =3D &hier= archy[1] }, - * [5] { .name =3D "/cpus/cpu3", .type =3D DTPM_NODE_DT, .parent =3D &hier= archy[1] }, - * [6] { } - * }; - * - * The last element is always an empty one and marks the end of the - * array. + * The platform description is a struct powercap_hierarchy. The private + * data associated with each powercap node describes how DTPM creates the + * corresponding zone. * * Return: zero on success, a negative value in case of error. Errors * are reported back from the underlying functions. */ int dtpm_create_hierarchy(struct of_device_id *dtpm_match_table) { - const struct dtpm_node *hierarchy; + const struct powercap_hierarchy *hierarchy; int i, ret; =20 mutex_lock(&dtpm_lock); @@ -571,9 +553,17 @@ int dtpm_create_hierarchy(struct of_device_id *dtpm_ma= tch_table) goto out_err; } =20 - ret =3D dtpm_for_each_child(hierarchy, NULL, NULL); - if (ret) + dtpm_hierarchy =3D powercap_hierarchy_dup(hierarchy); + if (IS_ERR(dtpm_hierarchy)) { + ret =3D PTR_ERR(dtpm_hierarchy); + dtpm_hierarchy =3D NULL; goto out_err; + } + + ret =3D powercap_hierarchy_create(pct, dtpm_hierarchy, + dtpm_node_create, dtpm_node_destroy); + if (ret) + goto out_free_hierarchy; =09 for (i =3D 0; i < ARRAY_SIZE(dtpm_subsys); i++) { =20 @@ -590,6 +580,9 @@ int dtpm_create_hierarchy(struct of_device_id *dtpm_mat= ch_table) =20 return 0; =20 +out_free_hierarchy: + powercap_hierarchy_free(dtpm_hierarchy); + dtpm_hierarchy =3D NULL; out_err: powercap_unregister_control_type(pct); out_pct: @@ -601,20 +594,6 @@ int dtpm_create_hierarchy(struct of_device_id *dtpm_ma= tch_table) } EXPORT_SYMBOL_GPL(dtpm_create_hierarchy); =20 -static void __dtpm_destroy_hierarchy(struct dtpm *dtpm) -{ - struct dtpm *child, *aux; - - list_for_each_entry_safe(child, aux, &dtpm->children, sibling) - __dtpm_destroy_hierarchy(child); - - /* - * At this point, we know all children were removed from the - * recursive call before - */ - dtpm_unregister(dtpm); -} - void dtpm_destroy_hierarchy(void) { int i; @@ -624,7 +603,7 @@ void dtpm_destroy_hierarchy(void) if (!pct) goto out_unlock; =20 - __dtpm_destroy_hierarchy(root); + powercap_hierarchy_destroy(pct, dtpm_hierarchy, dtpm_node_destroy); =09 =20 for (i =3D 0; i < ARRAY_SIZE(dtpm_subsys); i++) { @@ -635,8 +614,10 @@ void dtpm_destroy_hierarchy(void) dtpm_subsys[i]->exit(); } =20 + powercap_hierarchy_free(dtpm_hierarchy); powercap_unregister_control_type(pct); =20 + dtpm_hierarchy =3D NULL; pct =3D NULL; =20 root =3D NULL; diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index 21355db6419d..c8e02eda701c 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -189,22 +189,21 @@ static int cpuhp_dtpm_cpu_online(unsigned int cpu) return 0; } =20 -static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) +static struct dtpm *__dtpm_cpu_setup(int cpu, struct dtpm *parent, const c= har *name) { struct dtpm_cpu *dtpm_cpu; struct cpufreq_policy *policy; struct em_perf_state *table; struct em_perf_domain *pd; - char name[CPUFREQ_NAME_LEN]; - int ret =3D -ENOMEM; + int ret; =20 dtpm_cpu =3D per_cpu(dtpm_per_cpu, cpu); if (dtpm_cpu) - return 0; + return NULL; =20 policy =3D cpufreq_cpu_get(cpu); if (!policy) - return 0; + return NULL; =20 pd =3D em_cpu_get(cpu); if (!pd || em_is_artificial(pd)) { @@ -224,8 +223,6 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *paren= t) for_each_cpu(cpu, policy->related_cpus) per_cpu(dtpm_per_cpu, cpu) =3D dtpm_cpu; =20 - snprintf(name, sizeof(name), "cpu%d-cpufreq", dtpm_cpu->cpu); - ret =3D dtpm_register(name, &dtpm_cpu->dtpm, parent); if (ret) goto out_kfree_dtpm_cpu; @@ -240,7 +237,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *paren= t) goto out_dtpm_unregister; =20 cpufreq_cpu_put(policy); - return 0; + return &dtpm_cpu->dtpm; =20 out_dtpm_unregister: dtpm_unregister(&dtpm_cpu->dtpm); @@ -253,18 +250,19 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *par= ent) =20 release_policy: cpufreq_cpu_put(policy); - return ret; + return ERR_PTR(ret); } =20 -static int dtpm_cpu_setup(struct dtpm *dtpm, struct device_node *np) +static struct dtpm *dtpm_cpu_setup(struct dtpm *dtpm, struct device_node *= np, + const char *name) { int cpu; =20 cpu =3D of_cpu_node_to_id(np); if (cpu < 0) - return 0; + return NULL; =20 - return __dtpm_cpu_setup(cpu, dtpm); + return __dtpm_cpu_setup(cpu, dtpm, name); } =20 static int dtpm_cpu_init(void) diff --git a/drivers/powercap/dtpm_devfreq.c b/drivers/powercap/dtpm_devfre= q.c index fa71285dee60..a783601fe74e 100644 --- a/drivers/powercap/dtpm_devfreq.c +++ b/drivers/powercap/dtpm_devfreq.c @@ -144,7 +144,8 @@ static struct dtpm_ops dtpm_ops =3D { .release =3D pd_release, }; =20 -static int __dtpm_devfreq_setup(struct devfreq *devfreq, struct dtpm *pare= nt) +static struct dtpm *__dtpm_devfreq_setup(struct devfreq *devfreq, + struct dtpm *parent, const char *name) { struct device *dev =3D devfreq->dev.parent; struct dtpm_devfreq *dtpm_devfreq; @@ -156,23 +157,23 @@ static int __dtpm_devfreq_setup(struct devfreq *devfr= eq, struct dtpm *parent) ret =3D dev_pm_opp_of_register_em(dev, NULL); if (ret) { pr_err("No energy model available for '%s'\n", dev_name(dev)); - return -EINVAL; + return ERR_PTR(-EINVAL); } } =20 dtpm_devfreq =3D kzalloc_obj(*dtpm_devfreq); if (!dtpm_devfreq) - return -ENOMEM; + return ERR_PTR(-ENOMEM); =20 dtpm_init(&dtpm_devfreq->dtpm, &dtpm_ops); =20 dtpm_devfreq->devfreq =3D devfreq; =20 - ret =3D dtpm_register(dev_name(dev), &dtpm_devfreq->dtpm, parent); + ret =3D dtpm_register(name, &dtpm_devfreq->dtpm, parent); if (ret) { pr_err("Failed to register '%s': %d\n", dev_name(dev), ret); kfree(dtpm_devfreq); - return ret; + return ERR_PTR(ret); } =20 ret =3D dev_pm_qos_add_request(dev, &dtpm_devfreq->qos_req, @@ -185,23 +186,24 @@ static int __dtpm_devfreq_setup(struct devfreq *devfr= eq, struct dtpm *parent) =20 dtpm_update_power(&dtpm_devfreq->dtpm); =20 - return 0; + return &dtpm_devfreq->dtpm; =20 out_dtpm_unregister: dtpm_unregister(&dtpm_devfreq->dtpm); =20 - return ret; + return ERR_PTR(ret); } =20 -static int dtpm_devfreq_setup(struct dtpm *dtpm, struct device_node *np) +static struct dtpm *dtpm_devfreq_setup(struct dtpm *dtpm, struct device_no= de *np, + const char *name) { struct devfreq *devfreq; =20 devfreq =3D devfreq_get_devfreq_by_node(np); if (IS_ERR(devfreq)) - return 0; + return NULL; =20 - return __dtpm_devfreq_setup(devfreq, dtpm); + return __dtpm_devfreq_setup(devfreq, dtpm, name); } =20 struct dtpm_subsys_ops dtpm_devfreq_ops =3D { diff --git a/drivers/soc/rockchip/dtpm.c b/drivers/soc/rockchip/dtpm.c index e6a0c607334b..451417ae5715 100644 --- a/drivers/soc/rockchip/dtpm.c +++ b/drivers/soc/rockchip/dtpm.c @@ -11,26 +11,59 @@ #include #include =20 -static struct dtpm_node __initdata rk3399_hierarchy[] =3D { - [0] =3D { .name =3D "rk3399", - .type =3D DTPM_NODE_VIRTUAL }, - [1] =3D { .name =3D "package", - .type =3D DTPM_NODE_VIRTUAL, - .parent =3D &rk3399_hierarchy[0] }, - [2] =3D { .name =3D "/cpus/cpu@0", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [3] =3D { .name =3D "/cpus/cpu@100", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [4] =3D { .name =3D "/gpu@ff9a0000", - .type =3D DTPM_NODE_DT, - .parent =3D &rk3399_hierarchy[1] }, - [5] =3D { /* sentinel */ } +static struct dtpm_node rk3399_virtual =3D { + .type =3D DTPM_NODE_VIRTUAL, +}; + +static struct dtpm_node rk3399_cpu0 =3D { + .type =3D DTPM_NODE_DT, + .path =3D "/cpus/cpu@0", +}; + +static struct dtpm_node rk3399_cpu4 =3D { + .type =3D DTPM_NODE_DT, + .path =3D "/cpus/cpu@100", +}; + +static struct dtpm_node rk3399_gpu =3D { + .type =3D DTPM_NODE_DT, + .path =3D "/gpu@ff9a0000", +}; + +static struct powercap_node __initdata rk3399_nodes[] =3D { + [0] =3D { + .name =3D "rk3399", + .data =3D &rk3399_virtual, + }, + [1] =3D { + .name =3D "package", + .parent =3D &rk3399_nodes[0], + .data =3D &rk3399_virtual, + }, + [2] =3D { + .name =3D "cpu0-cpufreq", + .parent =3D &rk3399_nodes[1], + .data =3D &rk3399_cpu0, + }, + [3] =3D { + .name =3D "cpu4-cpufreq", + .parent =3D &rk3399_nodes[1], + .data =3D &rk3399_cpu4, + }, + [4] =3D { + .name =3D "ff9a0000.gpu", + .parent =3D &rk3399_nodes[1], + .data =3D &rk3399_gpu, + }, +}; + +static struct powercap_hierarchy __initdata rk3399_hierarchy =3D { + .nodes =3D rk3399_nodes, + .nr_nodes =3D ARRAY_SIZE(rk3399_nodes), }; =20 static struct of_device_id __initdata rockchip_dtpm_match_table[] =3D { - { .compatible =3D "rockchip,rk3399", .data =3D rk3399_hierarchy }, + { .compatible =3D "rockchip,rk3399", .data =3D &rk3399_hierarchy }, {}, }; =20 diff --git a/include/linux/dtpm.h b/include/linux/dtpm.h index a4a13514b730..c0ece6a4d1fe 100644 --- a/include/linux/dtpm.h +++ b/include/linux/dtpm.h @@ -38,7 +38,7 @@ struct dtpm_subsys_ops { const char *name; int (*init)(void); void (*exit)(void); - int (*setup)(struct dtpm *, struct device_node *); + struct dtpm *(*setup)(struct dtpm *, struct device_node *, const char *); }; =20 enum DTPM_NODE_TYPE { @@ -48,8 +48,7 @@ enum DTPM_NODE_TYPE { =20 struct dtpm_node { enum DTPM_NODE_TYPE type; - const char *name; - struct dtpm_node *parent; + const char *path; }; =20 static inline struct dtpm *to_dtpm(struct powercap_zone *zone) --=20 2.43.0 From nobody Mon Sep 28 17:48:33 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 1723E48AE06 for ; Wed, 19 Aug 2026 16:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158581; cv=none; b=rSqFybSU7akGUm/nQ+WUhG9HIUqtHhx6B/MC6i5n8ZfkDaFPN1QoKy/Alj4GE8lLHDHo84860yTiKJzzHz1f4sltIym3cciWsFX3CBqwNbLqpQuEvT+Blz5XCIgemIvxHNG6JcHeVz1o+BLQ0/DeNSPhgZIm1rO7tVSgDzbuKXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158581; c=relaxed/simple; bh=Qrnv8qH2T52Rds3B+tQNiGt/EbIPH7XsOJpXNsPQrZc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V2b2w6eaFf+gvAFj5sGZSPeFD4BOA+u8rGhraGYBGR0iZ29lgSjhMlfjrglJQJGW3RzKi03tbNW4MANkA1HBSQuFct8e4DshFLUsIiPufw/Qdg/LBsji0G38+G0rNKpgRkk6VQa0/8zXUxVMnBW/RYGtagQw90p/MxpyhswGC0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=C3MYYDu6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UWhn7u6D; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="C3MYYDu6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UWhn7u6D" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67JF1DK03869758 for ; Wed, 19 Aug 2026 16:56:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=zIe6pwh84/c gjHJc/ZPARHNyhcZMHDOU3m6rWSmarLw=; b=C3MYYDu6yuNXMf9wnhG8s3G5bS/ dS2KJZ8yTOcdUpUkUkPwNXyOPTjinPVhqJ8mlFYVQB+DF7bsLlWQC20YWzRmj9MC fW8T4OpuXdYB5TtTz0pyVTTbGOkKN8Ophb/+dbYa6M28KCGuVM8hJgGHdJZ5mIAB MOQ9OxRFUCbc+4AFOJRq2UwQNgZVzxGr0AuBTxwOr8ie12a+tFDhQ+11MYtKiGc5 ccBx71/ArPwD8NquMPuqpghS/C10i2qb+SrQ2ENE/YJf8s9G9T7WEYaTdDjTy1XQ 79lW+sn5As+t2n1+zoTlSqdqm5Jug6d9bQUoqzcb8luNZUefQRjQ4N5FcnQ== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5ervgmyw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 19 Aug 2026 16:56:18 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92e8004d60eso236413285a.1 for ; Wed, 19 Aug 2026 09:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787158577; x=1787763377; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zIe6pwh84/cgjHJc/ZPARHNyhcZMHDOU3m6rWSmarLw=; b=UWhn7u6Ddhi4HpN3/ibxw2WxAEW9G/xjco6Id+fzOSwCKFXdErJfwRzwNDhPEKMzul kF9fo2gNcZL0GYOR84UFRFS5L5TD/gg5K9yGrr2Xi8IpKDdiYpKYhRdtOk2Zmajt7LMh n5wHOzlEXwjBkbyx4QOO7ZfvcXa6bdtruxRNoO74Q5VoldXP4oCUG5AV5vSubqt7KOdZ QqiniAFOzC+pHvjV407B8lcsIiLlukXMbAvGYhZMXPlwSbnWUEMdIIGoFuaHpEVJlEbD WA0tV32pDYkgJ6CH3GLHR5LYwpbgonv4/COmDPz4uELRMn8HGFrs4i4nNO5RN5kxspZ0 iN9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787158577; x=1787763377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=zIe6pwh84/cgjHJc/ZPARHNyhcZMHDOU3m6rWSmarLw=; b=hLJT9MAx/Q6hA9K/aSTElSBv/j66v8eDrA9g5CPLnBVE8PKqHronT7cmD+bt6jTtdV Vt+v4fsn9h0mjVid7RHb8X7Rfbjhnqb+rM8aDp9dBVkoHTsaZBJTXxlyru7mDx9LNnlV ijYJXAGaEOmW+pYlt3iKKuKXVspip8jXpbJE90K0MxMZ+0SNP+qUDX0alBwWco0XLUrj PQh6rK+Nx+M2jBjrqH3ERRUrG2ksOVWdsgdjofXzwDkvQjmBPyAwd+xs6iNheHTMgMaG rr5yXPv+vRWB8OrKr8b5kZOQrBWIOneCcLy9oZ2xvEW3BEUD37gx+apXPApvSTSfT4Is bC+w== X-Gm-Message-State: AOJu0YzPb1m3xRIv0NZFy8jrvXjZ8hTKySXwbGoXolUeboXWHy9F9f+P 6WHVK9aGNJBbi8VOo1suPwPXML8XSjq8yWTR+9kobkjY56tASjpXMvsAX4iTqJTo05FV2lX739I iTGvB8tG8eE4tmCRXyHqOcIkYPslN9La/WY6WdRABv6DMskBvPpR0ngjrx3D+7S0ZFPo= X-Gm-Gg: AR+sD11P0PCUkfwJrI8l97ksnTJOWIFVN/8j/kmLxsBttChqj4QvZTCK33+vZtQWnIq LLa3V6df/pH0hvD+WV5qnMhwsW81g59tEnqvRfCk8D7HU9+RLeIGgAcpbX36hfU+ETVmCQE/+2X Q2HQgL5FVtsPHwr5m0qnyt3wsR+iydKqnYQvo8t7qZ3rK1uhRNj9F43XTOprIn00YnEdBog/SOM M/ph9XWj3iOaP4RHjPZ3rS1AvMZPxsue1SmAsWMSRHJxzj4m6gIim4F8wJMl1u4vsAsVNPv3Neo Ahq/p4iXUH3jTI5Lb9Phrh3AZyzuO6M/Txm7DUNUr5EJew3xObNm6wsAg4IdFs7NqER+VDSMP6d a9sCV7sC94McAs3+0pbo9wVQU1JBh X-Received: by 2002:a05:620a:1710:b0:932:ddff:123d with SMTP id af79cd13be357-9371e6f64b6mr620296885a.29.1787158577045; Wed, 19 Aug 2026 09:56:17 -0700 (PDT) X-Received: by 2002:a05:620a:1710:b0:932:ddff:123d with SMTP id af79cd13be357-9371e6f64b6mr620291885a.29.1787158576588; Wed, 19 Aug 2026 09:56:16 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2e33:a343:bae0:905b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1441c78sm6952317f8f.2.2026.08.19.09.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 09:56:15 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@oss.qualcomm.com, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 3/4] powercap: dtpm: Rename Rockchip virtual node descriptor Date: Wed, 19 Aug 2026 18:56:04 +0200 Message-ID: <20260819165605.1398880-4-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> References: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: pIrrjGDScaQzy8bCXhLhGaf9HKaYCiri X-Authority-Analysis: v=2.4 cv=VZ3H+lp9 c=1 sm=1 tr=0 ts=6a85e032 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=_NZqlvP9bvTAGtRSC3sA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX5YZ3ceQGQmYM /OBl5zR7EActJr/GPhXLFS7Gi8/ApMmpyDEONdtsUEPJrJMHePFcO6NJNrQyH9CDebFYzT3OXPJ NbJb+sXdtWN8T4Hzhs+eXr8YwDfU5W0FllnJDu7bRX3zzoQcueHBnnsguk29/TWkKOi1HFJjilm LPjBzWRbjJiswTKJxn5xkoMqPNjfhZ+1ZoEviBATap6xHTko4zCLuDudquTvTnQBWICG2LoN3K/ ymOEteE7BwPGK6UbLE7Ph2sV9KRmkbkAHrH3f77EFpW6SZEccwaqytZyAYJfqwCqUTwgPO4EDX7 MzZYBhgQfLIggI1oJmbv56EqQPHetRkRL4STr+HS6CtbUAs8jbU80xHexo6k9tGQbgTtnI6cZiP R6Tq78cLD6EN5fumdJ5byZDdQRr9psoiWiUFasE4229Np4Ve3jeFDUR8i+y9g0pAEk9fOwXDsmW pRy1sqBeo059D7ZOhvw== X-Proofpoint-ORIG-GUID: pIrrjGDScaQzy8bCXhLhGaf9HKaYCiri X-Proofpoint-Spam-Info: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX93cLzi6VB/ms ZvfegYj3Z+ZNAfIZBkfHKBQX2MvTocPHmRyGdS08XCakvU0h9d6F6YG7KppsfMrMoid3fjwbyO2 BgEbfA0PDgZfiPnDEiNBSWFynyiwJaE= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_04,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608190131 Content-Type: text/plain; charset="utf-8" The virtual DTPM node descriptor is named after the RK3399 even though it does not contain any SoC-specific information. Rename it to rockchip_virtual so it can be reused by other Rockchip SoC hierarchies. No functional change intended. Signed-off-by: Daniel Lezcano --- drivers/soc/rockchip/dtpm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/rockchip/dtpm.c b/drivers/soc/rockchip/dtpm.c index 451417ae5715..5f7f238a15fe 100644 --- a/drivers/soc/rockchip/dtpm.c +++ b/drivers/soc/rockchip/dtpm.c @@ -11,7 +11,7 @@ #include #include =20 -static struct dtpm_node rk3399_virtual =3D { +static struct dtpm_node rockchip_virtual =3D { .type =3D DTPM_NODE_VIRTUAL, }; =20 @@ -33,12 +33,12 @@ static struct dtpm_node rk3399_gpu =3D { static struct powercap_node __initdata rk3399_nodes[] =3D { [0] =3D { .name =3D "rk3399", - .data =3D &rk3399_virtual, + .data =3D &rockchip_virtual, }, [1] =3D { .name =3D "package", .parent =3D &rk3399_nodes[0], - .data =3D &rk3399_virtual, + .data =3D &rockchip_virtual, }, [2] =3D { .name =3D "cpu0-cpufreq", --=20 2.43.0 From nobody Mon Sep 28 17:48:33 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 A2FE548AE1F for ; Wed, 19 Aug 2026 16:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158582; cv=none; b=bgFF+UD6fBwLo+V7WOrvkbjgLMQnZ0Wr0FqUwB6Ll/37XfjA/YoGUpuRLylUw1leURCQPuThiwAU3922IOV0zzBQhNWNFytDhwPTi52QODnFJf2lz2JKt66G8xWBCmsPbZb4Mxyjo75opZbIGjlGxy5dBf76jCpr/34vA6gJOIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787158582; c=relaxed/simple; bh=CY567MCLIdasyZt9otNfmyFtYDpAdo+YL1MezVk7ykE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xy4t5xKQnTtaxg4EFHtKftltNKn5DbH8eu1zARp0HX35Xej6p5dDRW28SdOiwEt18SG8hmUdIFX7KjzCleeGZhblGDR494cIH5T9paOnffizkR1B3jjLc3L5XLWI5cqBhrqh37MYmNAVr2LMI/xhAOA3KIYEG8feO+cMzstiX1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Z2Roh0xe; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aYoncfpC; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Z2Roh0xe"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aYoncfpC" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67JEbXKw566984 for ; Wed, 19 Aug 2026 16:56:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=v7zL2wJAHhF GLcCrZcZjlmgVvoWga7A2Naov48OSiWI=; b=Z2Roh0xelbvUw122QTFIXsBPSLE xpPmNs5BM+R20RP+24mKHEYqTfYL2j9HSbDwtVJouwVgsk3sPbzNdBGyTsxOKxK4 4idcXzOs1EoF1FU06mp/IkKbMSb8z7pOuScwRPcWlM67ks4XKT8Pn5kz/gSogzun S+BofAWpT9em/AhetfuD5PEcfOdMCplXHMszH/RGcnZjAfCwqZK8wH49uCrhfzq5 UYP30arvb4vRjbUjld2QfPaMvmk1zqbpXzbCSRapEdLsf5wAXpx2RsYMucM5FOg9 C+OMibQ3UY+Zwjx1JofOzB/vVTmNpWqIRxYlLduu+Q8OAU0LoOYIEfc7xSA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5daa13mv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 19 Aug 2026 16:56:19 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92e82060977so10213385a.1 for ; Wed, 19 Aug 2026 09:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787158578; x=1787763378; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=v7zL2wJAHhFGLcCrZcZjlmgVvoWga7A2Naov48OSiWI=; b=aYoncfpCP0lVHFSLltsAtghtpPkl4/qO8BIVPUb77hu46vPJwJX173tvSJan7CFZAJ R7vU8h9mheQ+HORq/zsOfZhkRfmr9HhaJ+DjuBzMPHZnrYADADRXe0ESAaq8M4IPSA2F uN3vlR1b0084iLkyaiZr0SZ/BrWnoEq6DUnak+O0sSiLI7T7oXRzWj3vHkI1eFRI/yj1 pSPz3kdyt1rFwWqMy956g6H97mTHCOd9BZrqC/KhrTeQu4mipxESpuIUO/ctHpT2g9kb X/BmBe/T4aCq3DeX1mu6fAwYkHWr+VKEZD2fOsDpM1SONNXGy+4SjnLJK7PUhjqCr0aD dwcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787158578; x=1787763378; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=v7zL2wJAHhFGLcCrZcZjlmgVvoWga7A2Naov48OSiWI=; b=nU61x0kmhu5Tzzz3c4yqVP1BYQxLWARDLuy/o1OWoFN7Elg/JTNCoBgJuktMliI9+R +XtYynxkzXRRvNHeSoswEQGf+SBS86bW8z03kxHf/V7xgjxImoKYTARh3J06QV7x/Acx 1UhQ6iDUn2Al/BdxZBYaUTVW0Vk1z2a4mcUi3T5gK97haxnBfPWqliI8+TFUM91eeMhl 9UGYBQJm8TLn3wljGLh6yGU54y1mNHxfaSQCx0GuOsBkGEqrATbVxDgpQpucb45LOW2l Y8+7XkmZn2NrbRyF+dsMjRuKHocKROpztnIbDxwqO90F3ee3IYdUxvqzHbOFelVLv7xt KYdw== X-Gm-Message-State: AOJu0YxaxH3c27CmCgCY03dvfTF0RBEzAVeWHvYkvAzqxTCFmNavpEX4 /PORdhAulJ/z7L6kKP5H9zhJ/oeyh7Rr/E0YbMe5h+tslpC+1eIF9nkOdGK1PSpnYHUrO8i+tii QGTV2d4tqPRNrlJitkcScEZdzJVrN4uz2YLYNcE67y3pIN1vekq5f0J7a1ZSH7EUCJ9A= X-Gm-Gg: AR+sD11h2NDItDDOyyCNPDrO9bFW1KDMYSjR3iINuQZh/9NpfuVUu58NYjui+b5q3+8 2pqjYIWD8OBReo+ZSZDyuVSyaq3XUA1OFLt5QhRScVlvTJWTESv+wpMRzpFnMQob7iTC01301e3 Fqg5ysArz2a42SSLSvRLjH/AphPJFrT868yd5dUS551rOFc5rJw0+bGGpZa4R8J1/T5orr+8g5h YqtwbVuSgSPzeD00YCJJgG97MO5DT4rimnNoiqxzwXsikDakhx2joHUwCOobXJstiFCjkWcFvY/ Sq72QpXOEa2sXY6GCZjBMeG+xCi+4scFUmcm1JZOh/ggF06oe3RHVJtrRsxrGENpz/Ngs7kRQs7 E+2YOwHl011PIPSLdaJHG1v+VeKVQ X-Received: by 2002:a05:620a:1a29:b0:915:29cd:306c with SMTP id af79cd13be357-9372840cf5fmr48968785a.9.1787158578305; Wed, 19 Aug 2026 09:56:18 -0700 (PDT) X-Received: by 2002:a05:620a:1a29:b0:915:29cd:306c with SMTP id af79cd13be357-9372840cf5fmr48964885a.9.1787158577810; Wed, 19 Aug 2026 09:56:17 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2e33:a343:bae0:905b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1441c78sm6952317f8f.2.2026.08.19.09.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 09:56:17 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@oss.qualcomm.com, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 4/4] powercap: dtpm: Add RK3588 hierarchy Date: Wed, 19 Aug 2026 18:56:05 +0200 Message-ID: <20260819165605.1398880-5-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> References: <20260819165605.1398880-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=fv3sol4f c=1 sm=1 tr=0 ts=6a85e033 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=8Fys3Dm6xgAeGQ2jRPYA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: ZV1nToTayUqsf7jKHtA6wDPfVmsprQg2 X-Proofpoint-ORIG-GUID: ZV1nToTayUqsf7jKHtA6wDPfVmsprQg2 X-Proofpoint-Spam-Info: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX4nXHNHU25UjC ueXyB7lmnfEcV4q1DquMJvtiNFb69CtTHrE8OUf0/dUvw/IMVA+5nBLpVDHW5EgOZuaUjE0pElk 1kY9MctaGUZlzVuFkO+q6csqQo7263g= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE5MDEzMSBTYWx0ZWRfX54sFoM5rQhLL 3xozosXRIA6os2hRAPVFh9LjS8DHv6/fKBiyjxWpGD0v7SbZsHzzct4i6PLSXO5YY+MuLfDZnS5 9uL1B2lmvRCZ6jpFzHDNv2da2V6cL36dCQrINY2LWqef+EUDMZm83DLakw0XSrE0Z55E2ptwOXv fgO1KSKmtnueCGYtQGANMteP/4vaDovGVfjJdq+cb1705ym7b/cBBPvZC3AV+3IXRjUKYR/x/QR SH2QLvpF9isHcLa03OAUzvO/UF8H8cldOv8izi1fBR2RhyZycRvbWZM3KH+08TCZDsaMGAjsfkk uV+a2xTtTUYCAz3OhnOH3eu1ivNPl/e56nsm0wlj/4fdODsMoOAFV3Cg86HgP/WP9Zg1CR/UEiv 1i5YAAOjlQJpNn5ThIcwBtKF5JW7Vxn0U2bE+la5qznBnvhdo19YjL4XN0Fs3+IEyuL1B58sbvU BadYb8hzy5bogmdHpFA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_04,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608190131 Content-Type: text/plain; charset="utf-8" The RK3588 has three CPU frequency domains, with CPUs grouped into three cpufreq policies. Add a DTPM hierarchy for the RK3588 with one CPU node per cpufreq policy, represented by cpu@0, cpu@400 and cpu@600. Group the three CPU domains under a virtual package node attached to the RK3588 root node. Add the RK3588 compatible to the Rockchip DTPM match table to select the new hierarchy. Signed-off-by: Daniel Lezcano --- drivers/soc/rockchip/dtpm.c | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/drivers/soc/rockchip/dtpm.c b/drivers/soc/rockchip/dtpm.c index 5f7f238a15fe..3d9367d05803 100644 --- a/drivers/soc/rockchip/dtpm.c +++ b/drivers/soc/rockchip/dtpm.c @@ -62,8 +62,56 @@ static struct powercap_hierarchy __initdata rk3399_hiera= rchy =3D { .nr_nodes =3D ARRAY_SIZE(rk3399_nodes), }; =20 +static struct dtpm_node rk3588_cpu0 =3D { + .type =3D DTPM_NODE_DT, + .path =3D "/cpus/cpu@0", +}; + +static struct dtpm_node rk3588_cpu4 =3D { + .type =3D DTPM_NODE_DT, + .path =3D "/cpus/cpu@400", +}; + +static struct dtpm_node rk3588_cpu6 =3D { + .type =3D DTPM_NODE_DT, + .path =3D "/cpus/cpu@600", +}; + +static struct powercap_node __initdata rk3588_nodes[] =3D { + [0] =3D { + .name =3D "rk3588", + .data =3D &rockchip_virtual, + }, + [1] =3D { + .name =3D "package", + .parent =3D &rk3588_nodes[0], + .data =3D &rockchip_virtual, + }, + [2] =3D { + .name =3D "cpu0-cpufreq", + .parent =3D &rk3588_nodes[1], + .data =3D &rk3588_cpu0, + }, + [3] =3D { + .name =3D "cpu4-cpufreq", + .parent =3D &rk3588_nodes[1], + .data =3D &rk3588_cpu4, + }, + [4] =3D { + .name =3D "cpu6-cpufreq", + .parent =3D &rk3588_nodes[1], + .data =3D &rk3588_cpu6, + }, +}; + +static struct powercap_hierarchy __initdata rk3588_hierarchy =3D { + .nodes =3D rk3588_nodes, + .nr_nodes =3D ARRAY_SIZE(rk3588_nodes), +}; + static struct of_device_id __initdata rockchip_dtpm_match_table[] =3D { { .compatible =3D "rockchip,rk3399", .data =3D &rk3399_hierarchy }, + { .compatible =3D "rockchip,rk3588", .data =3D &rk3588_hierarchy }, {}, }; =20 --=20 2.43.0