From patchwork Wed Jul 26 16:25:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 707137 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 B037FC04A6A for ; Wed, 26 Jul 2023 16:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbjGZQZ4 (ORCPT ); Wed, 26 Jul 2023 12:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232570AbjGZQZy (ORCPT ); Wed, 26 Jul 2023 12:25:54 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3585526B9 for ; Wed, 26 Jul 2023 09:25:53 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4fba03becc6so1558938e87.0 for ; Wed, 26 Jul 2023 09:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690388751; x=1690993551; 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=jB32geWf90RWSJ/puuP7HGjsb5OtEdaqcLUmO5MUEyk=; b=CCJ6KftoE2u7NiLWNuwWPDtVpifdvKo4xe6UOJjFtbKyRdjqMqg5uX361BptvP8Cg9 FWV3zw0cIIRpFxp6iX+KF+3ueBF91mj4Ypgu9SEBrYP/wIy9XN4K9LE1Hieq7A+CjaHO aTvPBDCr+N3hpRXKc9imDzEsu4nItNEN7vALNAaMP/e5csYLitM7vA2POmf4Z3aizzjh lWlAqAbe9pXl2lFcCIq2d298Rv1txdpsifqMEJt+zr9WnUp6yCiBwEUgYshQmoGen0tR 75y0Le2D4+1vgR4ncrmyPa++gZ6/iOnXZZLLXRSYmQifjRO9uHJd1Gj1vuobWAcuaIIR TQVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690388751; x=1690993551; 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=jB32geWf90RWSJ/puuP7HGjsb5OtEdaqcLUmO5MUEyk=; b=W3AMo8w54VlaGzEW0HsMk3cK1oqlX/WisDFKyrBAlUL/BxB9CSyHj808pn+nPK5k+Y 5Dqa9sZ6zD1p6AsfUrGRVZmMJ5Zj3v0gq39eRw2A+2DZtLxSsNfX4yNQ1C4pRBKLCE6m NHzFXHcNtCXVd9grrM6avwjSJflPEVUt6ZtI75dDv8ARdo+xI3EhO31ACn2dY1aJKx08 +Kk0eOSTmC7EnNlTjuKwtub7BhmU2imyZduriuziqytDH5KCEtdOYOxIoiNSrqCKlYf1 ho0wH8I1ypwj0iGBoCdorFaVtAOcTvfP3zG3UX91GyVzcdO/03lNbsF8QVsAYOzb3Cfm ko7g== X-Gm-Message-State: ABy/qLZcsmY4UyiIbtq73sKKFUXHM6gFsSayc6YQfp0U/bljWC/K17tN UFikaZzbNE9YJTGqU7J+/c9J1Q== X-Google-Smtp-Source: APBJJlEdOcmZclfe9gWsFsy1sN/jV40TAjFJPePzOIDt9QT9Ud4/xJJNWXL6iRvxQSNwXgAeymBhDw== X-Received: by 2002:a05:6512:3da0:b0:4fb:7624:85a5 with SMTP id k32-20020a0565123da000b004fb762485a5mr13400lfv.0.1690388751480; Wed, 26 Jul 2023 09:25:51 -0700 (PDT) Received: from [192.168.1.101] (abxh240.neoplus.adsl.tpnet.pl. [83.9.1.240]) by smtp.gmail.com with ESMTPSA id a14-20020a056512374e00b004fba5c20ab1sm3336299lfs.167.2023.07.26.09.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 09:25:51 -0700 (PDT) From: Konrad Dybcio Date: Wed, 26 Jul 2023 18:25:43 +0200 Subject: [PATCH 1/4] interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v1-1-31616960818c@linaro.org> References: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690388749; l=3935; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=YJ7lGPV4JFwVTnFj0BAnHPjZR4mTBTkkPOZe7rsv1UU=; b=6U868dTCqZyKJLcr1HM/SdeFBmXzlfUz+WrxsSSA5SDQz+llT58/0LOfX9VDQdTM5kEWynFht rZKRjp/ZeLgA6fFa39ShDDD3audsrXnKbt8WtzY0Snd56OK4o4oS4rA X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 downstream does (X%)*AB and IB/(Y%) which feels a bit backwards, especially given that the divisors for IB turn out to always be 25, 50, 200 making this a convenient conversion to 4x, 2x, 0.5x.. This commit uses the more sane, non-inverse approach. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 10 +++++++++- drivers/interconnect/qcom/icc-rpm.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 2c16917ba1fd..2de0e1dfe225 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -298,9 +298,11 @@ 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; + u16 percent; int i; /* @@ -315,6 +317,12 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, u64 *agg_clk_r else agg_avg_rate = qn->sum_avg[i]; + percent = qp->ab_percent ? qp->ab_percent : 100; + agg_avg_rate = mult_frac(percent, agg_avg_rate, 100); + + percent = qn->ib_percent ? qn->ib_percent : 100; + agg_peak_rate = mult_frac(percent, qn->max_peak[i], 100); + agg_rate = max_t(u64, agg_avg_rate, qn->max_peak[i]); do_div(agg_rate, qn->buswidth); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index eed3451af3e6..dbb3146a81c4 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -45,6 +45,7 @@ struct rpm_clk_resource { * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers * @bus_clk_rate: bus clock rate in Hz + * @ab_percent: a percentage-based coefficient for compensating the AB calculations * @bus_clk_desc: a pointer to a rpm_clk_resource description of bus clocks * @bus_clk: a pointer to a HLOS-owned bus clock * @intf_clks: a clk_bulk_data array of interface clocks @@ -58,6 +59,7 @@ struct qcom_icc_provider { struct regmap *regmap; unsigned int qos_offset; u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM]; + u16 ab_percent; const struct rpm_clk_resource *bus_clk_desc; struct clk *bus_clk; struct clk_bulk_data *intf_clks; @@ -93,6 +95,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) + * @ib_percent: a percentage-based coefficient for compensating the IB calculations * @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 @@ -106,6 +109,7 @@ struct qcom_icc_node { u16 num_links; u16 channels; u16 buswidth; + u16 ib_percent; u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; u64 max_peak[QCOM_SMD_RPM_STATE_NUM]; int mas_rpm_id; @@ -123,6 +127,7 @@ struct qcom_icc_desc { enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; + u16 ab_percent; }; /* Valid for all bus types */ From patchwork Wed Jul 26 16:25:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 706682 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 CC8F8C0015E for ; Wed, 26 Jul 2023 16:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233197AbjGZQZ5 (ORCPT ); Wed, 26 Jul 2023 12:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233490AbjGZQZz (ORCPT ); Wed, 26 Jul 2023 12:25:55 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 324D626BC for ; Wed, 26 Jul 2023 09:25:54 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fcd615d7d6so10781728e87.3 for ; Wed, 26 Jul 2023 09:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690388752; x=1690993552; 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=YlpQZDurU7cDEuQbGYsNutn1v1rksKhpV41bGEsl56Y=; b=d0qbGGspyEurSFGz6ibFBd9VXfvQDBS5jWzy27V21n690MR0SekTFD3hRDP/B+vZxh eWDgpSkh5X7KWTFPzBS5KVBJde6jXk7jnZ0zce4BuQNVcfamgv3BhDlVxNuxOe6+b1n/ dhHuJRbLEUHpyUirV2YPPwwaTgsNDf8Q4LZN/wwVddlbFQj+F1wx6G3lpLPYfUeO/3K7 XmEO3EJv3fUMKUWJEwq4R+frPOLKzlOPq3nPX568dwLPEfjaT+Qd0SoLSKTpt5yFhngD 4IEzNIbAukIDNCz0WppD2Tp4Q+hcbL+grIh2MMv2lMy1vOerje0MuQx7G6bGyMiRbrLx 8igg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690388752; x=1690993552; 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=YlpQZDurU7cDEuQbGYsNutn1v1rksKhpV41bGEsl56Y=; b=FEEU21PgzlfVFbWKCZJgHdzz9TPvmd1MX2W4fKMhCJlFRRkk+l6JyEvx8GABekRrQT 9qeXwFTyIOkAYCrC2Z2OKwLQ98Vw3SO71KTzzCk0sycx5OTXKnyf50fjcFMDhkeOuLJy Dm/C3ZFWaMzqLdSdvRwqMmKj2/Ub6AGJxywjzBCGvBA5QFyIBTqVO5r411PlxHsGrVML fDRNgA1ikWZjWhsRb8M5sXWc9id1ui3Yu4Tghc4KAvIS3OtPOyLjdQCJJjXVF32MhpqZ ujqy8ABbarEfDlp+uPCdzR7WUZzYxO6/FiYd7vvwdIMaWpMfBTWrQwDIGV65ZDlFJszw B/OQ== X-Gm-Message-State: ABy/qLaknP10NKikCWi0GelkK15wmd5Dr0Mq7undwB1H6y0aOTQCuz9b q4s1chBC2ya0X40aZNnJkaZlag== X-Google-Smtp-Source: APBJJlEJk+BzPWqQ3r46/z6B3t7RlEJOYE0WpUtOC9pOPofBwWUXInVqT6m29hsvbmoe6DYC+HU+WQ== X-Received: by 2002:a19:ca4d:0:b0:4f8:7781:9875 with SMTP id h13-20020a19ca4d000000b004f877819875mr1657082lfj.60.1690388752491; Wed, 26 Jul 2023 09:25:52 -0700 (PDT) Received: from [192.168.1.101] (abxh240.neoplus.adsl.tpnet.pl. [83.9.1.240]) by smtp.gmail.com with ESMTPSA id a14-20020a056512374e00b004fba5c20ab1sm3336299lfs.167.2023.07.26.09.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 09:25:52 -0700 (PDT) From: Konrad Dybcio Date: Wed, 26 Jul 2023 18:25:44 +0200 Subject: [PATCH 2/4] interconnect: qcom: qcm2290: Set AB coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v1-2-31616960818c@linaro.org> References: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690388749; l=1342; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=w4cMQBcUUhS3DdTuB4xqxb90xCVKGorFLtRylK/3djI=; b=VzuUA4qmeTaeThHfdDDCqxCLSixVY7h/MqF0qXGcr6a6t4nUGFFSFReEkhZniL1Pn0i/q4IQQ xDwTTWh2T1gAK59yATGeYkNMjAvMhwQOXg1chChmR7oXHRtchVysNeR X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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/qcom/qcm2290.c index 3c3b24264a5b..457e5713ae43 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -1198,6 +1198,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_percent = 153, }; static struct qcom_icc_node * const qcm2290_cnoc_nodes[] = { @@ -1324,6 +1325,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_percent = 142, }; static struct qcom_icc_node * const qcm2290_mmrt_virt_nodes[] = { @@ -1339,6 +1341,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_percent = 139, }; static const struct of_device_id qcm2290_noc_of_match[] = { From patchwork Wed Jul 26 16:25:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 707136 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 2C284C0015E for ; Wed, 26 Jul 2023 16:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232640AbjGZQ0A (ORCPT ); Wed, 26 Jul 2023 12:26:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233104AbjGZQZ5 (ORCPT ); Wed, 26 Jul 2023 12:25:57 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2647426A8 for ; Wed, 26 Jul 2023 09:25:55 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fe07f0636bso3411483e87.1 for ; Wed, 26 Jul 2023 09:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690388753; x=1690993553; 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=PGPPZn4sgCGUmcJX5BOGkg/nNi/FbYofOgGSdq2+5ZA=; b=Z7JdDrDpDcynE/cL3sUx8QxPcA6i4sdt8bCmLmHRO65ZxtoA1fLoGTjj1rWbhfnC3C 160N1/EHVbvGOr/qMSG4zocFDkzMVeqQTfQ+vil2G86FxzFW0tG+nS3lCcmdEH3zioQb VE1ohMBThkm7krh70G48UxJ/gVrX+qACKi7o+AZHn0RKUwoNK+Lo7ow6c1VnQFy2YZbs PUk+/sU7ByqZTIwRiSZ1BZfe0HKTvfmOAhP9J+4kLagQbDgtc1kWwCgwxjNeSg2/wWTa 3BiF7lAsU92xwsJaVo9bbtsquH6n2eKg+b1d4Aw69NDmb99huwLtXo7H/sk4YyJbPfX4 nMFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690388753; x=1690993553; 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=PGPPZn4sgCGUmcJX5BOGkg/nNi/FbYofOgGSdq2+5ZA=; b=QcxvxlhHm3bNpNEJP1koM1KqnfaCcb6ezHAXrDTlRCNSZ9Ucek9UCx9jNNMsx2NW6u ZwivRyTSDlc0VZTE2SjBsbUOiF3Wvau6lpsry90SfZCGwhgS7X44MkNXg5qZOKy6Ehfl yG6nHqAkpzO18nbUh2QP9sidTp8mpw967rkRTocFGBqk1BekjhZiBAWJOpToN2hQXk8k JEEwQ6QzOEtvfoXDw6zmb0bIE8SxOU8TnGHXFt3Zsyse0CBizXUO1RF5DzISgwshC9hg +2osDWLPeOnSQR7YHycrQUqSozfhVOML3Q9+JrhNw2NhzBBbBxxlO8u9i2Y46qQ4xrnO qhMw== X-Gm-Message-State: ABy/qLazz6uJjn3FOzPUNzEGGcUlUxV7/ed4Agab6UAo8PBbXYIcBjbH /sGgeX07L9yVgYpvmwl/U6nfKw== X-Google-Smtp-Source: APBJJlHrBIpEiLV7UKJUG2SgVZt/Wtf+FSvMB+UvdyahNOit7eWZ9Qf0c1x8b9rFBNEGa9vcqhGnrg== X-Received: by 2002:a19:4f5e:0:b0:4fd:fef7:95ae with SMTP id a30-20020a194f5e000000b004fdfef795aemr1816753lfk.9.1690388753510; Wed, 26 Jul 2023 09:25:53 -0700 (PDT) Received: from [192.168.1.101] (abxh240.neoplus.adsl.tpnet.pl. [83.9.1.240]) by smtp.gmail.com with ESMTPSA id a14-20020a056512374e00b004fba5c20ab1sm3336299lfs.167.2023.07.26.09.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 09:25:53 -0700 (PDT) From: Konrad Dybcio Date: Wed, 26 Jul 2023 18:25:45 +0200 Subject: [PATCH 3/4] interconnect: qcom: sdm660: Set AB/IB coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v1-3-31616960818c@linaro.org> References: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690388749; l=1529; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1GzH+Tims+63zaTkCSn7UYBh9oQwB5PWYLl4YDuX6gw=; b=m+5HpYLUmYNcucjW7LR19Qvv3UrwPKwD8DfdpA41cB+UyCgC62DtO4QDo+oCWJCtD+VR/dz5d d5tPAgapkXPB6FEyItGULvgKFj+I5cspYL3Qo1qIPo6szk5/ckNGP0M X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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..cb93e2f2c2f4 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_percent = 200, .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_percent = 200, .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_percent = 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_percent = 153, }; static struct qcom_icc_node * const sdm660_snoc_nodes[] = { From patchwork Wed Jul 26 16:25:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 706681 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 F2FA1C04E69 for ; Wed, 26 Jul 2023 16:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233306AbjGZQ0B (ORCPT ); Wed, 26 Jul 2023 12:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233508AbjGZQZ5 (ORCPT ); Wed, 26 Jul 2023 12:25:57 -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 2492126A1 for ; Wed, 26 Jul 2023 09:25:56 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f95bf5c493so10963154e87.3 for ; Wed, 26 Jul 2023 09:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690388754; x=1690993554; 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=3kHqku5aNQeOxuldOBfASzBzbj6SzACN6ErkOb1f60g=; b=F8wR/OPNTELiTI/jFK2rOQwmDvyvhHjc5hVtNFt079Ia2Ih6YDf5QS7Ebngx3hQl60 KUyDZzq9Qxn1ucRI5w4K9+V5FlxcsDAP7BT9QrUcMhVen9MUbyPguv7cuyZ3cjo6cAa8 IyuWv8CVjVyBQ+eRYnd7NQWWu6Slok5QYjnelLrIEhyYCgx/x/DpC0+Bchz8Vn5bK5s9 PLi42pGzq3Zz3PLimCJ7rj/72mcNllW687zNpxP8UAz0Y5KQUAKP37G+dihw00Csx0hy 0zr7zkA65rZ47n6OcFbuiXvywvk4PgLBPOyJ0LnKd+viJfBS7lcQx3McGi+SGz2zmQm3 86eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690388754; x=1690993554; 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=3kHqku5aNQeOxuldOBfASzBzbj6SzACN6ErkOb1f60g=; b=JycJd3Yy8xLs1wfTDKFV8o7WdEOOV+VE5vyIcAfSgXTbZHwDwkd/iR+tDiazjaga6B r4WF+ymPzMTDOHg7kUzC/RcFHZQkpdk44ObEVUjVf7ysCdDO3qRweszdhdC/YfdBuG/p JzEW7stzBcqjmiepOH+McPp1d2aqbWqRAWdQpskKzhHK1CG4p4Uw1oTzdI5ScBLjh6FK t2t/Kj2R3Bzm1dXW4RAJ5TPFniTdDxAlEyvd8RCA+itNDwQ2zVgOlzC61f4ecSBtgbux wXS0QnQDM0rYYpPHA+zqpRVTUoSABNKatyS6nVv3tHhauRABnFIkT0ek6Fk26NaUcM9q BC/Q== X-Gm-Message-State: ABy/qLal77GmQp+KoUrrJK6jaoyp4dth3ynN+MNX38c/SVe7eGk+KxZw zj8RyE408GFHa0AUndQOVv/96Q== X-Google-Smtp-Source: APBJJlHuKggQDB2ovgqHgCPkyjHAAmZHbLpbQLy2mdBr4cT7QGRK/KXm70jTydFRJaOCkxHL/fj6GQ== X-Received: by 2002:a05:6512:b97:b0:4fb:7b2a:78de with SMTP id b23-20020a0565120b9700b004fb7b2a78demr2629017lfv.45.1690388754550; Wed, 26 Jul 2023 09:25:54 -0700 (PDT) Received: from [192.168.1.101] (abxh240.neoplus.adsl.tpnet.pl. [83.9.1.240]) by smtp.gmail.com with ESMTPSA id a14-20020a056512374e00b004fba5c20ab1sm3336299lfs.167.2023.07.26.09.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 09:25:54 -0700 (PDT) From: Konrad Dybcio Date: Wed, 26 Jul 2023 18:25:46 +0200 Subject: [PATCH 4/4] interconnect: qcom: msm8996: Set AB/IB coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v1-4-31616960818c@linaro.org> References: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690388749; l=1692; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=I9w13v27Aktl2g4cGZ4p21IhyuK82Ydc8kkNnjHFsco=; b=WruiJaJP7hlv2UhaxaXdLLtdz+JP25qA4MCyDJxiNOx6zBdH09zVzQ6VBM2nr37TViPtC3vg3 Q1OwksZty/gA+5z+Sb3szlLVKP17JoNNIxi8BVokl6gtwohvt/rZ245 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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/qcom/msm8996.c index 88683dfa468f..dec38cd42df4 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_percent = 400, .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_percent = 400, .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_percent = 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_percent = 154, }; static struct qcom_icc_node * const pnoc_nodes[] = {