From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB1B8C04FDF for ; Mon, 31 Jul 2023 10:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231897AbjGaKyU (ORCPT ); Mon, 31 Jul 2023 06:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbjGaKxY (ORCPT ); Mon, 31 Jul 2023 06:53:24 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A3398 for ; Mon, 31 Jul 2023 03:52:31 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f954d7309fso5397445e87.1 for ; Mon, 31 Jul 2023 03:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800749; x=1691405549; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=l9Bhu6RTLTlOkPYdGmzCZK+SJ0ApPA44TktqVizGV/E=; b=FSUpixS0hEpsX4k5+RZtCv+grVSWkMzhl7ckPmhqiFjgWNm/8sETE9LA1ApZFoeJN3 rcvrR/g3U8znOLvXWkky24LyjibQu3Xol3qJzV5F3s+Eo5T9LatyLBlJRmxhAWUxEzTx SZj2plIjO7jeutg2P7mHeuOLrBK+ERJRNETHug7BDtap98h6zTlPv44vaGdCSzUgQ1k2 hwTzfmyX7ouEusn3YKHv7gQtJ7ciiw75J0afTK/KUw+CGVHrrU1hMKHpxIM3iEDFQjVw n7fojc3hpq7bYZ9pDxrlFQXrGI77JMIU9gW8Ee4EqaVgo636qMzZE7nzmA9dzqCSuP1H /zwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800749; x=1691405549; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l9Bhu6RTLTlOkPYdGmzCZK+SJ0ApPA44TktqVizGV/E=; b=kvfreyWKYy1bzG9wkZXO+T2bDxBTIAFfSE6HIPbgabDuSANtmfeLxsosQS6gOFL7i1 dCcLxdwD8LcYOgqWcwkRPSSi9aEuZfl34liihsWxmwL+7Fi4P8DrRF2kyJDhF0VLCyEg 8xW8dodku4IGlM5c7NZIe5OOnMQs+EP0SxHE7U/2RU+C7RbFmlORQRXzsxmJR24Qvt4z X1SVEK2V0LDDH1supPEefMG1kJnRyKZmNkHhuq52y2pFI2/7nZAceZlV0yw/qTuqmTgT 2p+G007gzujrfor985geQbhqk5foYnxZiTEk5P2PC7SRBB4H8V+aiKWDnZBq2FSrxN02 Ew3A== X-Gm-Message-State: ABy/qLbC8yir9v82DOsRTC5Ze5Z/8mXB95noVL1sZYX0LgLM8rI6QqnO FTiJkEDYo5KsDbXF5kaluv1LZA== X-Google-Smtp-Source: APBJJlFTyKs/df9RaZ1Xt9snM4RevMAXejq8I6kL+/M1oHFu77O7JE7Zs3duk9rY6ps0sdDTiynjZQ== X-Received: by 2002:a05:6512:3d03:b0:4fe:d15:e1d2 with SMTP id d3-20020a0565123d0300b004fe0d15e1d2mr4513778lfv.12.1690800749652; Mon, 31 Jul 2023 03:52:29 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:29 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:17 +0200 Subject: [PATCH v2 01/10] interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-1-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=3264; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=lpOHcFckHwWSXO0TNoVaSaP1oz53efg+tMkW6PdBjnc=; b=xSKtpZGlZ8hRkYD/YnLis4ISWkfIYAvXQnkKNd55WCVskwpczntaGE8fD2lwyIScAHZSOkPFg QJQpn+OY9NkAZ+oESsOmV2i6bTyGzdHwHqZK9mZ2ryD3k2vnb7HZQX6 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Presumably due to the hardware being so complex, some nodes (or busses) have different (usually higher) requirements for bandwidth than what the usual calculations would suggest. Looking at the available downstream files, it seems like AB values are adjusted per-bus and IB values are adjusted per-node. With that in mind, introduce percentage-based coefficient struct members and use them in the calculations. One thing to note is that the IB coefficient is inverse (100/ib_percent) which feels a bit backwards, but it's necessary for precision.. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 14 +++++++++++--- drivers/interconnect/qcom/icc-rpm.h | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qco= m/icc-rpm.c index 2c16917ba1fd..a837d20af79e 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -298,7 +298,8 @@ static int qcom_icc_bw_aggregate(struct icc_node *node,= u32 tag, u32 avg_bw, */ static void qcom_icc_bus_aggregate(struct icc_provider *provider, u64 *agg= _clk_rate) { - u64 agg_avg_rate, agg_rate; + struct qcom_icc_provider *qp =3D to_qcom_provider(provider); + u64 agg_avg_rate, agg_peak_rate, agg_rate; struct qcom_icc_node *qn; struct icc_node *node; int i; @@ -315,8 +316,15 @@ static void qcom_icc_bus_aggregate(struct icc_provider= *provider, u64 *agg_clk_r else agg_avg_rate =3D qn->sum_avg[i]; =20 - agg_rate =3D max_t(u64, agg_avg_rate, qn->max_peak[i]); - do_div(agg_rate, qn->buswidth); + if (qp->ab_coeff) + agg_avg_rate =3D mult_frac(qp->ab_coeff, agg_avg_rate, 100); + + if (qp->ib_coeff) + agg_peak_rate =3D mult_frac(100, qn->max_peak[i], qp->ib_coeff); + else + agg_peak_rate =3D qn->max_peak[i]; + + agg_rate =3D max_t(u64, agg_avg_rate, agg_peak_rate); =20 agg_clk_rate[i] =3D max_t(u64, agg_clk_rate[i], agg_rate); } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qco= m/icc-rpm.h index eed3451af3e6..5e7d6a4fd2f3 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -44,6 +44,8 @@ struct rpm_clk_resource { * @type: the ICC provider type * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers + * @ab_coeff: a percentage-based coefficient for compensating the AB calcu= lations + * @ib_coeff: an inverse-percentage-based coefficient for compensating the= IB calculations * @bus_clk_rate: bus clock rate in Hz * @bus_clk_desc: a pointer to a rpm_clk_resource description of bus clocks * @bus_clk: a pointer to a HLOS-owned bus clock @@ -57,6 +59,8 @@ struct qcom_icc_provider { enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; + u16 ab_coeff; + u16 ib_coeff; u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM]; const struct rpm_clk_resource *bus_clk_desc; struct clk *bus_clk; @@ -123,6 +127,8 @@ struct qcom_icc_desc { enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; + u16 ab_coeff; + u16 ib_coeff; }; =20 /* Valid for all bus types */ --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 793DDC001DE for ; Mon, 31 Jul 2023 10:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232055AbjGaKyW (ORCPT ); Mon, 31 Jul 2023 06:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbjGaKxZ (ORCPT ); Mon, 31 Jul 2023 06:53:25 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 569791BCC for ; Mon, 31 Jul 2023 03:52:33 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fe07f0636bso6976282e87.1 for ; Mon, 31 Jul 2023 03:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800751; x=1691405551; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xVvWZuZykGB5bMQAupOuWvDvdMeiJLjxPsV4TGGQesg=; b=eDvFqWCzdd6OlEph6PTSxP7744I61Ot/s84FP2ZORdSHbReEGTypSqX+LEX5+Lo/wH 2w385t/63vUv4SIIY+mmfSY6ZStvpnGiC7WAZ0hSv4C5CdcJHaVQPa704dehHQtqwVav rL5pgl+ZC3/yD5I1CWDW9BsYOk+g+otnOE6lvsgbuNRD+nTydjTQVOtg3aP5G2b6hKa4 VqXy78xyWoajws1v6jl8Xkdw+NDSbgVvIopD47OGdv0akiGZU5vCy85MXVzc64T47aYe mdGNkJBEbBvBr2da3BrFU/isnNjTDr9p4pJ1DxmYyK9/YERsldWCoT3Y9CdZWILtCIA1 S7zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800751; x=1691405551; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xVvWZuZykGB5bMQAupOuWvDvdMeiJLjxPsV4TGGQesg=; b=Z6S17Dm6FDFHBn4nwUICJlqs0eTJXPTrwd5xaLxfOTMOGOo2hW5WTOh4epu9DmVBZz qM5A9ZcHHdNCYkyUvUIaL4PSrYiT3VmEfRkK7K3iMZdk5rrxUkgWUDAt3OXOXo0cFi9i +9dzlr8s6vpBzVvDHYxdZs/n+Uz+6rlEg5EgZqbt+Fby8cnAFV8rO1hTLZWHCGpVsEAy 5q5VgDEjmO1ZcX8rcu9n/+WCP/W+nOiy4/ENcvc7IeYz1QWIDTFD2BP507oGeAA99cxa fdnjWv3LKe+8FA5slBNEBJCcaqCSDb8u6KyNO9C1tNtHoCafysNR3H47D4OeYexzcGSo EorA== X-Gm-Message-State: ABy/qLYUtH7LEbQ3D/nQhpFGfRO1iEyCU/NrdFq67wQ+c0IOqiua44Tr +03ByGVQO8zSTZgXy5CR9rsItg== X-Google-Smtp-Source: APBJJlFV7t4btE6CmOURCabRnHjP9HKiAcSfqFMdiFhrlKwJxpFX/ROUqVWivY2kbmwauP606A0EHg== X-Received: by 2002:a19:6917:0:b0:4f8:4216:e91f with SMTP id e23-20020a196917000000b004f84216e91fmr4229253lfc.63.1690800751450; Mon, 31 Jul 2023 03:52:31 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:31 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:18 +0200 Subject: [PATCH v2 02/10] interconnect: qcom: icc-rpm: Separate out clock rate calulcations MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-2-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=2807; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=l2ys7kUG65Xi3tEUxGk88Ev+nzyHo4Dj5sUaoIzZZZA=; b=VqPlFtmOHF3NLS2AmYOlrACcxBUYD72n5jfWXxo+SYpGi/YBmMubNIOA+JpVGSZtQvxS/Q7+S pWrJZbnz3vbAG2KkwA8NNsoFPd87W/fjKrbDx9lfaXyzYAYtFYzvwCL X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for also setting per-node clock rates, separate out the logic that computes it. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 46 ++++++++++++++++++++++-----------= ---- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qco= m/icc-rpm.c index a837d20af79e..f1d8ed354718 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -291,6 +291,29 @@ static int qcom_icc_bw_aggregate(struct icc_node *node= , u32 tag, u32 avg_bw, return 0; } =20 +static u64 qcom_icc_calc_rate(struct qcom_icc_provider *qp, struct qcom_ic= c_node *qn, int ctx) +{ + u64 agg_avg_rate, agg_peak_rate, agg_rate; + + if (qn->channels) + agg_avg_rate =3D div_u64(qn->sum_avg[ctx], qn->channels); + else + agg_avg_rate =3D qn->sum_avg[ctx]; + + /* Check if the node has a specific coefficient first*/ + if (qp->ab_coeff) + agg_avg_rate =3D mult_frac(qp->ab_coeff, agg_avg_rate, 100); + + if (qp->ib_coeff) + agg_peak_rate =3D mult_frac(100, qn->max_peak[ctx], qp->ib_coeff); + else + agg_peak_rate =3D qn->max_peak[ctx]; + + agg_rate =3D max_t(u64, agg_avg_rate, agg_peak_rate); + + return div_u64(agg_rate, qn->buswidth); +} + /** * qcom_icc_bus_aggregate - calculate bus clock rates by traversing all no= des * @provider: generic interconnect provider @@ -299,10 +322,9 @@ static int qcom_icc_bw_aggregate(struct icc_node *node= , u32 tag, u32 avg_bw, static void qcom_icc_bus_aggregate(struct icc_provider *provider, u64 *agg= _clk_rate) { struct qcom_icc_provider *qp =3D to_qcom_provider(provider); - u64 agg_avg_rate, agg_peak_rate, agg_rate; struct qcom_icc_node *qn; struct icc_node *node; - int i; + int ctx; =20 /* * Iterate nodes on the provider, aggregate bandwidth requests for @@ -310,23 +332,9 @@ static void qcom_icc_bus_aggregate(struct icc_provider= *provider, u64 *agg_clk_r */ list_for_each_entry(node, &provider->nodes, node_list) { qn =3D node->data; - for (i =3D 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { - if (qn->channels) - agg_avg_rate =3D div_u64(qn->sum_avg[i], qn->channels); - else - agg_avg_rate =3D qn->sum_avg[i]; - - if (qp->ab_coeff) - agg_avg_rate =3D mult_frac(qp->ab_coeff, agg_avg_rate, 100); - - if (qp->ib_coeff) - agg_peak_rate =3D mult_frac(100, qn->max_peak[i], qp->ib_coeff); - else - agg_peak_rate =3D qn->max_peak[i]; - - agg_rate =3D max_t(u64, agg_avg_rate, agg_peak_rate); - - agg_clk_rate[i] =3D max_t(u64, agg_clk_rate[i], agg_rate); + for (ctx =3D 0; ctx < QCOM_SMD_RPM_STATE_NUM; ctx++) { + agg_clk_rate[ctx] =3D max_t(u64, agg_clk_rate[ctx], + qcom_icc_calc_rate(qp, qn, ctx)); } } } --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CDF9C001DE for ; Mon, 31 Jul 2023 10:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232102AbjGaKyZ (ORCPT ); Mon, 31 Jul 2023 06:54:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232053AbjGaKxh (ORCPT ); Mon, 31 Jul 2023 06:53:37 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA751BDB for ; Mon, 31 Jul 2023 03:52:35 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fb960b7c9dso6932935e87.0 for ; Mon, 31 Jul 2023 03:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800753; x=1691405553; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SyCiXkI6QRxT+Oa2T9MJLKBFuocjUwBVkwW1HGRN0Ho=; b=oTuXgKxcrjmDmz/vd223QsDybin2mMNw85Qpe/BHUdzP3EJIOONTA3KDbmuqr6UvOs K3hkBZxZvH+CrWqW6xdM75qca26NAIcRsyhdi8CwjDo+k79+asbgBKqFfcoOZCBWpObp 9KzqSxaGfZLeq6PWQnyZNH0+QW8zjTYWCzCwp+ysilSJl6vQHCzJCrHnZjwD66eB+zAc yS0KiMU7rfvCUu7ATFmmk9/Kzx7sl8mL19IDfy+VM0Z874GkT/IuSIakzpFrWvJf3ADF tZ1yZXruy7OHNTxtEAvnPXHFuRjAgcSOmfaWUl7A3lWgVjcIla4F1UkQEHZymhlqo+IL xhOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800753; x=1691405553; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SyCiXkI6QRxT+Oa2T9MJLKBFuocjUwBVkwW1HGRN0Ho=; b=OmdFI1J6lGjfW7UjAGcj1hEcn4qKk+gFD1tKXyN04c6C801SZClCPuLKoFO+jAhf9W 3G/3wUE+DzCY5gYlWn/jqWbqtGpleaWQ+Crq/ZmJV3bqmaSFIGxybf6bJQ+RKbDOTR35 0fa+4XvveFK9tT3ZR2Wb1GpVe3GTjkq5u+ssIybXHhhJsE7uJlUw8/L89WhNH0LkWrIg DpJuoRIGGt9bySNqyBXuWjspd8bsaTEnNYnfiF0EC8s3EYBiXPJ70vc90YW4j5cTjL6h qp+tk6aDzyAYScIsxOAGcVdftSKUaEYH6ir2RbAZH7z5m8mOKbzcojPHEf5k6D4ok5kP Tt6A== X-Gm-Message-State: ABy/qLboncufZPrxFtkuwJelFjp/ml+wVdQlefXeaCJtUHnpT+Q36MSm TnYcVnbeoU4P/dwRMcH4eA2o94AWI4YaWBqguGsWIg== X-Google-Smtp-Source: APBJJlEkWx1UspnMOC4K6OlN6pUWWcihfTOd+aLAalf5gRPomz0lkaLo1QYzVqiO0ebewCDQ124Buw== X-Received: by 2002:a05:6512:70c:b0:4fb:7675:1ff9 with SMTP id b12-20020a056512070c00b004fb76751ff9mr4987276lfs.9.1690800753268; Mon, 31 Jul 2023 03:52:33 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:32 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:19 +0200 Subject: [PATCH v2 03/10] interconnect: qcom: icc-rpm: Let nodes drive their own bus clock MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-3-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=4308; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nSSCPCfi3ZZHojNecOL8pN1yRNY2ZL7Z9o4VoBkikQE=; b=iJSMtQp2Z2z2ss433XEhkkMGwAkdLDrkvHQX6vhXeClylbRp70A9lJV66giz8PV1T32pRph+F O+PVjr2sNN5AWsUf2c68aHFiOH/8NcW5POz+TNiBPWoe/J5CbUZL32C X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If this hardware couldn't get messier, some nodes are supposed to drive their own bus clock.. Presumably to connect to some intermediate interface between the node itself and the bus it's (supposed to be) connected to. Expand the node struct with the necessary data and hook up the allocations & calculations. To save on memory (not very many nodes have their own clocks), allocate a pointer to an array instead of allocating an array within qcom_icc_node. Note that the node-specific AB/IB coefficients contribute (by design) to both the node-level and the bus-level aggregation. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 48 +++++++++++++++++++++++++++++++--= ---- drivers/interconnect/qcom/icc-rpm.h | 2 ++ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qco= m/icc-rpm.c index f1d8ed354718..f0e575c95b49 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -411,6 +411,33 @@ static int qcom_icc_set(struct icc_node *src, struct i= cc_node *dst) qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE] =3D sleep_rate; } =20 + /* Handle the node-specific clock */ + if (!src_qn->bus_clk_desc) + return 0; + + active_rate =3D qcom_icc_calc_rate(qp, src_qn, QCOM_SMD_RPM_ACTIVE_STATE); + sleep_rate =3D qcom_icc_calc_rate(qp, src_qn, QCOM_SMD_RPM_SLEEP_STATE); + + if (active_rate !=3D src_qn->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]) { + ret =3D qcom_icc_rpm_set_bus_rate(src_qn->bus_clk_desc, QCOM_SMD_RPM_ACT= IVE_STATE, + active_rate); + if (ret) + return ret; + + /* Cache the rate after we've successfully committed it to RPM */ + src_qn->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE] =3D active_rate; + } + + if (sleep_rate !=3D src_qn->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]) { + ret =3D qcom_icc_rpm_set_bus_rate(src_qn->bus_clk_desc, QCOM_SMD_RPM_SLE= EP_STATE, + sleep_rate); + if (ret) + return ret; + + /* Cache the rate after we've successfully committed it to RPM */ + src_qn->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE] =3D sleep_rate; + } + return 0; } =20 @@ -531,24 +558,31 @@ int qnoc_probe(struct platform_device *pdev) return ret; =20 for (i =3D 0; i < num_nodes; i++) { + struct qcom_icc_node *qn =3D qnodes[i]; size_t j; =20 - node =3D icc_node_create(qnodes[i]->id); + if (qn->bus_clk_desc) { + qn->bus_clk_rate =3D devm_kcalloc(dev, QCOM_SMD_RPM_STATE_NUM, + sizeof(*qn->bus_clk_rate), + GFP_KERNEL); + } + + node =3D icc_node_create(qn->id); if (IS_ERR(node)) { ret =3D PTR_ERR(node); goto err_remove_nodes; } =20 - node->name =3D qnodes[i]->name; - node->data =3D qnodes[i]; + node->name =3D qn->name; + node->data =3D qn; icc_node_add(node, provider); =20 - for (j =3D 0; j < qnodes[i]->num_links; j++) - icc_link_create(node, qnodes[i]->links[j]); + for (j =3D 0; j < qn->num_links; j++) + icc_link_create(node, qn->links[j]); =20 /* Set QoS registers (we only need to do it once, generally) */ - if (qnodes[i]->qos.ap_owned && - qnodes[i]->qos.qos_mode !=3D NOC_QOS_MODE_INVALID) { + if (qn->qos.ap_owned && + qn->qos.qos_mode !=3D NOC_QOS_MODE_INVALID) { ret =3D qcom_icc_qos_set(node); if (ret) return ret; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qco= m/icc-rpm.h index 5e7d6a4fd2f3..835b83cfb548 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -97,6 +97,7 @@ struct qcom_icc_qos { * @num_links: the total number of @links * @channels: number of channels at this node (e.g. DDR channels) * @buswidth: width of the interconnect between a node and the bus (bytes) + * @bus_clk_desc: a pointer to a rpm_clk_resource description of bus clocks * @sum_avg: current sum aggregate value of all avg bw requests * @max_peak: current max aggregate value of all peak bw requests * @mas_rpm_id: RPM id for devices that are bus masters @@ -110,6 +111,7 @@ struct qcom_icc_node { u16 num_links; u16 channels; u16 buswidth; + const struct rpm_clk_resource *bus_clk_desc; u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; u64 max_peak[QCOM_SMD_RPM_STATE_NUM]; int mas_rpm_id; --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87181C001DE for ; Mon, 31 Jul 2023 10:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230042AbjGaKyj (ORCPT ); Mon, 31 Jul 2023 06:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjGaKyF (ORCPT ); Mon, 31 Jul 2023 06:54:05 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41DB21FC6 for ; Mon, 31 Jul 2023 03:52:37 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fb960b7c9dso6932971e87.0 for ; Mon, 31 Jul 2023 03:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800755; x=1691405555; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CvcdgSAVOaO6olnZ2J7zbPhjDUv8IMKoyG5dIGy7pps=; b=GvfLD9e6+fc2ShIbqGqZQ42tgyVrv/DAKmNMAbQfyPTnm7CaJCrR6tWPhZ7lJwJy4u GOQVGD9dt+nbRZhMmFrgmbp6JSpIrXzhWiT1XbVGlhqK8V3SmiL2w3BKZzFCCxJiMTIO srIXvs94lea6zukhWr4NV3q8gU93imlJ6eIafuZUO3Pkwwgsxqzq9Tu7zuhzIOkreRUy PSj3/cRkluM73TQ9h9sMn2ygSaXwYAcyUOlKnWWKomn6mpQaaT4/i1F1CwQXUtrbYu2L g9H+LtooiMJWJr4xtJ/WdEe1dMt8nfEJSYavYs5il7aC6U6IkpsQFaUJvdk5n76RqKoz e9iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800755; x=1691405555; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CvcdgSAVOaO6olnZ2J7zbPhjDUv8IMKoyG5dIGy7pps=; b=OxkfOiZ3sYESbCUG/jcS32hYK0Iw1H3zoNdTDcJoOpQIS1fnbBi90DbBtfcwffBSzo PLpM+4MOe95Nr//OLiqXPQoMylm7N5cN+LdSyD7gCXkHQiS1O+FpGBLg6umsUSRIk6XT 7obrmcXcveSPw5SGpc7foAcvhiOS9XcRqCEN/JAwdjG5dz0pKcDY1dWJl2BsNbnx4+cV LUUcElpsaWTWeljwj3oi/YCrb9chlYweXzLxsPYCY2FZrY+gMoUsoICOv/C7x+Vcu2HY rtRD+DShvqNZnDTGKQj1hwINnWohk0S39EmjigiWYDSXcfEaXaZiaO17LIvDFxulJezq CT2g== X-Gm-Message-State: ABy/qLZx+k+Tni70z4RpbvvBoDP9Zul0itiMamCLW6V/mJ40H7y27b+t l2DESqgRJOhbt/b8SZXEEbZhDQ== X-Google-Smtp-Source: APBJJlE7A/+g6cMD48kIZh3qptol9zZSpFMAkpJROi49Ka6Mw2U6bHRKuqRIIc2dTxZNBbj6gCmnKA== X-Received: by 2002:a05:6512:3b87:b0:4fd:c84f:30d4 with SMTP id g7-20020a0565123b8700b004fdc84f30d4mr6894360lfv.36.1690800755127; Mon, 31 Jul 2023 03:52:35 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:34 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:20 +0200 Subject: [PATCH v2 04/10] interconnect: qcom: icc-rpm: Check for node-specific rate coefficients MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-4-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=2228; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=S37fCoemtVls+bqCyB1WrEUAA8XbCS2lHy+GvBs398k=; b=0pE89gmxzA/dtumdl6wHpZPUVAjNHE5L/6tePRYe4ztfP5d7jhE8RxiAbTU+d2b3211sukzD1 8L0VhxQg2qWAXJ83p/xZ+l9R1QMXH5bRg/GpXXF3wJQ04PEU2VqCQfs X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some nodes may have different coefficients than the general values for bus they're attached to. Check for that and use them if present. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 10 +++++++--- drivers/interconnect/qcom/icc-rpm.h | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qco= m/icc-rpm.c index f0e575c95b49..91eb428385f6 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -300,11 +300,15 @@ static u64 qcom_icc_calc_rate(struct qcom_icc_provide= r *qp, struct qcom_icc_node else agg_avg_rate =3D qn->sum_avg[ctx]; =20 - /* Check if the node has a specific coefficient first*/ - if (qp->ab_coeff) + /* Check if the node has a specific coefficient first */ + if (qn->ab_coeff) + agg_avg_rate =3D mult_frac(qn->ab_coeff, agg_avg_rate, 100); + else if (qp->ab_coeff) agg_avg_rate =3D mult_frac(qp->ab_coeff, agg_avg_rate, 100); =20 - if (qp->ib_coeff) + if (qn->ab_coeff) + agg_peak_rate =3D mult_frac(100, qn->max_peak[ctx], qn->ib_coeff); + else if (qp->ib_coeff) agg_peak_rate =3D mult_frac(100, qn->max_peak[ctx], qp->ib_coeff); else agg_peak_rate =3D qn->max_peak[ctx]; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qco= m/icc-rpm.h index 835b83cfb548..1a26a7b82166 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -103,6 +103,9 @@ struct qcom_icc_qos { * @mas_rpm_id: RPM id for devices that are bus masters * @slv_rpm_id: RPM id for devices that are bus slaves * @qos: NoC QoS setting parameters + * @ab_coeff: a percentage-based coefficient for compensating the AB calcu= lations + * @ib_coeff: an inverse-percentage-based coefficient for compensating the= IB calculations + * @bus_clk_rate: a pointer to an array containing bus clock rates in Hz */ struct qcom_icc_node { unsigned char *name; @@ -117,6 +120,9 @@ struct qcom_icc_node { int mas_rpm_id; int slv_rpm_id; struct qcom_icc_qos qos; + u16 ab_coeff; + u16 ib_coeff; + u32 *bus_clk_rate; }; =20 struct qcom_icc_desc { --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AF48C001DE for ; Mon, 31 Jul 2023 10:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjGaKyo (ORCPT ); Mon, 31 Jul 2023 06:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230274AbjGaKyK (ORCPT ); Mon, 31 Jul 2023 06:54:10 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 829D52694 for ; Mon, 31 Jul 2023 03:52:39 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fe0e23a4b1so6786683e87.3 for ; Mon, 31 Jul 2023 03:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800757; x=1691405557; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fB3U8vshaXGTQDVy4zCZyIQDygwXYLYWLuqWZPmvE6A=; b=cawrlLWOIpMlWCMp3hV/w0GWzGyNJ+4BzXfUro5Ga9kDxtYP+q8BsOihYGxVHB49Qa qn18Yz/WhnJVrociJaEtwu2gHq5X63NkPh0LTPaCHumF5AH4JJBWhcawTKCplw7KwtX6 tu2EDePQibknZA5FvV1sShHWA4q3WfgdBI9NifyYV90QqPMBrwajxv3BcJOLWNnfvp5U 5lbjryLA1VufmUer+/1P9eiay6hJp8w4eM01iZ3B2Ajw2d4lEQ8Q0Yo1ZiAE2wQGHqJ2 fkxQ5uoF3q4sEJ/gSU5c+JcePCTC9TlKCGjpbXpqg/Lp9/jU2VnbGpD8RnDJSLPwAgf0 LJNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800757; x=1691405557; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fB3U8vshaXGTQDVy4zCZyIQDygwXYLYWLuqWZPmvE6A=; b=HWkt8qHqfm5LrMskvySPvThY+J6LOngRTVI8kA98eG4LZX5jYhjVEICTDykeUL1UOF yxk+lo6WDCd3XdriAjLhZUCwsLiHsDH9ZEB5hg+hOGN39HA3gURJdm4n3Uv0/zKXuqiA MsGZEW6tIPWYSLZoHjD2E5ST2q6YO/1LMeHkQI9UshjLNrqdDFMeYY/3tsO1VZrK4Fb8 RyF1EmgbT9qSMFaZs2+98WvdUU+FLGPaiRCsxWQAjHGfsgKSWK7wH9rtlPBwGiQYFRyu KJjihN5U0dYKlPhZI8g6XoOpU4DT1kY5C/USxn/Q71lPcagMt2Orq1M/LI17kC0rZL+8 OTKA== X-Gm-Message-State: ABy/qLakl33ubS2+Ft2fRtYUJSE5zCrR6Z5IduK0HGvmDYaObFm8si17 sjDAq9MkQPA/ZNDWwCkwgXnP+pUj6QpyJCAszQaaiw== X-Google-Smtp-Source: APBJJlFqJY03v3hVPBUk7kCLDJ77BOkgCKN94dZ7P3pr7iS0QsyPGAj/AtcK/gqP57ki4etw525tow== X-Received: by 2002:a05:6512:6c4:b0:4fd:c83b:a093 with SMTP id u4-20020a05651206c400b004fdc83ba093mr6483544lff.1.1690800757039; Mon, 31 Jul 2023 03:52:37 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:36 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:21 +0200 Subject: [PATCH v2 05/10] interconnect: qcom: qcm2290: Hook up MAS_APPS_PROC's bus clock MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-5-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=2199; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=wbL0knkbb9r2z/rU8oFtpvr0ZnPgIjvL/nER+Pi+b14=; b=F54RLC1nkOXm1+NJ9KBW35GMKssUAl/upy5JEMNXbvCl5C58zJHTCq9IxqTACqRZbGMShABx8 F9eBe1EmhCyD8mGy/I8USvUDuSNKiMRPlF8oFfpATmduKCPgQXVzbES X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This single node has its own clock which seems to be responsible for transactions between CPUSS (CPU + some stuff) and the GNOC. Define it and hook it up. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm-clocks.c | 6 ++++++ drivers/interconnect/qcom/icc-rpm.h | 1 + drivers/interconnect/qcom/qcm2290.c | 3 +++ 3 files changed, 10 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm-clocks.c b/drivers/interconn= ect/qcom/icc-rpm-clocks.c index 63c82a91bbc7..ac1677de7dfd 100644 --- a/drivers/interconnect/qcom/icc-rpm-clocks.c +++ b/drivers/interconnect/qcom/icc-rpm-clocks.c @@ -25,6 +25,12 @@ const struct rpm_clk_resource bimc_clk =3D { }; EXPORT_SYMBOL_GPL(bimc_clk); =20 +const struct rpm_clk_resource mem_1_clk =3D { + .resource_type =3D QCOM_SMD_RPM_MEM_CLK, + .clock_id =3D 1, +}; +EXPORT_SYMBOL_GPL(mem_1_clk); + const struct rpm_clk_resource bus_0_clk =3D { .resource_type =3D QCOM_SMD_RPM_BUS_CLK, .clock_id =3D 0, diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qco= m/icc-rpm.h index 1a26a7b82166..dc8e37c0a263 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -152,6 +152,7 @@ extern const struct rpm_clk_resource bimc_clk; extern const struct rpm_clk_resource bus_0_clk; extern const struct rpm_clk_resource bus_1_clk; extern const struct rpm_clk_resource bus_2_clk; +extern const struct rpm_clk_resource mem_1_clk; extern const struct rpm_clk_resource mmaxi_0_clk; extern const struct rpm_clk_resource mmaxi_1_clk; extern const struct rpm_clk_resource qup_clk; diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qco= m/qcm2290.c index 3c3b24264a5b..52a6eb32e832 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -112,6 +112,9 @@ static struct qcom_icc_node mas_appss_proc =3D { .qos.qos_mode =3D NOC_QOS_MODE_FIXED, .qos.prio_level =3D 0, .qos.areq_prio =3D 0, + .bus_clk_desc =3D &mem_1_clk, + .ab_coeff =3D 159, + .ib_coeff =3D 96, .mas_rpm_id =3D 0, .slv_rpm_id =3D -1, .num_links =3D ARRAY_SIZE(mas_appss_proc_links), --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00DDEC001DE for ; Mon, 31 Jul 2023 10:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjGaKys (ORCPT ); Mon, 31 Jul 2023 06:54:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbjGaKyL (ORCPT ); Mon, 31 Jul 2023 06:54:11 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A43302D52 for ; Mon, 31 Jul 2023 03:52:41 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4fe10f0f4d1so7141886e87.0 for ; Mon, 31 Jul 2023 03:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800759; x=1691405559; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gc7oZvOcJDkiBa4MtO2BaU3uRCE2+ug+vLU72IFcWhs=; b=bIqvKa9J4ZM/+I3R6xWgQFrmjvvV+uJ/u1tgBCxtFS8pVMHw/b07zhzK8/IOhrWmIQ E4mI+yqQcbuETW08+GWh23k0i/rE2qiI62L+oOArgtC9p1Mcx28teRe2DKXTACqfbDD9 /P5gY7nuGr3e4Xz2BQcpy4b3tnDoOsf5Vs6GxBJ3oDJJRDga3wpiR5lGqxLrtTnoPe6W jI6YXQVQqnAnGKU/xISR1UWhl5hjbnfNi1oUI/G5CfMxGCmpi3bnIpIvsCgCoTvgTRHK yMuANpwWKmsAVPUwmgG8Z8U5Ey9LTj68G/M5CZX4c75cWnFVvLD+Y1teSdlGQ+eDTmbK hXWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800759; x=1691405559; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gc7oZvOcJDkiBa4MtO2BaU3uRCE2+ug+vLU72IFcWhs=; b=DQFFgJGxpGB90gy4UJpD1OTUx4cazvl0IUnC5LUJ2Jl4nfZYPkynhi7ZsI1qQ/Rlg7 mBsLW0w3sWuZNijI33pNi+zhaQV8fgbKKtACsJc6pPwbnBnNGA15X0P340OozM6y2fZg xa6F7nr0iOvRNe2DA37rpFOO5hRcOPZM92WIZKeHTssVgolNbV+nlL3fgNdKI+t5A7ur MatitTw1ntHYgJzIBOqHj4+FJ7u+7wHlLdIKHrI8Yp/mWLDjI8Rf5BirQQwNhvuUssa8 U828ww7qQxiFVZY1+LsyGe1xQtSRKezaCKx2BEFDS+Npd3Rar+4pY/uiJA4tW2H5PJW8 cLow== X-Gm-Message-State: ABy/qLbRyhNh8gYFMnJfaWyRoCo/zA5Uo7lHT+FpsKM/eA2LuBO4URlq KJIGv19L77PqCN/n6JilqIn4SA== X-Google-Smtp-Source: APBJJlFtP05xjKYxQtPgx4aQW0AWXPSXMdyogsxALLHLhvmfipAVQ/5mIQQjJl25MsYFyYEzQEbVJg== X-Received: by 2002:ac2:58c9:0:b0:4f8:7513:8cb0 with SMTP id u9-20020ac258c9000000b004f875138cb0mr5392571lfo.2.1690800759450; Mon, 31 Jul 2023 03:52:39 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:38 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:22 +0200 Subject: [PATCH v2 06/10] interconnect: qcom: qcm2290: Set AB coefficients MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-6-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=1336; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=gKAcxl1xTWi9i07xf8cB7oRhF8MPHDTJc+D4hon02Tw=; b=BBXibxbz5bWOvHTUGXbskyvTu2s2coTcN4lWpRlNt+MQgabHigfgQ5abPKfbysUBzTdLIX56m UGV56QaibM1BQepWJ0xXFG5BYjHru3LhVwtGA2ee0Jl3Z+ABcT3AcII X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some buses need additional manual adjustments atop the usual calculations. Fill in the missing coefficients. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/qcm2290.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qco= m/qcm2290.c index 52a6eb32e832..42fa01c66e73 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -1201,6 +1201,7 @@ static const struct qcom_icc_desc qcm2290_bimc =3D { .regmap_cfg =3D &qcm2290_bimc_regmap_config, /* M_REG_BASE() in vendor msm_bus_bimc_adhoc driver */ .qos_offset =3D 0x8000, + .ab_coeff =3D 153, }; =20 static struct qcom_icc_node * const qcm2290_cnoc_nodes[] =3D { @@ -1327,6 +1328,7 @@ static const struct qcom_icc_desc qcm2290_mmnrt_virt = =3D { .bus_clk_desc =3D &mmaxi_0_clk, .regmap_cfg =3D &qcm2290_snoc_regmap_config, .qos_offset =3D 0x15000, + .ab_coeff =3D 142, }; =20 static struct qcom_icc_node * const qcm2290_mmrt_virt_nodes[] =3D { @@ -1342,6 +1344,7 @@ static const struct qcom_icc_desc qcm2290_mmrt_virt = =3D { .bus_clk_desc =3D &mmaxi_1_clk, .regmap_cfg =3D &qcm2290_snoc_regmap_config, .qos_offset =3D 0x15000, + .ab_coeff =3D 139, }; =20 static const struct of_device_id qcm2290_noc_of_match[] =3D { --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C9B4C04FDF for ; Mon, 31 Jul 2023 10:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbjGaKy5 (ORCPT ); Mon, 31 Jul 2023 06:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbjGaKyM (ORCPT ); Mon, 31 Jul 2023 06:54:12 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D72C11B for ; Mon, 31 Jul 2023 03:52:43 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fe28f92d8eso2384571e87.1 for ; Mon, 31 Jul 2023 03:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800761; x=1691405561; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4FqN2Sq9j6IVseScqHZxUGnTrukPTjl33EKA90GBaFU=; b=bIrsaeqmGxlLHJQ0qOj5thnWh7zkl2dgFLCF8lFlwZ34b1X/yhR8D/u9QWyzrb8S3N IOK/gCX0sIaVtyqF+zEd5Nc3SW7JROdzAdJ8hKNTr2Uf2EC1lUNgOkfVa16IyNalNh9F iGJy5kdzbePOlpc5as9fcI+YGhsbZQ1cn7tSpej9zTYMM7fLNoVsPI51st+5RCVBY7NW Mdb0xjCeHsNgvhcoD8uWEwR+/KL45a+Luo5/g2WsSAbEATFPeyQFXofVwXxZwkQEqS9q yiGs/8Qh1u/8czrD3jWU3hdAB+Ad3Q1I3nHYanSivn+nBeOIHaPj0hMNvIc8Qu2J3BQ8 Qj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800761; x=1691405561; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4FqN2Sq9j6IVseScqHZxUGnTrukPTjl33EKA90GBaFU=; b=JBjuE2ElZeZ/JcBb2oV32HubxC8mvM8ZA5nbwYLcPsjcloHw0elVqn0og8nS26SbbE VdU32j4ZNcmTl7XeUp9nrIcRTVgI8iu4y/dwG/GqU13K/kPJFVaUM0awPpWp85ItfRuZ KRkkv+/LqixIrGrfumzla1E6E8BCB0t8kmtSFzsbYscxRWI2j+g2/V5qTFRa92FtQYKG JWDaEbprcikMRCIz0XgQM6CLNSMUzdQ4ICktMVBTYyS9JJiGuHMfu17WP0kNVpUzatrx AbVmCrJPVVCrOu4SA8Pa6KOn0RH5VouWuzPy9pu/7voh3RVPcFR6AfIBiYaV/apmj2Lk CfaQ== X-Gm-Message-State: ABy/qLZfvUhhvUfi+KFJFwdsLaCVXrTixgVMX8Qus5U1K8DDnF+bLWsC i5G3LmmpXIw/QhnBpQVo5qSoiA== X-Google-Smtp-Source: APBJJlGNqAck40ArIkEfVSurVlBTz5pEiR+I3OLQCGw83YhsJ2u0FJ0aLXbUjHuQoEFeA8Gu73OnqA== X-Received: by 2002:ac2:5e71:0:b0:4f9:5196:5ed0 with SMTP id a17-20020ac25e71000000b004f951965ed0mr5305098lfr.7.1690800761484; Mon, 31 Jul 2023 03:52:41 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:41 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:23 +0200 Subject: [PATCH v2 07/10] interconnect: qcom: qcm2290: Update EBI channel configuration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-7-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=1320; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=+JCeGo0Q7sjfDzWjkGg+7ykqgtb42uWuVVMLb5STXRI=; b=FT8g2Z24YTH9ram1lAQ32U39iPRNChujTfSUnblLa4qA+wh81N2TAJaP2r/aWuA9PD/KCdEiJ T8J8APb5P+4Dvy+3uIPMG2KkXDCUOcZ2fveFpGXZFrLl7vhTtADavQd X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QCM2290 can support two memory configurations: single-channel, 32-bit wide LPDDR3 @ up to 933MHz (bus clock) or dual-channel, 16-bit wide LPDDR4X @ up to 1804 MHz. The interconnect driver in its current form seems to gravitate towards the first one, however there are no LPDDR3- equipped boards upstream and we still don't have a great way to discern the DDR generations on the kernel side. To make DDR scaling possible on the only currently-supported 2290 board, stick with the LPDDR4X config by default. The side effect on any potential LPDDR3 board would be that the requested bus clock rate is too high (but still capped to the firmware-configured FMAX). Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/qcm2290.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qco= m/qcm2290.c index 42fa01c66e73..3bd7ad67c569 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -678,7 +678,8 @@ static struct qcom_icc_node mas_gfx3d =3D { static struct qcom_icc_node slv_ebi1 =3D { .name =3D "slv_ebi1", .id =3D QCM2290_SLAVE_EBI1, - .buswidth =3D 8, + .buswidth =3D 4, + .channels =3D 2, .mas_rpm_id =3D -1, .slv_rpm_id =3D 0, }; --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E308C001DE for ; Mon, 31 Jul 2023 10:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjGaKzB (ORCPT ); Mon, 31 Jul 2023 06:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231432AbjGaKyN (ORCPT ); Mon, 31 Jul 2023 06:54:13 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9579A1B1 for ; Mon, 31 Jul 2023 03:52:45 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fba8f2197bso6646572e87.3 for ; Mon, 31 Jul 2023 03:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800764; x=1691405564; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=m5cHR9R1zj6+fWN0kfJbhPUfhYqf7kqDHOcaH9ExP6c=; b=ITduZX8pHxMDTAfEDkZvb/kaPLCDVPp7YfKGtUCrabiH81dy0W9JzDGMhKpW6a4I6N ipFYF73jNr440Kvfmup7caVb/ii95satwZK6P6ktUsOTKsRXdzNiI+la/X8tvUZbJI5i XD7kaNXQNySCE9M4mH/XFO1XijGbpRljakk3N1O0Bm19j5lpuI6c5IxQby//bSuYfiCI HJBp9N4kmvo2QEyNBHsmt9NpojrsUxEqX305bSsEJbBH82q4qtTW9tbE7DArl7hb7t49 aBg0Bj3OWIOtNgs6GDmzVQ29UzBcshZqgY7FIoR0pZTyVMpTTYlmzFyevY7pLFMuubRv UqWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800764; x=1691405564; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m5cHR9R1zj6+fWN0kfJbhPUfhYqf7kqDHOcaH9ExP6c=; b=Ms+mSXCZ4oWeJqKZfJ0e4hegv+fYyLerIiCCbYiXV7tspKLXKE3go2uiVwT8JaPGzV Sek5TEK/9NEWVSrdc0Q1cIHYo1uWAjuqawvirSBv+LzHB8gsbg94fLEXCJY5L+gsQr7h 9RjQf4cZClWUfXJHaTngmf4PExG/v520+syybuA0lfbKCOLMQZegxuir+3jzVIjTPrev R8njK/N+jMNDRSkrKQV/Nl6EyY9xJevDHMT1WqzCsvW0Mr9tQH6Z2UPfPMWHn0QUKDn3 cXKYJ+1HT9xJzpFBd5mwD8WEWpT3mkuNeYT7BTQ5zbuBSwCMZyCglIpr2awPw3wsjp2D yLCw== X-Gm-Message-State: ABy/qLbehQDvVG9CvCmNjYKFLU/d0sBEqM47rA4reHA+eJeYRKFfbfJm rnIr4mrvFNaaoCJ7TIc89jwviw== X-Google-Smtp-Source: APBJJlFTpXsYiJ2cAzIhHq+JA8LrXMKtk4kXUSP72oU3vvwY69p4wCVLbaAPSICMAnOiAaIpPWYZAA== X-Received: by 2002:a05:6512:ad6:b0:4fb:8ee0:b8a5 with SMTP id n22-20020a0565120ad600b004fb8ee0b8a5mr5677308lfu.46.1690800763901; Mon, 31 Jul 2023 03:52:43 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:43 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:24 +0200 Subject: [PATCH v2 08/10] interconnect: qcom: sdm660: Set AB/IB coefficients MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-8-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=1519; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EjLG3n/q4YI8bbEqplfHVOwV0syrmI4lAF1qcHGTJvw=; b=4csAkdyLYRJkeElKC43KDJYuv8cjk8AT1BfwDPK8EkJgVn9frMBJ0+Vvqu5Yx0xLNjzG/4aoF R7OJJ/et669Dd15b9x5ZJ9dsYFJ2xN36uwKfmqTRmN3+Ag2yKNfqzQA X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some buses and nodes need additional manual adjustments atop the usual calculations. Fill in the missing coefficients. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/sdm660.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom= /sdm660.c index 36962f7bd7bb..7392bebba334 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -602,6 +602,7 @@ static struct qcom_icc_node mas_mdp_p0 =3D { .name =3D "mas_mdp_p0", .id =3D SDM660_MASTER_MDP_P0, .buswidth =3D 16, + .ib_coeff =3D 50, .mas_rpm_id =3D 8, .slv_rpm_id =3D -1, .qos.ap_owned =3D true, @@ -621,6 +622,7 @@ static struct qcom_icc_node mas_mdp_p1 =3D { .name =3D "mas_mdp_p1", .id =3D SDM660_MASTER_MDP_P1, .buswidth =3D 16, + .ib_coeff =3D 50, .mas_rpm_id =3D 61, .slv_rpm_id =3D -1, .qos.ap_owned =3D true, @@ -1540,6 +1542,7 @@ static const struct qcom_icc_desc sdm660_bimc =3D { .num_nodes =3D ARRAY_SIZE(sdm660_bimc_nodes), .bus_clk_desc =3D &bimc_clk, .regmap_cfg =3D &sdm660_bimc_regmap_config, + .ab_coeff =3D 153, }; =20 static struct qcom_icc_node * const sdm660_cnoc_nodes[] =3D { @@ -1659,6 +1662,7 @@ static const struct qcom_icc_desc sdm660_mnoc =3D { .intf_clocks =3D mm_intf_clocks, .num_intf_clocks =3D ARRAY_SIZE(mm_intf_clocks), .regmap_cfg =3D &sdm660_mnoc_regmap_config, + .ab_coeff =3D 153, }; =20 static struct qcom_icc_node * const sdm660_snoc_nodes[] =3D { --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63232C001DE for ; Mon, 31 Jul 2023 10:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231767AbjGaKzG (ORCPT ); Mon, 31 Jul 2023 06:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbjGaKyR (ORCPT ); Mon, 31 Jul 2023 06:54:17 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D89DD2D5B for ; Mon, 31 Jul 2023 03:52:47 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b72161c6e9so69632951fa.0 for ; Mon, 31 Jul 2023 03:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800766; x=1691405566; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qZQ93ryTVkLJ674HaEi8fy9NL3vC9KyVwveDa7EddrM=; b=MsqQUvfrtNqZ5II/f5svt2u0ySACeiUS9XYQtsAsGUZySRfiJD0s+0sgpknWz8dscw WCVUe33x0CiBH7ewBDEfh9b6EA40YGVEy7H2v4+i2IRkEZrQ5e33K2lUijpns3l3PMO7 CwSgmc9bC338f6XWJdEZidnQQSFEsKbnWj+FnysFD+q3jprPfeTmn6bYEcsZbGUV2lyB Z3knz2dr7O6tntLHz3Qgi46dLyjg+P0VNHINLgs3ozRfgjEDTmOXYkcU3ubW/i3NE+y4 N6hEr+FUgy3x/DP6Wl3op8SrfSCatnPmuKMj/FST+bTblllhA7f0XRggUk198Pq3J52d m4jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800766; x=1691405566; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qZQ93ryTVkLJ674HaEi8fy9NL3vC9KyVwveDa7EddrM=; b=fsDG7AvtdzvuFk96KhV7boVDciX1QtKlQ6Oqzqh2k8FW29HUznMPgkxHRNYGj/4Snm kCbZnsridwIHAljQQV+ZhbHAWex5UEIHNmcsnoh4NWP1wpbSZNabUwmUtO7Nf1+I1yeW szpj+G5URFM+ExlYUSxSKXH3oHkPzeXRn3FhsJKxXXVhKpIvZJGNe8DzwVt7Qx2gbDWT WFTw21b9u+yas8JYL/niB7cOAz6vXcgud6MQvrGG0QalD62luBjv7u85hL4NAIK+Omeh t3hgRtaTxJ3RlkwbuGiOz0cjkP0lxtd92lwIaSMV+U7lV7q+rMrEZz698PYy+0UoJFq3 VlPw== X-Gm-Message-State: ABy/qLYAllSKn691R763T52/XeLezHjmd+0zvrX7nwJwKj4BJgiSNCFl YVG5WrU5YQx5dS2n9h4rXqvbmg== X-Google-Smtp-Source: APBJJlG9ZpRzL8xKJZrOwMUg0AbfAdrM5vY3AiRIQUjs9voIAPHH6UDJNNK3T536pQ1uBzhjAJhAKw== X-Received: by 2002:a05:6512:1112:b0:4fd:d254:edc6 with SMTP id l18-20020a056512111200b004fdd254edc6mr4175359lfg.26.1690800766121; Mon, 31 Jul 2023 03:52:46 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:45 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:25 +0200 Subject: [PATCH v2 09/10] interconnect: qcom: msm8996: Set AB/IB coefficients MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-9-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=1682; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6Ylk54qLtCUKuTX9FA4QTRZGSUqgBkVW+4oTAnkFbFA=; b=QqlrfcFyRm49fh+DqszMLlo9ZzbFieubybDoExsW8pLPB+iO7aAof5Q59ifWrH/igEHa85MqN BdhDwfQ0hc6A1ZL+3GfLDx8RAMw7ZdGIt384BJ7lP1C4TbxJrNcr4dN X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some buses and nodes need additional manual adjustments atop the usual calculations. Fill in the missing coefficients. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8996.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qco= m/msm8996.c index 88683dfa468f..b73566c9b21f 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -448,6 +448,7 @@ static struct qcom_icc_node mas_mdp_p0 =3D { .name =3D "mas_mdp_p0", .id =3D MSM8996_MASTER_MDP_PORT0, .buswidth =3D 32, + .ib_coeff =3D 25, .mas_rpm_id =3D 8, .slv_rpm_id =3D -1, .qos.ap_owned =3D true, @@ -463,6 +464,7 @@ static struct qcom_icc_node mas_mdp_p1 =3D { .name =3D "mas_mdp_p1", .id =3D MSM8996_MASTER_MDP_PORT1, .buswidth =3D 32, + .ib_coeff =3D 25, .mas_rpm_id =3D 61, .slv_rpm_id =3D -1, .qos.ap_owned =3D true, @@ -1889,7 +1891,8 @@ static const struct qcom_icc_desc msm8996_bimc =3D { .nodes =3D bimc_nodes, .num_nodes =3D ARRAY_SIZE(bimc_nodes), .bus_clk_desc =3D &bimc_clk, - .regmap_cfg =3D &msm8996_bimc_regmap_config + .regmap_cfg =3D &msm8996_bimc_regmap_config, + .ab_coeff =3D 154, }; =20 static struct qcom_icc_node * const cnoc_nodes[] =3D { @@ -2004,7 +2007,8 @@ static const struct qcom_icc_desc msm8996_mnoc =3D { .bus_clk_desc =3D &mmaxi_0_clk, .intf_clocks =3D mm_intf_clocks, .num_intf_clocks =3D ARRAY_SIZE(mm_intf_clocks), - .regmap_cfg =3D &msm8996_mnoc_regmap_config + .regmap_cfg =3D &msm8996_mnoc_regmap_config, + .ab_coeff =3D 154, }; =20 static struct qcom_icc_node * const pnoc_nodes[] =3D { --=20 2.41.0 From nobody Mon Feb 9 03:50:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65654C001DE for ; Mon, 31 Jul 2023 10:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjGaKzL (ORCPT ); Mon, 31 Jul 2023 06:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232251AbjGaKyR (ORCPT ); Mon, 31 Jul 2023 06:54:17 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4091FC1 for ; Mon, 31 Jul 2023 03:52:51 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fe3c7f16bbso476940e87.0 for ; Mon, 31 Jul 2023 03:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690800770; x=1691405570; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YTLUtM1uWZf53dgnQ6whEyYV6zi8TUCbRr9vAqETA1s=; b=c2znP9PqoUorM4mVOlSUImCWst2Akz0RKqIQTFlxtfoGouf3V5vxm5hHMrSfnvDk6w iDc4W5LnbB8iO+6WqVkf1RJdjQO32tqDY1dhkOWB0ANLE4YhrnKbBs4JF6r2KV8Pzivc jQOgK+j45HGgFkpAAWtybbT4gQ7oOPSqXhJPicHnHQN0Z5weybYA6T/IU1VWScZvn7KX tIjnWGS2ICUTkl2NEzOl2HgmS7eo4JzdvdDXbuC2myxbpHM0E0c5lFdeZ4CN8Fw+i0ay TUmWIG/0NWdBV8kZPwnIDC4/kh0eEBkXCaRouwBUcsKg90sRppXNWGBzLN6b33UOEQ2c gXpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690800770; x=1691405570; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YTLUtM1uWZf53dgnQ6whEyYV6zi8TUCbRr9vAqETA1s=; b=hoVXug4kBi4dQn6QuXBAILUofk7z3iKzqoj94CeU60cyND7pInldPV4eQYv1Nr5Xhi eCvgxYOiRJ0kGJnmKI4sHmlOVaOYCVB4nEOH8LJwv3aZwQMdgwP1GAflOWGh1QaBNtWT LwWLHc/j7zt8YwgYuYGvXs9+mf7EGn1Bxx8VHz4IqvMjfJsWx+0Fs06HjJzQjnPesjw3 Pg0oPypeQoqTHpLffLwqRcqg1C8aVfti26RjXe4/DNlq6DCYNnFWNINj1vQDTsAaN7gc YoDV3WKRSUPE+2gPDLfQlFOgxQ/NgGpD98DEcAzc6X6/T43sIzun7z9z21ur2BPqyPG/ KhEQ== X-Gm-Message-State: ABy/qLYGmAQ4l0X2z515Hv2W00pvNGTWmkxqBSwM7qTyctswv0u/E0/F TOIG6f+bMEgydhvZfcZeNQquHQ== X-Google-Smtp-Source: APBJJlFUWxcYKuU4u5a9LhTmgvs672pkK9fpTe5+I1nUPTF3TwHcgrZ/chLYFhXXkWRkqkIq7c/ZRQ== X-Received: by 2002:ac2:5f43:0:b0:4fe:17d6:af2b with SMTP id 3-20020ac25f43000000b004fe17d6af2bmr4626221lfz.42.1690800770093; Mon, 31 Jul 2023 03:52:50 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p13-20020a05651238cd00b004fdc7ec5cbesm2016936lft.300.2023.07.31.03.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 03:52:49 -0700 (PDT) From: Konrad Dybcio Date: Mon, 31 Jul 2023 12:52:26 +0200 Subject: [PATCH v2 10/10] clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230726-topic-icc_coeff-v2-10-8c91c6c76076@linaro.org> References: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v2-0-8c91c6c76076@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690800744; l=1713; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=f1Gofilxti3i0Q7jqaHJvi76S1Nc3UXIB2Lux0RrHdA=; b=ZIUV/H1zLb4P75oFYqUV+xIVsQu0TlDVvSL9C1x+GsN0LHv5u4f9SllLH2OqfGr/3ZjJQuUnU BySvUlyDYmXDqr5yX2+veu8TCUSf9we2B7P1Hh2PHBTmHK/Cs2tC7mI X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As it turns out, it's yet another interconnect bus clock. Move it there. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 9b5411932594..4a23f6d3eddd 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -567,6 +567,16 @@ static const struct clk_smd_rpm *sm_qnoc_icc_clks[] = =3D { &clk_smd_rpm_bus_2_snoc_clk, }; =20 +static const struct clk_smd_rpm *qcm2290_icc_clks[] =3D { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_cnoc_clk, + &clk_smd_rpm_mmnrt_clk, + &clk_smd_rpm_mmrt_clk, + &clk_smd_rpm_qup_clk, + &clk_smd_rpm_bus_2_snoc_clk, + &clk_smd_rpm_cpuss_gnoc_clk, +}; + static struct clk_smd_rpm *msm8909_clks[] =3D { [RPM_SMD_QPIC_CLK] =3D &clk_smd_rpm_qpic_clk, [RPM_SMD_QPIC_CLK_A] =3D &clk_smd_rpm_qpic_a_clk, @@ -1182,15 +1192,13 @@ static struct clk_smd_rpm *qcm2290_clks[] =3D { [RPM_SMD_PKA_A_CLK] =3D &clk_smd_rpm_pka_a_clk, [RPM_SMD_BIMC_GPU_CLK] =3D &clk_smd_rpm_bimc_gpu_clk, [RPM_SMD_BIMC_GPU_A_CLK] =3D &clk_smd_rpm_bimc_gpu_a_clk, - [RPM_SMD_CPUSS_GNOC_CLK] =3D &clk_smd_rpm_cpuss_gnoc_clk, - [RPM_SMD_CPUSS_GNOC_A_CLK] =3D &clk_smd_rpm_cpuss_gnoc_a_clk, }; =20 static const struct rpm_smd_clk_desc rpm_clk_qcm2290 =3D { .clks =3D qcm2290_clks, .num_clks =3D ARRAY_SIZE(qcm2290_clks), - .icc_clks =3D sm_qnoc_icc_clks, - .num_icc_clks =3D ARRAY_SIZE(sm_qnoc_icc_clks) + .icc_clks =3D qcm2290_icc_clks, + .num_icc_clks =3D ARRAY_SIZE(qcm2290_icc_clks) }; =20 static const struct of_device_id rpm_smd_clk_match_table[] =3D { --=20 2.41.0