From patchwork Mon Jul 31 10:52:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128634 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1974708vqg; Mon, 31 Jul 2023 05:19:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEE6dKu1ZLZgivZlyEt//Mh+0wl5aVmtZSztXHwKziUiHGpCLye1gfnFWbKvJkUfEsanzoD X-Received: by 2002:a05:6a00:1822:b0:687:189c:4e26 with SMTP id y34-20020a056a00182200b00687189c4e26mr9432174pfa.2.1690805971288; Mon, 31 Jul 2023 05:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805971; cv=none; d=google.com; s=arc-20160816; b=D/xJvj6QmIw6qH93I6IjsL7gORvmOHRLCTv4bf02+B/HlKv+QZYsh33AxPOeEuoArz aCOV33QENs5d5eKYhKUJ/NuJyki/p3eusEng9Ij7oe7HasDZkBPnKsvQ4hCJfp1tye/5 bMGJI2LaQztVIbcZbMPzuwjESuRTdoJcdrhsgl43VnN+fcSYioKQbvaZcp72nsxZtXnd +EYf5w4/rCCfzodb8pnawOmkDYVMENUCIZgRl6wqB6eTwHvwUEtWfjSPX2pu1FUC0eMG 5HPZUzMkT11OmAgva5B/gaHMv5Fz/Lu7tTo7OdlWgHP90yH0Ji2jptgP2fqwLeP/Uf42 p4bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=l9Bhu6RTLTlOkPYdGmzCZK+SJ0ApPA44TktqVizGV/E=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=sPSJM6iacf4h/iS6v2pXvSevXlDs1FBCHQbItjzdrw70jEsjwy+amle5bkQuEb+YL9 KvJWot6Jhrx6ZDRC1delnnPTUJM/gIVAhTEMlNCV30V7hY44IuikcaAKiWivGa65fx9v agvDEDkKRaKPQEnq4Do0tSQMeyGPNaVheRNcrVDwAxd8fC9PamPQM8Cpee0Pexr6DI4E rVkzC15P81MMFZ43rjKged2Hyt8eLN8+gbs6xArpb9DTjsvRypP+QK8TCIaFii0AJcje EgYMgzYIhegmuaG+68OWsvijdAHT7zIfLAXyNUfQdkrSEStU6rwlHw/O3Yi7hg5XE2Sg gnrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FSUpixS0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq7-20020a056a00330700b00686dafa1aa1si7381248pfb.28.2023.07.31.05.19.17; Mon, 31 Jul 2023 05:19:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FSUpixS0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbjGaKyT (ORCPT + 99 others); Mon, 31 Jul 2023 06:54:19 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772938562094514183 X-GMAIL-MSGID: 1772938562094514183 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/qcom/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 = 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 = qn->sum_avg[i]; - agg_rate = max_t(u64, agg_avg_rate, qn->max_peak[i]); - do_div(agg_rate, qn->buswidth); + if (qp->ab_coeff) + agg_avg_rate = mult_frac(qp->ab_coeff, agg_avg_rate, 100); + + if (qp->ib_coeff) + agg_peak_rate = mult_frac(100, qn->max_peak[i], qp->ib_coeff); + else + agg_peak_rate = qn->max_peak[i]; + + agg_rate = max_t(u64, agg_avg_rate, agg_peak_rate); agg_clk_rate[i] = max_t(u64, agg_clk_rate[i], agg_rate); } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/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 calculations + * @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; }; /* Valid for all bus types */ From patchwork Mon Jul 31 10:52:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128650 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1989175vqg; Mon, 31 Jul 2023 05:46:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlG4r7AmEwJPiKT7EcrhflfmV7W42fIzXRNZfZYkxOG5w1Bomjbl40eaObn4b96mYX1NxAJY X-Received: by 2002:a17:906:3058:b0:993:f349:c98c with SMTP id d24-20020a170906305800b00993f349c98cmr6330006ejd.4.1690807602309; Mon, 31 Jul 2023 05:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690807602; cv=none; d=google.com; s=arc-20160816; b=x88husAsbxG/WCIwxp7vUNs6yn+faF6SrsJJNcVCGgkTJK3rHdkkBl7Cc7ARK1lkVf OGsE42PmHLwz56BUxghWbi4/QdrC44OzdPnFsE/9YsKr/rbpb2GnT2gY6imrCRnI/tE2 MjEdpZKpccXBAXVqeHFeqqVdPgTtjH5nPYseHd10qr77cpJzcp9is92aGK59J61DcyMK 8+4fmjqIHwM6EbC1NoBlr9XSFnLQGtScKu13AjwatbwDXJd0UHLhsi2IG8N1LVue4Rpt 6VxP6DikWGCszJvPXR+HMkihjDtv799/1a8u+2BOJYHuya0i14xFoB1iegwFPsVJA1TR idZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=xVvWZuZykGB5bMQAupOuWvDvdMeiJLjxPsV4TGGQesg=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=M+Xw4tTm9tnpVTURYUnr7wKx6JeO1Xs0YCrah2Aq4WuYqjtI5ZzKreKlfeF3bCDqSL pfl1YF3DYzNJLWt1qCrISAd4V7GeH1tJ3y8GPgj1rKpQi0Mgx0noH88U7oR17T74RmNd 3RRYezbS12mjWHLnqg4uDCgzFrxp4PBh11FJZVsasC2g+5vsWMe40ratE9Cof90weCsc ZyzQp0wLrlae3PshtW1ZizgEuREbELl3ysh6bd4Bb3d74Es04V1kClmi+/aLAKZnVxdu SwSeYR+/9anF7ntEPCvkyuOw6Z43XwWIOfNjp98Kvdsz3Ip9IPeEWH4g1CMPDlLYXSkG eSUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eDvFqWCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m21-20020a1709066d1500b009930e13beb8si6923695ejr.952.2023.07.31.05.46.15; Mon, 31 Jul 2023 05:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eDvFqWCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232324AbjGaKyW (ORCPT + 99 others); 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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772940272787099381 X-GMAIL-MSGID: 1772940272787099381 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/qcom/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; } +static u64 qcom_icc_calc_rate(struct qcom_icc_provider *qp, struct qcom_icc_node *qn, int ctx) +{ + u64 agg_avg_rate, agg_peak_rate, agg_rate; + + if (qn->channels) + agg_avg_rate = div_u64(qn->sum_avg[ctx], qn->channels); + else + agg_avg_rate = qn->sum_avg[ctx]; + + /* Check if the node has a specific coefficient first*/ + if (qp->ab_coeff) + agg_avg_rate = mult_frac(qp->ab_coeff, agg_avg_rate, 100); + + if (qp->ib_coeff) + agg_peak_rate = mult_frac(100, qn->max_peak[ctx], qp->ib_coeff); + else + agg_peak_rate = qn->max_peak[ctx]; + + agg_rate = 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 nodes * @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 = 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; /* * 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 = node->data; - for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { - if (qn->channels) - agg_avg_rate = div_u64(qn->sum_avg[i], qn->channels); - else - agg_avg_rate = qn->sum_avg[i]; - - if (qp->ab_coeff) - agg_avg_rate = mult_frac(qp->ab_coeff, agg_avg_rate, 100); - - if (qp->ib_coeff) - agg_peak_rate = mult_frac(100, qn->max_peak[i], qp->ib_coeff); - else - agg_peak_rate = qn->max_peak[i]; - - agg_rate = max_t(u64, agg_avg_rate, agg_peak_rate); - - agg_clk_rate[i] = max_t(u64, agg_clk_rate[i], agg_rate); + for (ctx = 0; ctx < QCOM_SMD_RPM_STATE_NUM; ctx++) { + agg_clk_rate[ctx] = max_t(u64, agg_clk_rate[ctx], + qcom_icc_calc_rate(qp, qn, ctx)); } } } From patchwork Mon Jul 31 10:52:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1989857vqg; Mon, 31 Jul 2023 05:48:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2R6I26dKSHC19VhhqkmlSND0hY/W1UVFOVNFXKAn9la6IHytHHXoVPHwD4lgXcF94MMV3 X-Received: by 2002:a17:906:d8:b0:99b:b867:4972 with SMTP id 24-20020a17090600d800b0099bb8674972mr7752929eji.35.1690807686758; Mon, 31 Jul 2023 05:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690807686; cv=none; d=google.com; s=arc-20160816; b=JQx/QPA/WU+8R6r2DuwuZ8eh0P6fhBus761ax2Ez02c6ytcHeocK25aDrCds9frwRM Y1w7ZVilRpaTECht/V5q6cZE60xDS9+U9yjvTfF3EaiD3Lbs0oSFQjPET1SS59hSjLcH 3AW+LxdSLxcUWRfpSaslZvv51UP2MvCYvvF2evbMaNaYIS50hF2vrn8jx0EaQVRwlX4t 4QEG5abJGKEz1oP+W1EI1Ahl5L2qaPHVKvAGNoJYw/2MQMu0AQs+hgJRUbivBoCs+0fR ZSm9XckuKEFHO8WIaYo67hJ0rAsyKBCMo99drCX7d63kqWtpAAcqmMaFeQZh2hjGTw9M zPnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=SyCiXkI6QRxT+Oa2T9MJLKBFuocjUwBVkwW1HGRN0Ho=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=Tljo5shta7aTxU/Cs4izSCil3+u0ASPDgZGiCf5Y6RcmMnmBR5Nsrh05eXGBq75/it HEdB3QX74eVwwcuebnYXqPAU3G/VZUGVvaeJFmoyPqpSe3UBUq/LlFoeVuDQ+6qP+Uc3 wnZgh38MFubAN3rZNquMIVnAqxjawhYPth1opGhDprDDq9g+5rD1GHdj95qFrRCtPKcX FVrUWwoF9BJy1uU3irbWFH5cARu1dl+66V1Bb4kL43i+zxRgQ7SH23u8XQ8r+J2p4C/c e6A9jgwzKpicTl/cGRG6gLsyjMUbj1NTPSYOr3fPspuLsOksgns+vKVCfF0xyGIX/Gpz 4tbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oTuXgKxc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi1-20020a170906da0100b00987ae307f0dsi3034898ejb.587.2023.07.31.05.47.42; Mon, 31 Jul 2023 05:48:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oTuXgKxc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbjGaKyZ (ORCPT + 99 others); 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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772940361033845645 X-GMAIL-MSGID: 1772940361033845645 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/qcom/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 icc_node *dst) qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE] = sleep_rate; } + /* Handle the node-specific clock */ + if (!src_qn->bus_clk_desc) + return 0; + + active_rate = qcom_icc_calc_rate(qp, src_qn, QCOM_SMD_RPM_ACTIVE_STATE); + sleep_rate = qcom_icc_calc_rate(qp, src_qn, QCOM_SMD_RPM_SLEEP_STATE); + + if (active_rate != src_qn->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]) { + ret = qcom_icc_rpm_set_bus_rate(src_qn->bus_clk_desc, QCOM_SMD_RPM_ACTIVE_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] = active_rate; + } + + if (sleep_rate != src_qn->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]) { + ret = qcom_icc_rpm_set_bus_rate(src_qn->bus_clk_desc, QCOM_SMD_RPM_SLEEP_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] = sleep_rate; + } + return 0; } @@ -531,24 +558,31 @@ int qnoc_probe(struct platform_device *pdev) return ret; for (i = 0; i < num_nodes; i++) { + struct qcom_icc_node *qn = qnodes[i]; size_t j; - node = icc_node_create(qnodes[i]->id); + if (qn->bus_clk_desc) { + qn->bus_clk_rate = devm_kcalloc(dev, QCOM_SMD_RPM_STATE_NUM, + sizeof(*qn->bus_clk_rate), + GFP_KERNEL); + } + + node = icc_node_create(qn->id); if (IS_ERR(node)) { ret = PTR_ERR(node); goto err_remove_nodes; } - node->name = qnodes[i]->name; - node->data = qnodes[i]; + node->name = qn->name; + node->data = qn; icc_node_add(node, provider); - for (j = 0; j < qnodes[i]->num_links; j++) - icc_link_create(node, qnodes[i]->links[j]); + for (j = 0; j < qn->num_links; j++) + icc_link_create(node, qn->links[j]); /* Set QoS registers (we only need to do it once, generally) */ - if (qnodes[i]->qos.ap_owned && - qnodes[i]->qos.qos_mode != NOC_QOS_MODE_INVALID) { + if (qn->qos.ap_owned && + qn->qos.qos_mode != NOC_QOS_MODE_INVALID) { ret = qcom_icc_qos_set(node); if (ret) return ret; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/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; From patchwork Mon Jul 31 10:52:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128645 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1983679vqg; Mon, 31 Jul 2023 05:35:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8v4Lx1B6kr9f9WSaPDmJ6t6n74tclY8qwczGmv0/4fnipiV2wU0uj6IwOoXb6IKqLfSiD X-Received: by 2002:a17:906:3185:b0:99b:f4df:dd52 with SMTP id 5-20020a170906318500b0099bf4dfdd52mr6456703ejy.72.1690806908784; Mon, 31 Jul 2023 05:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690806908; cv=none; d=google.com; s=arc-20160816; b=aeNSprzeDjTeGsqqjRIl/DT0yqntzPlDjaixIuGFOpaJL2SRRPldqg4qi4DOhlfThW loQZNsoyIGABH2P1SCUlrzGqDgvIPA6gtjT5QbLfJZWA/krQvcTMhgD/yBa/0/+7+bh7 rFUaEXpokGoEzh6E4nDY2MYhkznNSxyn+cjO5QZxeP2mAdXPgezsCoVXN67KEa7wNjmQ mbg/xIXGTqryoHhGqLNofKFYbKiqznMJHP2lmgRL2GETri6tYs0jJT1xWRXrqrcLUaTY /8tmLQprmksF3vCq1GcktmOKVtn+vfbtp16I7nglO2/eUNCvfOZz7+UN30Sn6O7XXhHe I4lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=CvcdgSAVOaO6olnZ2J7zbPhjDUv8IMKoyG5dIGy7pps=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=o2Uvsjg1SfgpvHAcnQGQ5AuhinnFO4z1UzXCnK5CLLpycxjZ4B5bVAXuXCg4f+7p6H SVh8JZvzkHOLeYygfRhUoowvjEwoBQBBJcGADHB3coCjAlDk9YtW78MJJMy3ugxuQ164 9HNVq7X9s9q7yCSARLYMNYcaqcf1JZ2LeEYTEnQ16WD/3grMx279W8BjgIKufVoAaJ7U BTpiaHW3d6qZky9ZxmGjfbRanQDY9q/ZMvM3fmGAlUdfHteGqdw+47nDCfxmvhO/Tpjw 51dmd97WZciUPxUiIgQw3BWmwuyl9/d6SNKb/XFTv0iFTFdTgWpddedhjaYFn7q1r0zu lJfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GvfLD9e6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a1709065a8c00b00988b6ffa850si6521430ejq.1028.2023.07.31.05.34.44; Mon, 31 Jul 2023 05:35:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GvfLD9e6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232405AbjGaKyi (ORCPT + 99 others); Mon, 31 Jul 2023 06:54:38 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772939544989477708 X-GMAIL-MSGID: 1772939544989477708 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/qcom/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_provider *qp, struct qcom_icc_node else agg_avg_rate = qn->sum_avg[ctx]; - /* 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 = mult_frac(qn->ab_coeff, agg_avg_rate, 100); + else if (qp->ab_coeff) agg_avg_rate = mult_frac(qp->ab_coeff, agg_avg_rate, 100); - if (qp->ib_coeff) + if (qn->ab_coeff) + agg_peak_rate = mult_frac(100, qn->max_peak[ctx], qn->ib_coeff); + else if (qp->ib_coeff) agg_peak_rate = mult_frac(100, qn->max_peak[ctx], qp->ib_coeff); else agg_peak_rate = qn->max_peak[ctx]; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/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 calculations + * @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; }; struct qcom_icc_desc { From patchwork Mon Jul 31 10:52:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1969453vqg; Mon, 31 Jul 2023 05:10:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlFCH6yLAM0tes4qPWRYGBzVy3/8RRq6LjulkJ7hLtHPtCFNqX+p0awICWEjVLXxOUJXdYVb X-Received: by 2002:aa7:d612:0:b0:522:7eaf:c0c0 with SMTP id c18-20020aa7d612000000b005227eafc0c0mr10323598edr.16.1690805453657; Mon, 31 Jul 2023 05:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805453; cv=none; d=google.com; s=arc-20160816; b=UdN/DOVX3aP/GBl+cjVzToCQAGEaKeoLssMiQfHNiddOTB3BxpIa3CYYcT5A38Ftgi V/m4Tgt8/KzGgyljT2G/zsOqkADb7h106+qEWhfheGiBV8x/v1N0jJOCpDOIanG9vLzI MFaulOBig/MNyR2VycJ27yOyYi2TTOEgN8G1+pDIY3yaeqqiUTJ6mhH3cHMFshFLPKtH ZsM5vO0lNp9CaGVT1SnO9a9BtNzTvvnwQxdMeC4HeUCL9hHKhkQNiwpH3J0z4FtNf6lX xRyKmJEAmNcNSZVjnHacJNeP76Vy8r4mzXRKX8wXc9p5AyNVyJ7jlcYXVKp50o2bfF6u 5ycw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fB3U8vshaXGTQDVy4zCZyIQDygwXYLYWLuqWZPmvE6A=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=0eomE/XEG5n9AfP+VRIk9HcSpdymgHwKjT0gHX/MVndV3nT+m/pZump9dab8bBwgy0 GfrKxWGWDvMm/Fs6VRS/NjwwqOpha2qJkl98e+oJOJxVDEggJg7rhD4+/rrZB+nWAH3k 5Flbt+gYV3PrdVAoT9OdowgV9Ntq9QPkSUC7w5QVQDLilwpQji0KfAD3U0m+abYuuYOu dxF5koacGuJcYfhpjQOM5JGxtYvKXFHEDY1On5uBV6jpsRTuFJnPXtb+4l0Ah0QaJMoq W1RpRnMGX3XSo307rlISeU35aAlydVt/2eu89ZuIjmLzE4xsgCgfds1fNPsALyLVeH0n kKIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cawrlLWO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d26-20020aa7c1da000000b00522bb898a06si2229067edp.18.2023.07.31.05.10.29; Mon, 31 Jul 2023 05:10:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cawrlLWO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230413AbjGaKym (ORCPT + 99 others); Mon, 31 Jul 2023 06:54:42 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772938019283180326 X-GMAIL-MSGID: 1772938019283180326 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/interconnect/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 = { }; EXPORT_SYMBOL_GPL(bimc_clk); +const struct rpm_clk_resource mem_1_clk = { + .resource_type = QCOM_SMD_RPM_MEM_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(mem_1_clk); + const struct rpm_clk_resource bus_0_clk = { .resource_type = QCOM_SMD_RPM_BUS_CLK, .clock_id = 0, diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/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/qcom/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 = { .qos.qos_mode = NOC_QOS_MODE_FIXED, .qos.prio_level = 0, .qos.areq_prio = 0, + .bus_clk_desc = &mem_1_clk, + .ab_coeff = 159, + .ib_coeff = 96, .mas_rpm_id = 0, .slv_rpm_id = -1, .num_links = ARRAY_SIZE(mas_appss_proc_links), From patchwork Mon Jul 31 10:52:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1974771vqg; Mon, 31 Jul 2023 05:19:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGP+m9UIN1CQg9ACFelOVUgvp8wTSxYMJde5AX/HqFyeEVsYbQ2BZbTK5yrr+EWC5w4WGm5 X-Received: by 2002:a05:6a00:24d2:b0:687:4b10:adf3 with SMTP id d18-20020a056a0024d200b006874b10adf3mr636845pfv.14.1690805976477; Mon, 31 Jul 2023 05:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805976; cv=none; d=google.com; s=arc-20160816; b=znOUx/X0NF7FcSVR3HqzdiJtjwG9sCTNI0ogDKqoSAVl47lxuIl4P3JjEqsmd8HA7s kWT8HSfh+e574ZPALdFhb95zGegCvIsGFnu/L+kI5E795fqGuRCOByjZ26JCHa8yk7+v V3ee4TSu0B5sZWpN0UQbOtgDkz1mSvkqAcD+RXm4BLxf26aOhGgFNbpwkioytC1/u6nO p9nuPXP1TTaQnVQqqU7iBJzwfEjoSVyVc8iap2mh3m0df+fOgZeglJ/M3po/NJWBEizt L4hPTLEb1Hb99o0bPd19w5aAPlMpoY3zJ7IxXzbZjxUFaOwZB466KdYah2YOXI4LOrBP 7MTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=gc7oZvOcJDkiBa4MtO2BaU3uRCE2+ug+vLU72IFcWhs=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=K7AXoHKAKUtl4PYV+MDDbJRSD277UEkuI+wvQx5g67UtIrQ1RNSJgJ+8oMjUf06RZ+ vK86cG18dCjjHB9VcpRy3yN9speP35gvY4UWAHEaTqrtoy6PI07fY6IAXTrHsl+7bnri r6CUm9XK3yLbkNlt3ssPinc+R91PMP/2n2pE+OzXfu0JOkP0TFveINItm2Ziw7ndU3ii UMzVh9yLTmFdRRt5+ZAEaDe2ZpVjoyiFhkEOdRsBqoSvw2TSEddxLl1KwOm55PZFUzx3 dLlhPi6TXe8OZu/bI82yPt9HcfnBegGO6QrH6tbjIx1FMdt2GXUNOxR79HuASq5NsRFg QIEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bIqvKa9J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a056a00179200b0068035bb7a40si5103708pfg.366.2023.07.31.05.19.23; Mon, 31 Jul 2023 05:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bIqvKa9J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231177AbjGaKyq (ORCPT + 99 others); Mon, 31 Jul 2023 06:54:46 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772938567461729861 X-GMAIL-MSGID: 1772938567461729861 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/qcom/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 = { .regmap_cfg = &qcm2290_bimc_regmap_config, /* M_REG_BASE() in vendor msm_bus_bimc_adhoc driver */ .qos_offset = 0x8000, + .ab_coeff = 153, }; static struct qcom_icc_node * const qcm2290_cnoc_nodes[] = { @@ -1327,6 +1328,7 @@ static const struct qcom_icc_desc qcm2290_mmnrt_virt = { .bus_clk_desc = &mmaxi_0_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, .qos_offset = 0x15000, + .ab_coeff = 142, }; static struct qcom_icc_node * const qcm2290_mmrt_virt_nodes[] = { @@ -1342,6 +1344,7 @@ static const struct qcom_icc_desc qcm2290_mmrt_virt = { .bus_clk_desc = &mmaxi_1_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, .qos_offset = 0x15000, + .ab_coeff = 139, }; static const struct of_device_id qcm2290_noc_of_match[] = { From patchwork Mon Jul 31 10:52:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1972520vqg; Mon, 31 Jul 2023 05:16:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlHfHSlW3Yxf9HefIr2VOnDIWZ3IcMaqv4fpNhEhTyr/1szV+cpwZjdlxjTjkgatpjIrPU/G X-Received: by 2002:a05:6a21:3384:b0:135:66d9:a52f with SMTP id yy4-20020a056a21338400b0013566d9a52fmr11444091pzb.7.1690805766904; Mon, 31 Jul 2023 05:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805766; cv=none; d=google.com; s=arc-20160816; b=SGp7KlXdxXLnlPmhD9mhqnRY/WA5EACz02fBOmTdDN0A/5HKb41PvKHRosKYmasJtF cNV8CEVThugiGYaypr6ZQThM/gUkhuQGjjptsVkkC6LbID2k4U8X41h8sUPj7FQUoczR vq+Mzsfdv1fb8IAbqPz+qQJfpmBWDgLKb5JRZMoe52tFdLFCQTxrrVYqWJ4Vb8uFdtLV jxkqvGQAQu4isEMEOSvQ1czrEzZR7Ds5OcVHPUYMup/fy5adbihAzmif5LITveu4sK1l xpyIC+VRczjHT5HtiDy8U77mEAVRCIhvm6djvUWQ3MhWcW6Qo7MRbbEJqV0DhcwdX5cz mXeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=4FqN2Sq9j6IVseScqHZxUGnTrukPTjl33EKA90GBaFU=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=lCoMyGAK0tkOy0uSmc/N9TLuWQoAdLaWnZd7Cnvy1kwf+ZQIElsON4QL1uYFsaaw+5 SDUg/uJnlSANLeS7udz2BIvCyqwE5+7FKl2URGg4MJCFFzF8qOTjKKboNVxuInP0M1Ja JalQ1bF1tr6RFNFDJzzCMU8E/XNYPr9bXk3AJ2D5xvgAFhc2G0yyV2Cxq/K6Hjf8Qt0l GF5kiYCOHfk4s8cswhZUN3V62v04m3hCe3Ld3f1Bi9PDbjqtTOhDkF2tv2+y9qCW0FyZ c4GRSwEpeEWhBhO5esDUUuZvdNkm92NONvm5cC9S8auVNT5v9CC2RrIa2nfOtKaz2B9B i6Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bIrsaeqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a633d03000000b0055b0f40083csi4536252pga.639.2023.07.31.05.15.53; Mon, 31 Jul 2023 05:16:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bIrsaeqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232474AbjGaKyz (ORCPT + 99 others); Mon, 31 Jul 2023 06:54:55 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772938347606484105 X-GMAIL-MSGID: 1772938347606484105 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/qcom/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 = { static struct qcom_icc_node slv_ebi1 = { .name = "slv_ebi1", .id = QCM2290_SLAVE_EBI1, - .buswidth = 8, + .buswidth = 4, + .channels = 2, .mas_rpm_id = -1, .slv_rpm_id = 0, }; From patchwork Mon Jul 31 10:52:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1952590vqg; Mon, 31 Jul 2023 04:38:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2QfkVHpclVTqs7rEDnGhVHj7sQauA5WCY+HI1XTxiF7xXGAhjwuI4mB/mROhT1SEk3vZO X-Received: by 2002:a54:4885:0:b0:3a3:cfec:ab43 with SMTP id r5-20020a544885000000b003a3cfecab43mr8148039oic.9.1690803521074; Mon, 31 Jul 2023 04:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690803521; cv=none; d=google.com; s=arc-20160816; b=hdkM87HIkqEyilH7XnWQcINYvdzUBrjRBGwJ8ZC+XN8JL8w3G/YmQdYd9IVfOY8HgT H9UuZU4PkB1i71bvydVi229Bx/aNAKbiciNBGV9FAexk7nW+V4GvJ0i5FEwpCir0LbHn +uQlpPcnONAgdErQDorSRwVczT1Xg3JUdpE6o2BzjtrnbUlTPxqM/xrfMKpAL+fUVHZs cBuU7/Ug6sK+hvWVaqCYHJx2UDcDiNMNrccrGj11tizxmvTGuADDtm1jwJ15F09X/A0K SbCaIqhvjlHaQeVENkgd82UKLe0T2vjrBUVIuVJrugFv7G45URk2m7p0kRoIRUtIJfmp sxSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=m5cHR9R1zj6+fWN0kfJbhPUfhYqf7kqDHOcaH9ExP6c=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=sWUEqpeL7ON7E5eb7dWdZANnSVLCtv1jb4kHCRBQ2JeVRnl+dV3AccDwGk/6EdJBHw ijfFzUE8GbxoPGNODvV+WVtP97X1RIBixKvRVWR4aI7YXgFWCwR2hRXSO8jhAyfML9jW 1bmqilqttDeLZxS+julFpTCetvoMSk9HNeAHZV+VNV6/Yr7g4mbxxgFTPXyKtyS1ycOx 8x1DztMwtE6B/jywoFiH8PBz6/545BD3sSNGCPkrfN/xAHdo75calJ0Zq45IyNYTphGb cOgE9wMU1QgOkyWTQ8WSCCDhJNvKE6WFlem2fk+dK0enVpMaVX7Tb8CLCX1iPI96OAwq z8+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITduZX8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020a6567da000000b0053f4a814953si2673641pgs.870.2023.07.31.04.38.27; Mon, 31 Jul 2023 04:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITduZX8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231436AbjGaKy7 (ORCPT + 99 others); Mon, 31 Jul 2023 06:54:59 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772935992877781343 X-GMAIL-MSGID: 1772935992877781343 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 = { .name = "mas_mdp_p0", .id = SDM660_MASTER_MDP_P0, .buswidth = 16, + .ib_coeff = 50, .mas_rpm_id = 8, .slv_rpm_id = -1, .qos.ap_owned = true, @@ -621,6 +622,7 @@ static struct qcom_icc_node mas_mdp_p1 = { .name = "mas_mdp_p1", .id = SDM660_MASTER_MDP_P1, .buswidth = 16, + .ib_coeff = 50, .mas_rpm_id = 61, .slv_rpm_id = -1, .qos.ap_owned = true, @@ -1540,6 +1542,7 @@ static const struct qcom_icc_desc sdm660_bimc = { .num_nodes = ARRAY_SIZE(sdm660_bimc_nodes), .bus_clk_desc = &bimc_clk, .regmap_cfg = &sdm660_bimc_regmap_config, + .ab_coeff = 153, }; static struct qcom_icc_node * const sdm660_cnoc_nodes[] = { @@ -1659,6 +1662,7 @@ static const struct qcom_icc_desc sdm660_mnoc = { .intf_clocks = mm_intf_clocks, .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, + .ab_coeff = 153, }; static struct qcom_icc_node * const sdm660_snoc_nodes[] = { From patchwork Mon Jul 31 10:52:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128656 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1993677vqg; Mon, 31 Jul 2023 05:56:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHMKhThuE7vJ/kLQTWkwBTzHuN2tt4xMI5py65hqU38oKNO74SSA5P0cYBNiDN2A7t0hnnU X-Received: by 2002:a17:906:5a45:b0:99b:cb59:79b3 with SMTP id my5-20020a1709065a4500b0099bcb5979b3mr7733624ejc.1.1690808202966; Mon, 31 Jul 2023 05:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690808202; cv=none; d=google.com; s=arc-20160816; b=wLBvYfoZ7JCdRyR/nRcCSa8SWpu5T7V4DZBXM0GOEDJt4YPyO42DH10PTSpUvfinyt lfHaI0U003B/K/d/RqKM2h+APDkfEBuQxHtT8MRsgd87Sb5B9vRtPo/nO50JM/rscORp 3w/e4PnNdijYNVsyIQ0A+5a/UyePDnWkYBQgPcToUsKeMdy6xYQ/4gbM1wquiU2kEFA8 /wmccvSqVR/Av6odk60ugGuqvVJu1YkFfNV3UCTb8CRHa9eHq8u2/y1PUnOTRcWraRuK pLDd0bcmEEOKBgTk8fJnHvVl7p3Wx8yAVb8IxRvf9EUgnbdgddepI+yw2ZWT+WuRFNkp 2H1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qZQ93ryTVkLJ674HaEi8fy9NL3vC9KyVwveDa7EddrM=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=V+z6FpATyX85zga/LckS9Sng/LeXeYdy0AAPneI5ViFene11iP7JZGBfCKX/hBtQqh 4naE+k2xHt+ZzPoD5wR9hXtVLA7aXT4rwCvtIPn0ab08J3q6bMqZjmTjWh2aSSPGz1L9 5EbDdyBCGtpkDsRNNdwQk1SXO3Ipn1x2E0RaT+asjIl69oK1ILjLEisk/lZ/ndtoFKYl vLnzENdLFCANUX6V8dO4c+cbExzVObjZ0CO7uXVMCy/cA1ZstOj7UKsUh4waROsNVRMi GCdmlhhOlUodwVVP+h2H0gy6aNcQwMULNuBpKG3icvFuFPJ/bKlynS1V9CCnbWzhO87l e2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MsqQUvfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ja1-20020a170907988100b00992d0de8760si5899271ejc.911.2023.07.31.05.56.17; Mon, 31 Jul 2023 05:56:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MsqQUvfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231849AbjGaKzF (ORCPT + 99 others); Mon, 31 Jul 2023 06:55:05 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772940902399423868 X-GMAIL-MSGID: 1772940902399423868 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/qcom/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 = { .name = "mas_mdp_p0", .id = MSM8996_MASTER_MDP_PORT0, .buswidth = 32, + .ib_coeff = 25, .mas_rpm_id = 8, .slv_rpm_id = -1, .qos.ap_owned = true, @@ -463,6 +464,7 @@ static struct qcom_icc_node mas_mdp_p1 = { .name = "mas_mdp_p1", .id = MSM8996_MASTER_MDP_PORT1, .buswidth = 32, + .ib_coeff = 25, .mas_rpm_id = 61, .slv_rpm_id = -1, .qos.ap_owned = true, @@ -1889,7 +1891,8 @@ static const struct qcom_icc_desc msm8996_bimc = { .nodes = bimc_nodes, .num_nodes = ARRAY_SIZE(bimc_nodes), .bus_clk_desc = &bimc_clk, - .regmap_cfg = &msm8996_bimc_regmap_config + .regmap_cfg = &msm8996_bimc_regmap_config, + .ab_coeff = 154, }; static struct qcom_icc_node * const cnoc_nodes[] = { @@ -2004,7 +2007,8 @@ static const struct qcom_icc_desc msm8996_mnoc = { .bus_clk_desc = &mmaxi_0_clk, .intf_clocks = mm_intf_clocks, .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), - .regmap_cfg = &msm8996_mnoc_regmap_config + .regmap_cfg = &msm8996_mnoc_regmap_config, + .ab_coeff = 154, }; static struct qcom_icc_node * const pnoc_nodes[] = { From patchwork Mon Jul 31 10:52:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 128602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1945583vqg; Mon, 31 Jul 2023 04:24:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlGLrh9oiZUkVshH9BwwnQTdR0NI6meaI4KDnQXnJTioYeF/httm7iSW5p73tRSM+f7hL0kX X-Received: by 2002:a17:907:75ce:b0:994:4f4a:218c with SMTP id jl14-20020a17090775ce00b009944f4a218cmr6133258ejc.8.1690802661078; Mon, 31 Jul 2023 04:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690802661; cv=none; d=google.com; s=arc-20160816; b=F8PfnMhyoDlfCDMpzuWokpQZRkQPNQz74MMoW4wUBqB3yGjtvqMu1yxw82oNFvBeZx t1OXSNkM7T+GS7o9Hj5RowKNZ4f0j0IUXSPFpEZp/h6MtxckGC1iNzSyULtIs1fKb9Ic o1FpT+QqNCCiRIpCsse/4AqXNWdwkY8F4ECn+KTZhkb1IwiSDyojCzQywym3l3QLfRUR Ttbq8vbE4EeuUL0wo246NvwxEOv00AeLc+e0qjIAI6gwhIT7qxGWufx12izJayLHVbqE KpXoC55nlDQ5xN9h9ZEaMZwUyCO/kO+n3ZjEftulJE8Db9t4ojkfR3gow1B73A//yzRF 8Avg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=YTLUtM1uWZf53dgnQ6whEyYV6zi8TUCbRr9vAqETA1s=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=SGMl8RjZI3hXRzk71A8zyXIujR3KeYdUiNT0QDmlkkOl5nNZGKqaFdi+yfvObJlYPK gFN67qVQolkEqEUmdgghoE/kBBI/U+lNRXVSC13jAegYaFpq5Iwh16co0a2wtYx0V07a KdIXeoq/NBTYmZ52kV/2hqUIlYVsP5Bd1G++Fy0kKZKgZhkwul68K4MxJHEKSjkcGL/r fZ4+NrTqASbMdS0LsIn/qTvQq3GYdX2a5T8v5w4Ur1Yzuo6Lov9OTJzDEneomrwi4lQT TG+PLK8SSTkpS9TtGE9HX2zPP7nIOcnnUkOBXmgwaaOIs17Q2Wg+iSRLks9wUZdz9o8T 7deA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2znP9Pq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lu22-20020a170906fad600b009938cb10548si1884952ejb.549.2023.07.31.04.23.56; Mon, 31 Jul 2023 04:24:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2znP9Pq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232137AbjGaKzK (ORCPT + 99 others); Mon, 31 Jul 2023 06:55:10 -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-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 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= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772935090926515609 X-GMAIL-MSGID: 1772935090926515609 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[] = { &clk_smd_rpm_bus_2_snoc_clk, }; +static const struct clk_smd_rpm *qcm2290_icc_clks[] = { + &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[] = { [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, [RPM_SMD_QPIC_CLK_A] = &clk_smd_rpm_qpic_a_clk, @@ -1182,15 +1192,13 @@ static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_PKA_A_CLK] = &clk_smd_rpm_pka_a_clk, [RPM_SMD_BIMC_GPU_CLK] = &clk_smd_rpm_bimc_gpu_clk, [RPM_SMD_BIMC_GPU_A_CLK] = &clk_smd_rpm_bimc_gpu_a_clk, - [RPM_SMD_CPUSS_GNOC_CLK] = &clk_smd_rpm_cpuss_gnoc_clk, - [RPM_SMD_CPUSS_GNOC_A_CLK] = &clk_smd_rpm_cpuss_gnoc_a_clk, }; static const struct rpm_smd_clk_desc rpm_clk_qcm2290 = { .clks = qcm2290_clks, .num_clks = ARRAY_SIZE(qcm2290_clks), - .icc_clks = sm_qnoc_icc_clks, - .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) + .icc_clks = qcm2290_icc_clks, + .num_icc_clks = ARRAY_SIZE(qcm2290_icc_clks) }; static const struct of_device_id rpm_smd_clk_match_table[] = {