From patchwork Tue Aug 8 11:43:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2241002vqr; Tue, 8 Aug 2023 09:33:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvVlVWgLk+L0SQBKCWYQ1BghWJhaj9YNkf2e34YZdvFKHhIewQTxEp3nHb6AKRRtp5Ob+M X-Received: by 2002:a05:6a20:a104:b0:141:69d:8041 with SMTP id q4-20020a056a20a10400b00141069d8041mr8907010pzk.48.1691512422478; Tue, 08 Aug 2023 09:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691512422; cv=none; d=google.com; s=arc-20160816; b=c0HivLI5a9denF9MC/O3VIFVrwAx4SX32vbvLg4PopMb/7ADKLedJFqLyQnFuYakPT qJsdP7knMVR4s7W29XtR9/ks9113hs6IiaqIT91IPxXDDd+oQmV4TOz1rOmGTnDF89t5 ObeZiGEhJ8d3nEo6iD3StQ7bcWlLjrASVMG/rBiM4S6pYMIaWyMOJgbAFz3SJxa9CA6V c3l+p9q1tokyVYwM+pEY4XR7vZmPfNXfoL4aGrUmyFVa9L64qKd/uC/jn8voKfyCGBHY 5m+jAs8d37hbe39HlPYYjTo9CVzpnldl6+RqTyh7tqB5AnuCkenJy7t0ALJpLu5EcpNo DTJQ== 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=9dpheXJF+49EUivNSUbko8L8HswCx+ro843IAYVBLSQ=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=l7E0gsfSoRuzuOX/Br0x57YEiORd3oFXukd3rtCbXkXkLFlE3n1ni6sAEj3cMs6mse 0AmDU2Hr9gz9TAiQujd6tqexJUS5YysVg1eoCO6upxuiglaVS95AAJt5k/ThVQpxrleL cPk8Mxzig3jAK1C4oNiKpEhLe4dSxMzcNc6KEBuP0Ybm+vEBIm4TCpUnDbHkhxnGN2db w6q8AZSwpWSY5MShTEJhfvEUirKqymN8BPewztUTQJzXLocYiBFfjevWI2TbeRkW/CFX RSEI6ZyxNbh0jZEQ4o64uEjd2DoroNeDaYyZVGXUUVrJ9GbmwsoMiZRmvzxxEEHqfY9S fNug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rsmfgHqS; 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 w185-20020a6382c2000000b0055fd97bff1csi7177088pgd.760.2023.08.08.09.33.21; Tue, 08 Aug 2023 09:33: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=rsmfgHqS; 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 S232294AbjHHQOd (ORCPT + 99 others); Tue, 8 Aug 2023 12:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbjHHQNL (ORCPT ); Tue, 8 Aug 2023 12:13:11 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 062E97ED1 for ; Tue, 8 Aug 2023 08:47:20 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-99c10ba30afso1458287666b.1 for ; Tue, 08 Aug 2023 08:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691509638; x=1692114438; 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=9dpheXJF+49EUivNSUbko8L8HswCx+ro843IAYVBLSQ=; b=rsmfgHqS+aZxTNBx54E7eNiYw7PmYXHyeTxRrsSW0h2MmDgBsvl3N2PbmsNx2oCDw7 k1MlqWIwLI9D7shZBYVMgTxKPTQNWuzUgQRO1NYuiMFE/qnopQtqNZZYwX40SqiQ4fn2 1H8OIzbCBxvkkupPDW6IK6XqbqyDqMNwZ9fOchk4sxXvVr+JhYNLNY6SJ1MsDGGE++Zw C6VpJvJELRHamKwCNp3PNb1/kq5v5/Oooc5oxWzoXkEcP1l+tRqQtXkwAo0Q3ya2Cw9I qjm0sfepKHe2Z/DNZlm9jnieuRa1+jzUJCNaNTBW9OcPc/ikio0H3vPklcdUbOrVfi3s MLgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691509638; x=1692114438; 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=9dpheXJF+49EUivNSUbko8L8HswCx+ro843IAYVBLSQ=; b=DaVvbiXXEdrtvaDMacGR0EU7hjYAlmZ+I44lDluDBRXA9t7Llg3CSc4vLwc62T4KuF Yow6CYshCnXnfUfm8NhfVNQDQaWpgsop/YqEHPLzJOuvM4wwYRdzB0scdyuZl95gSj4W BhhLEobBKkAtP+vCy71eBhCL5HE4eDs2BQcZZ5k3qWk23J7AcSyq2mSKXzJlc9aAIzag jXfDF6p/l4bAJW10VsZXZ0mnuakBhrGIF1bMbkrX5zcXaiiF32yr8I4ZBZCidyLpxRGq MRhgILfcnJbocec4E4jPdr0Pk0HQd6VVoc6xtnupOBS7wMsbTfqTGVy7XUgZGSAFzk9x LjWQ== X-Gm-Message-State: AOJu0Yx4UPGbs8Qj22ZnJRIe7rVMWqtEVNqUmp+FEolR2DZO2xMwMF14 2SB48u8qTly/gP9tSOf6thHmDpoyqSQ59Pbavpk= X-Received: by 2002:a05:6512:3051:b0:4f4:7a5:e800 with SMTP id b17-20020a056512305100b004f407a5e800mr3468887lfb.10.1691495016756; Tue, 08 Aug 2023 04:43:36 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:36 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:32 +0200 Subject: [PATCH v3 01/10] interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-1-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=3362; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=PtHTjiWgQBO5SjMZ6oomj/9k2KcOHpsmAcBX0YEWtv0=; b=mKs8Vh24BaouL9/kklS4fc/ZntNALxrPg1h5q7n5dx/NyCkJoJi2Uy1djpoUO53f1Y5PJW0Zt Y5TKpai734mDuUv/Hi1sEC8msgfry+G4zOspXXksOcjoM/muknRRlv4 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,URIBL_BLOCKED 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: 1773679330292228260 X-GMAIL-MSGID: 1773679330292228260 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 | 18 +++++++++++++++--- drivers/interconnect/qcom/icc-rpm.h | 6 ++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 2c16917ba1fd..8b02aa8aa96a 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,19 @@ 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 = agg_avg_rate * qp->ab_coeff; + agg_avg_rate = div_u64(agg_avg_rate, 100); + } + + if (qp->ib_coeff) { + agg_peak_rate = qn->max_peak[i] * 100; + agg_peak_rate = div_u64(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 Tue Aug 8 11:43:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2290733vqr; Tue, 8 Aug 2023 10:48:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHU8ogqti51rqd2X+Ot7uFc9N9Qr9GWqfJtrvVKuJ2Z6LfjibNbbq0uQZ11DCGotMrKC4Xm X-Received: by 2002:a05:6a20:5504:b0:13d:7433:2ebf with SMTP id ko4-20020a056a20550400b0013d74332ebfmr176847pzb.60.1691516925433; Tue, 08 Aug 2023 10:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691516925; cv=none; d=google.com; s=arc-20160816; b=a4YpFC35r7C994j89dTnWvvzjs1Hhh3FXKuzGcgseVCr+0Te7PoojGA42ZeoivjOCi 6oACDIpZkm4qgAgOpupCFv1dHTe7i7q0SrfPbs8Ge4ECL74ldprKP7fzLsukgHrEERKP A6+IMpTPiA/1YpUL0wyFIC5PmB0BTJQIdcxMyNPwwwK9fWnFlrjunWfwtNIxa+lUJYRc reDcZo4uj/5U8TXQ3uUDiXsWez+PaA4zswue0AOp/4IrLHFVPmjfDNsxdgw+U0NW/eTK H2GtBqXaoUU/PSu0tMNvjp7K2H0REvNProsXu0BBuTRAXvNUdNd3lluP0twhGSB1i+Kr fIwQ== 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=NiT0zdP9RcVMfv6FtcplHy2nGhazgGSIvo5WbDUA63E=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=qh6XwspZxi7YSCPSX7SlMfrScJVTHTL4gErNHc6XZ6deR3rBHtjk+DeAOcT3zZSQnF c5VhsZB4WHruaXWq8fnZTl2fujyt9SKOEgoJ3CDJCmc/2SyZ3ID51Cs3CsFLFfaNNMoS is5CcvBo8Z7bt46+GCmjSx75Y05RJpWz8rAxSrJmDekBPsBBjxhfGqTA2v8E+Uq59pHM dDlEKHNXk5Himt2F/UvJM1kPKyw0tqBIKisCVPSevxZopn2mGZnX7EPqB9OU4wR1kuHa onTYgQo6n1B358axLvHo/0F7yxYKIFYzJFvyTjkMKaPNLIQCnuLVIcr8ro7gQZtep/ZG Dx4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZHZ++3zm; 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 h2-20020a635302000000b005599cbfa257si5076864pgb.275.2023.08.08.10.48.32; Tue, 08 Aug 2023 10:48:45 -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=ZHZ++3zm; 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 S231465AbjHHP7e (ORCPT + 99 others); Tue, 8 Aug 2023 11:59:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjHHP6H (ORCPT ); Tue, 8 Aug 2023 11:58:07 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD795FEA for ; Tue, 8 Aug 2023 08:44:09 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b9c0391749so94587761fa.0 for ; Tue, 08 Aug 2023 08:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691509447; x=1692114247; 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=NiT0zdP9RcVMfv6FtcplHy2nGhazgGSIvo5WbDUA63E=; b=ZHZ++3zmQlwd1mEzaVBBUg0PAOuR45Xa8tsJisFeO34zk/JkUMlXJxOXv5u4SN/PNb NY74PnS311dzolKfsnr5Vv3HdG1z8lIP0HcK4SoWxgTkUTMdy0bnVX57jdxLMdod5K0Z FQEsLah8IpmC1Mv9PqXU2Y6/+M1z1FVE5zotPNSO+4TXPNltoydxy18RoJU4SWDMeHpp eA2K5mAfmEyw7gB7q7EqjsEnDkk0dN9+zaQy2UkPJKa8M0F7fZNvozmtPd9xegPWBetO fNOMfIfXVETOu1WUwGsXbJcakJOQJNsemTFeBkHwf5HNKjOOD3phcBo5ap0r2vy9uTvD lIyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691509447; x=1692114247; 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=NiT0zdP9RcVMfv6FtcplHy2nGhazgGSIvo5WbDUA63E=; b=FxM1uPUo1I9s4nnfwuADw+unCRvJwSnRalvIVEQn5Y4bhkvb27u4T6KPG7k8ATP6XB sFXsfGe3TvCCPTbEj3QB1dCBzqFEV/6hYyEkKvZ47rSMptBb3THp1rcr0R0GxTxfrswm dFYlHffoVQTgNTMHCPKyP6PSzdjRaOb07FYFNz1QBe8oFhPp7OpyJti+QEuI8sonQI2y HrIZyJuEy7zijxIx4GcnVS07YTKS5QRPdBSBig5DTvi3oa7LUuagTCzSX6ZLeE/Emc79 WnIwB/geYpIu8zdM7RrVjxE3ZBDs938Wn0yX8Duj03b09DUK3eWDk153jr8hr/vfykWD HddQ== X-Gm-Message-State: AOJu0YxokwEqpQUnOZs3ZrVunMNtoGLGK8cE6G5sW6o9Bbv6mI9bFLsj T8wieBQ59a1c+HcVY7RgZlkBKMMXtHsrLx1lvK0= X-Received: by 2002:ac2:4e88:0:b0:4fe:ecd:494f with SMTP id o8-20020ac24e88000000b004fe0ecd494fmr6969822lfr.33.1691495018085; Tue, 08 Aug 2023 04:43:38 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:37 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:33 +0200 Subject: [PATCH v3 02/10] interconnect: qcom: icc-rpm: Separate out clock rate calulcations MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-2-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=2930; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=s1ZE4XHCfs1j0oOrUS6GpKQLQgPUfnNi7YQdZMNs0uA=; b=BNLRtVUx+or/VTf6c67Fn8JQREAUM7KBMxBUw0bidTpwWnVF2uG46h/vQ7rWTJJxXrCyqlcrL IOWQVTe2E5gCEsjBZnt/i0WfG9lrZKz3P7zP5BydAdzwZBurxpKPb6a 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,URIBL_BLOCKED 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: 1773684051403253349 X-GMAIL-MSGID: 1773684051403253349 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 | 53 +++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 8b02aa8aa96a..8c1bfd65d774 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -291,6 +291,32 @@ 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]; + + if (qp->ab_coeff) { + agg_avg_rate = agg_avg_rate * qp->ab_coeff; + agg_avg_rate = div_u64(agg_avg_rate, 100); + } + + if (qp->ib_coeff) { + agg_peak_rate = qn->max_peak[ctx] * 100; + agg_peak_rate = div_u64(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 +325,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,27 +335,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 = agg_avg_rate * qp->ab_coeff; - agg_avg_rate = div_u64(agg_avg_rate, 100); - } - - if (qp->ib_coeff) { - agg_peak_rate = qn->max_peak[i] * 100; - agg_peak_rate = div_u64(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 Tue Aug 8 11:43:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2333109vqr; Tue, 8 Aug 2023 12:02:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXpivsh6iMXXD8cDsab2jIHqy6qZJJWEWBpQvaumIXvWrRmNJVeTqZnRwf8ABuyarpjvqC X-Received: by 2002:a17:903:2286:b0:1bc:8fca:9d6f with SMTP id b6-20020a170903228600b001bc8fca9d6fmr676231plh.9.1691521370270; Tue, 08 Aug 2023 12:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691521370; cv=none; d=google.com; s=arc-20160816; b=TRPIvXytYn8e7HvLZZUGTEEBxCxvCFHKdbvjqfb3pbE9Z1JPbaUBg2nlZRK3VJTxRX LZiGlVqxssuLlEZlm5fLsm38VFjLP5BO3p0Lh7sl8u9Eq6dLvqjHbjsuYEURogYcrQzS B+xq4kdKy99/EI4/bsVnFHEu+tLfgwDK/ccSvllu9SvepRKcsTXFQehNl3iHpArJw3cn FsI1C/mdFvE90ZB/bsb2+vdvgTyr3FoAqKKVCATLtHCAWTKfCGMfFqb923PZYcXC3jr0 hCpgaNWhKi9P7ZKJ7o27DdnnzvSUh5aFh5JV8m98DFuZwD2/hQ/xbfmINgu1gMV6K9Af g0XQ== 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=7eF8Rl4Nrv0n3qIaC6c+71IiCQoHSuRD0COK5QFMyP0=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=W/Tx3ErftI2L5aeCvnF7XSkufirXczJb88aIEYoG6pR5an/S8BV/mpgBDBUcGB/+xX aNyBsG4lb/YZwHVtkb4QjuRyQeyrCysp9LuQyG53/lq2K7z8LraJHfdRq1JFm8LkSseg UOSAifcRdO2KRL+lO5Lq+UoScetOIOTw6D8XPbPFBwKQHUxrSCLBWrS3NYSKelen3M6q alkrhB72BJedXELllTUPbmbRgs2d7RaZYoC6lSia5PudLw30uisZ7dla3iogUx2w08bh nS7SbZRTMfenr/Ow+cpuuufI4jflbVGY9OdPYBv15fSUyoYpiUJY7c4CGbyDLLmLKgDp lzPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IVutqcAt; 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 e3-20020a17090301c300b001b7f849cd12si7806117plh.81.2023.08.08.12.02.36; Tue, 08 Aug 2023 12:02:50 -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=IVutqcAt; 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 S234144AbjHHRRO (ORCPT + 99 others); Tue, 8 Aug 2023 13:17:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbjHHRQm (ORCPT ); Tue, 8 Aug 2023 13:16:42 -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 8268E1D46A for ; Tue, 8 Aug 2023 09:06:49 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fe4f5290daso9093009e87.1 for ; Tue, 08 Aug 2023 09:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691510805; x=1692115605; 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=7eF8Rl4Nrv0n3qIaC6c+71IiCQoHSuRD0COK5QFMyP0=; b=IVutqcAt+yrzDmERanIx5u28So84Owdiuvfs6o0g45GWuUwkNnR5+5VIDd8QPU57gM oReK0VziIHeMnDffv8p5iMfOBnes5JvvmzkfKB9bn6RwM6kXpT8Fm6xo95+Kn4Xvo5xe kZzDROKvNswdNbF3s3QMcMO7stB5ITt8b87zOymyfMG/ws6l5SdFslQhIR9lXnbK50GI npvH+iOo9rU4TQsdrHEdv8hhVzlaDPIzkp8qOoiMTJ6lZAccXzoDxgLe9r5d+SViZeYo hcP8r74RXnPp88dE/ns++NsINJlzwkb1kMGNOlOcenhogFSBN3zcju0cOE0pmtOEJv86 U4/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691510805; x=1692115605; 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=7eF8Rl4Nrv0n3qIaC6c+71IiCQoHSuRD0COK5QFMyP0=; b=TFvITkKXEihruETIagrRYwIR8RS3mdzyH4aRIL8TRfvV0DoPI3o29YWJUTL6tzPJWw IEAosCM1x/PBBCQZJmzZ8AHhTz+4Ys+8N9PmqUg6MG7TfVedxMDXMXyDvuucafnSEC7Y 8/h39T5yWRYu+P7oXKHR6/Fs1I9Z68I54Hv9oM3k4umWfUUlFdlHvb54SLTuO8XiCL23 XdYeDPTkU5PZ4QTHMaVBKxa41o6STYM73pc4/VWyle+sF8/Ln09qdBxYrcodapsaxM9P u4fzG8enVbY+eA6o3CZq7ww2fKnWRdgKsoxmCPSlXgecPDahb4qGrH5vk7L8HbqUL+cY TH9Q== X-Gm-Message-State: AOJu0YyptDQMbVTV3t8IGyp5s6y4VwtHUBwm0qjsDopO5CfmGdt/oGlR R6XmDrs8uEK/xv751XJLDej41BZBlfhjBNZNjxk= X-Received: by 2002:a05:6512:1103:b0:4fe:279b:8a02 with SMTP id l3-20020a056512110300b004fe279b8a02mr9262600lfg.67.1691495019651; Tue, 08 Aug 2023 04:43:39 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:38 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:34 +0200 Subject: [PATCH v3 03/10] interconnect: qcom: icc-rpm: Let nodes drive their own bus clock MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-3-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=3111; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=8JDjpAr7N9o+Ldc42lWfgA5mVZfE1TEXPiQOh91fLVQ=; b=YVAatYh7xnAWvBz8CbkBbjpEVXXX/ocZeGoh4gETy6ScPffEddtOjrccwL7B7bBTyuuFZ4fhm mJZhqrcP3X9CGIZcoGsq1+Yz4R+eRQNJc8oAC2ZeWOd3m7gnL20DT0x 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,URIBL_BLOCKED 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: 1773688712433850442 X-GMAIL-MSGID: 1773688712433850442 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. 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 | 27 +++++++++++++++++++++++++++ drivers/interconnect/qcom/icc-rpm.h | 3 +++ 2 files changed, 30 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 8c1bfd65d774..1d3af4e9ead8 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -414,6 +414,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; } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 5e7d6a4fd2f3..f9ef16f570be 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,11 +111,13 @@ 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; int slv_rpm_id; struct qcom_icc_qos qos; + u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM]; }; struct qcom_icc_desc { From patchwork Tue Aug 8 11:43:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132805 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2359622vqr; Tue, 8 Aug 2023 12:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvyCXnFyK1+oFP28wRPpuGouce2yoZkV3oXvXfwhXkUinMZ6uHygiAVbICBTyF4n+vwxfT X-Received: by 2002:a05:6a00:80b:b0:66c:9faa:bb12 with SMTP id m11-20020a056a00080b00b0066c9faabb12mr676887pfk.9.1691524393320; Tue, 08 Aug 2023 12:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691524393; cv=none; d=google.com; s=arc-20160816; b=iO8LfqcGQFxauzBRvB1uRdE99nmpd3r4ERnCstDhbYtR/tJI4xfe1CFHBR0C+D6PW3 ZsObSW/ya3Rvq4hEDrTjXQ1k5LwmYGO1hpMm83IpztWoRTFAMZukdnnsb6xaDDJDiyCR sRr80afmTg3SJBzjtvqHId7CdQtInXUpESh85QxaBCseDF+wU7SCwaRobSit3p874Hc8 1tC3tiRXh5DBfKyPiY7qKEAoyHCogTnAHuVZni0GRv2b+c5hWH0rjbot9a4XnnnKRMUV K/bFPoJfDuY6rXSwXlyGLPWh3fYnvpF7tBoAwxN64luBkiNtdHdfT+eX0mHQI4ZOd1uj vfxw== 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=CCSujwELynCWj7HlDSXXF4+s6C7wX8tgmYY0fFjd99g=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=qzbUAoWH2RzQq5OeZy0AUuSmHW+U7tEF2Svrn27iV1J/MX9ON0L7NgD55GspSzLiJL C9/0i4AXOe20c4ki+lYJlcWhn7dBpf2dR6dpWP6/T578eFp4yKinbmCwnrlGzO9Kb6ZF xPqaShNghn3ofWm0ClCigEfsEQrw84g+p9eF/GjtGN7jG1bygWrTa+Ro0AemNNs2ZB+X mlgi0t/w/giA4BiHRoY9yp0PoAULBflSng6kcoJVFTb5CiwzqvX7UvOL+zf4Atm93Wt/ ea88RLo9sSBcnYCfvkokYKwvcDRlWF8L8OZAB7i7r6CD4FzPZOYdNvCWeQmxtJ91HY8o nnsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wifMO7XL; 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 c5-20020a656185000000b005526bd0c526si7381599pgv.641.2023.08.08.12.52.59; Tue, 08 Aug 2023 12:53:13 -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=wifMO7XL; 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 S230440AbjHHSHY (ORCPT + 99 others); Tue, 8 Aug 2023 14:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234565AbjHHSGw (ORCPT ); Tue, 8 Aug 2023 14:06:52 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 689F45FA95 for ; Tue, 8 Aug 2023 10:06:39 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fe1fc8768aso57335245e9.1 for ; Tue, 08 Aug 2023 10:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691514397; x=1692119197; 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=CCSujwELynCWj7HlDSXXF4+s6C7wX8tgmYY0fFjd99g=; b=wifMO7XLjFxzlFapqPKukO1CoskKiPXULKZkvBMbfsL6gFRz7bj/mYqG4p233KIM0J Ty5QDY2t40tDIxL4yeEyy3NrKgUvGQoBitFJYrPFZRMSQSyJqQpr1LMr53o+aCSBZRk+ TXud7io2JD4ehiVuWFQXmnFvKUL4c+JNni/2R2LiuHxettXV2n8HM4D2uL4+o1oUopB6 BKDqT5Z9WW4Iz/GjFmaifSsy8w+w3SljABuZEqsF2AwbAJb7PuTnljiPa4NdBRwrFf9o uMkeEjL8gkl3sCSsvLYt9z0S4QVpSMKXRds3MCH1nBta2xUQ0BXq9nr5YOJtaoj96Nog IyHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691514397; x=1692119197; 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=CCSujwELynCWj7HlDSXXF4+s6C7wX8tgmYY0fFjd99g=; b=fEVZQIHj7mqH+YaOvKfSRo1o6zzyjMcdYqMqYELrbN0OS1/QiVtWTzaKflfvU4V8nV oF2FuIBHMeAMqpoiOcHc3rVqpjMh+cdwtofnZW/vtDbIKjseDIOK4BvTFmuXI6g901qa 3XGcXdYE/mk4cknTzoy2jnk8CYr+Neuk7q/ddOxvsZtWyjhYoYOFt2GVgYMZoKOwLgyh laB6wccI58r/y67CJsmjiD4wzxy2UAvV0JdkWfYdd8Pfu6xCpcX20XQ5hbY2P5hygNSV P169u15pUYdTbfXm8YsHjuROnVNkoFUUf+12IZZfV9SkXt9W7aooV0BGrBoQH2buTB/5 VMsg== X-Gm-Message-State: AOJu0YwbTBfpTVcAlMKEMP+Q+wN7zD2pRao/Kv+OJiKyJy9TI1LOWeOS 8X89zpfvyf5Z2QQ747WqD02uN4Xi6iRKX8oVsAU= X-Received: by 2002:a05:6512:2348:b0:4fb:94fd:6465 with SMTP id p8-20020a056512234800b004fb94fd6465mr9652271lfu.15.1691495020747; Tue, 08 Aug 2023 04:43:40 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:40 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:35 +0200 Subject: [PATCH v3 04/10] interconnect: qcom: icc-rpm: Check for node-specific rate coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-4-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=2718; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=V3/dsciTVIDrck+uRJI5qEMHITJaBEaelfYfVi/Pbmk=; b=HzD0DwK1CveDCoCgBnvGmh7+X1ivvay4l7unb30p+mPYrxkVVbvissbWZwoX5Pypq/qvJ59A/ 2ftrhv03XzzAe0Vr0MkSGOjDXXchkt5u8Xwlk2Sm2i6KwTywyuIt62V 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,URIBL_BLOCKED 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: 1773691882375414463 X-GMAIL-MSGID: 1773691882375414463 Some nodes may have different coefficients than the general values for bus they're attached to. Check for that and use them if present. See [1], [2] for reference. [1] https://github.com/sonyxperiadev/kernel/commit/7456d9779af9ad6bb9c7ee6f33d5c5a8d3648e24 [2] https://github.com/artem/android_kernel_sony_msm8996/commit/bf7a8985dcaf0eab5bc2562d2d6775e7e29c0f30 Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 14 ++++++++++---- drivers/interconnect/qcom/icc-rpm.h | 5 +++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 1d3af4e9ead8..9c40314e03b5 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -300,14 +300,14 @@ static u64 qcom_icc_calc_rate(struct qcom_icc_provider *qp, struct qcom_icc_node else agg_avg_rate = qn->sum_avg[ctx]; - if (qp->ab_coeff) { - agg_avg_rate = agg_avg_rate * qp->ab_coeff; + if (qn->ab_coeff) { + agg_avg_rate = agg_avg_rate * qn->ab_coeff; agg_avg_rate = div_u64(agg_avg_rate, 100); } - if (qp->ib_coeff) { + if (qn->ib_coeff) { agg_peak_rate = qn->max_peak[ctx] * 100; - agg_peak_rate = div_u64(qn->max_peak[ctx], qp->ib_coeff); + agg_peak_rate = div_u64(qn->max_peak[ctx], qn->ib_coeff); } else { agg_peak_rate = qn->max_peak[ctx]; } @@ -563,6 +563,12 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < num_nodes; i++) { size_t j; + if (!qnodes[i]->ab_coeff) + qnodes[i]->ab_coeff = qp->ab_coeff; + + if (!qnodes[i]->ib_coeff) + qnodes[i]->ib_coeff = qp->ib_coeff; + node = icc_node_create(qnodes[i]->id); if (IS_ERR(node)) { ret = PTR_ERR(node); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index f9ef16f570be..4abf99ce2690 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,8 @@ 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[QCOM_SMD_RPM_STATE_NUM]; }; From patchwork Tue Aug 8 11:43:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2281314vqr; Tue, 8 Aug 2023 10:32:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEI1eLfLeFaRTPlAVUe10+AeGexwbNMT7Ar1UeMpLczNjXusikLAJviu2WODydTnPUylq2R X-Received: by 2002:a05:6402:1a53:b0:521:7ab6:b95d with SMTP id bf19-20020a0564021a5300b005217ab6b95dmr426946edb.29.1691515954741; Tue, 08 Aug 2023 10:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691515954; cv=none; d=google.com; s=arc-20160816; b=JecPZiRVD61GEhM6lKYCk18CXtXcBc0OJeGTZFPxeK+5zAs9zXLnOgsTc1k7H8899Y r+bf3hKflzlxxZ8bEfxp1YJm4gK0HHB7YVPOWM4Z94KgQf8VLQqJmHEGQ7xd1SROcgut KbeF52IlNC8ikMhphtPcdMhZaH4CjAqqWBST56IY4GLS0Zj9/pNu2c07Oh314MAxLyA/ NNUJdW415JtTDM99tJF5ycwwUdwFxJUKJEbV2r8VdjkS/Rg61ZeRDjkHNmdpy82zjfy3 r2Re6EVEvwX+T8lfPwSr92Yl9qDjA3SZZF4+VdOLO9XvxYM+hS134QXZiVDnrBjdwykc +nRA== 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=gCx8RlEOFx8UDQtGNW/6cgXaxJHTs4rAU1l6hTQLDFk=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=gh44KHYazNHivoRwIqyBU9sPQT8aNPwskl0G7lrjKH97KWsVX8po2uQ4MleiHfncpq tWfQXF4Tj32wLDSdBOgNnRDkSvudrh648tsW3LZam6guwiAGp+ImebxJ/TETkWLu+0bt KUd+XkC0Oo6FX+MmRt2T9q+U8IWiZBxeot7yGEQP8CnO6i+UCrqavDMDfIdr+X+KE/J4 ElEHGkfn8/wHJYAYaZPcZfyCfMf6esQiM9cCxFGgIp1vQQgSrpMNdhvUiE5/fC+79Oa6 GINl96swIGejDwRpTDLNVB8Zr/tja9nEQqvO2Fdbh9EYTsvdLec9EvQ/UpAUpRdLtwyt ekYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FTmSYdVA; 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 l23-20020a056402125700b0052247666986si7945528edw.434.2023.08.08.10.32.11; Tue, 08 Aug 2023 10:32:34 -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=FTmSYdVA; 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 S234118AbjHHRPP (ORCPT + 99 others); Tue, 8 Aug 2023 13:15:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234123AbjHHROf (ORCPT ); Tue, 8 Aug 2023 13:14:35 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34392718 for ; Tue, 8 Aug 2023 09:06:03 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-99bf8e5ab39so865713566b.2 for ; Tue, 08 Aug 2023 09:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691510762; x=1692115562; 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=gCx8RlEOFx8UDQtGNW/6cgXaxJHTs4rAU1l6hTQLDFk=; b=FTmSYdVA9TWOG/QXugmuOOGtZshAt+cwiRPNjpjpBhtNUE2YH7DLctBwkCU9N42G5I zOFNGlSkADItptIisJsOSWOXBLnNwfdnjGSxuU07U+nM8pFgImUr+QKcsIzRUZn9XIj2 RhyOYdtqcA5iTL8vtirwGcIU99VsOTMTLL5b70009C3WzuUCQb11cE5Ax30nxFT8XYZx bQ6lkCCYgzeFkaWt4haSJxoaJ3XV8RkYarQ3qlgPAs9ElZoQcj8WGsvknFSwysbxzdWe V9qV1viKZg1gvylvvLmbdjz6eMok841QTefo9DDxXfsNcdMnwfnBP07DrfmcVJsbAEtY oOHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691510762; x=1692115562; 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=gCx8RlEOFx8UDQtGNW/6cgXaxJHTs4rAU1l6hTQLDFk=; b=juSSSvuMZcx3iUUz8yGBpRUOZubiaLXsVdP1JHvbp2y3rEBhEoPnDVWjxuDzDp/kAU jmXFM6wtTz6RFNgYKRo2VxXT4X55vceLH1WZvz2JF0HzYGgFb9QHSxhBRmmKgr2PQypV bsgUqvzBJmULVw36UErs7hctlzEBA1zBLX6BipHGM/ylQAn5tnJ3Ywj/59Fn9Zp5Jn8x aWX9tlUAG13dDcQLsBypIIGQzs44h0tNnLs5ObrBIfSDTBG8D0YbLWRtQv7P3M1gpbAQ JPzH/zOWa0w8ErhWKB/F1ozl76BWiH1h0IDYLA6B+X6CGeItCImnxSjK33A9dwFN9Xb7 Bz1Q== X-Gm-Message-State: AOJu0Yx3/gpGieeVBRCaZe9gD/dIobish1a8Y+hE0b4RjXj/NdGzxEJK J77FGKAd24R86d3uFee24PxxnWSpaV/4npkdAN4= X-Received: by 2002:a05:6512:2e4:b0:4fe:cca:c6f7 with SMTP id m4-20020a05651202e400b004fe0ccac6f7mr7807040lfq.48.1691495022052; Tue, 08 Aug 2023 04:43:42 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:41 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:36 +0200 Subject: [PATCH v3 05/10] interconnect: qcom: qcm2290: Hook up MAS_APPS_PROC's bus clock MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-5-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=2342; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=baltAV4RoHwcQRz0/eW44USFJNd7n+E9JFHsU6Sjt+4=; b=MAN7N0prQn1s1uUMDQ6ZtSNXTmx17gJ/z3RFDO/h4V4WTWklSZf/hJxh+ULsHiD442q2RovQ8 KHxzAyUUWgKBUDESPgVueFeDu76mSu4J0AXSNzBnfLgjMfDWMV8ZgAD 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,URIBL_BLOCKED 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: 1773683034144011709 X-GMAIL-MSGID: 1773683034144011709 This single node has its own clock which seems to be responsible for transactions between CPUSS (CPU + some stuff) and the GNOC. See [1] for reference. Define it and hook it up. [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/02f8c342b23c20a5cf967df649814be37a08227c%5E%21/#F0 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 4abf99ce2690..a13768cfd231 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 Tue Aug 8 11:43:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2323725vqr; Tue, 8 Aug 2023 11:45:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHAqDO864KTkbgaRUZKFhaTbGCGmQ1r4rpgbDqdTnEdJKytV/GKHmDr32IgPDEs+buBQ9h X-Received: by 2002:a05:6a20:430a:b0:131:c760:2a0b with SMTP id h10-20020a056a20430a00b00131c7602a0bmr451805pzk.52.1691520318801; Tue, 08 Aug 2023 11:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691520318; cv=none; d=google.com; s=arc-20160816; b=Acf0R41eVpw3oZni9ljbp8ice4fUnBk/8tLkTXl9dvnglbYsPk/GQVXxNPDqIVD5K3 cRJYPEyHdSJubAdPXvxOJcRGYfDo8iFANFFeNRcPwx+ySaKMhx0f3/ifYmN1VTpjpWYn cY93Wc6HByv5SBNHAOSCkMWVcklMUv9TeOlbLMu1UqkLloky8e1VmWcS0Tv5dxYyP5xV ZxJoTSa7VS1Cv7txfQuy/Y8u9fJHIx6JHjO0Noo1TVJuYZLvwHfmD2Z2EPWRXCN7OzmX AnjpLGLa4x+z1orCf9QAiTHydEMer1eo886hGB6BnvFm8IpXBF0hekjJZCYcpFcEfIyA yoEQ== 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=BpTMm6KrWF3+BdRTtZRaB131MkUcqxt5qwB/9AWGCrdo7Cs7mbte5dhoquy0mJQ3dZ MN2QC0deVxgCPB4ajyZcVGalDOXOCn3GQgYm/RpdH/RPzawwb4AEe4KeTmKVbjTzVh/F yc4zAHFPOuoTQ+CSow04QMKEiiCe3D956Oa+1PKb7rUb/+Yx/clUzUrxRIF1KrdZJAFH Tba9tM7mo/66svlFVnWaYV0dMNKrDhxpB5CQ91IWXDN3I7x9MnPVfd65pO/Mm0KklNPT 3MfJF1lftGH/Yy4kHh4NwkT/gZNiYJUCh9gEDuoRb7aQYoyhR4xckjJA1smok43Myv8U HSPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="So/t9V1O"; 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 s71-20020a632c4a000000b00543a6cc74bfsi7468320pgs.634.2023.08.08.11.45.05; Tue, 08 Aug 2023 11:45:18 -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="So/t9V1O"; 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 S234572AbjHHSH2 (ORCPT + 99 others); Tue, 8 Aug 2023 14:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbjHHSHA (ORCPT ); Tue, 8 Aug 2023 14:07:00 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E52461B07 for ; Tue, 8 Aug 2023 10:07:23 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-99c10ba30afso9960266b.1 for ; Tue, 08 Aug 2023 10:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691514442; x=1692119242; 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=So/t9V1O2PcMl59BBf5TOIyRhC4Fmn+Ed4evyj3xPnjkPxA0gBueRwyPFECmGuZA9Q zMrtWdLaDBxwdTRoUkvcEz/W/F+alKS0Powxjn3867A+XUYQy2y2m8lCjUthbpPhezqe f8lMm8FqROUoaqiAzMBdsNe6WNVyI14ZSc2k+V0RGRmj9dT8El/P8XgwBa9m1KsuJH9g 8JhA7YDdtNdXzkWWoGBtCaFqxWtCTQYHtW7Am+xmio2C0uSL6DCPIrHA3QKe09lCTeEQ psNhMGT+mSIOGNVlxEjYsT5U5QY7ujGwPEVOsNmFxCVBdI798P70KK3YfJr4V42JVuvn krIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691514442; x=1692119242; 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=DDqeDThpsqzsFhun/EP+BJDmuMc2H1Yc7M3ad7jEdle31f5i+R9FXWLoLscfJZ8/sH /SHEhu8/WzvjS6VOFAbleRE4dg/Tfi2+D1vJ7+qGNywNCpGrCPXVaNsFu0Mvid5uNd3r aFi2O/XRxBSXipswjtqr6NpCW/8EPsH2Qy7CnsWhWlUyxFCN/a6rgPJLFJAHSS+Mt/9O oNmsA4TZt0AKEJIdHUtvVDQ6a3TN6FkagTLHrsM0YHdrL4yedYu+O5haGpEK5rW7wYud K8Rl8ljGQcYIoXp38zOgoCXuSg8wQmO41reHTvZsL5KmYVdcERp1dHY2WHpcq3zMjurh e+5w== X-Gm-Message-State: AOJu0YzMkND+51kY/Z2rmTj1udm6jZBbabQJx5sjq47wdnR8Ek6yzftD rUJaU8VJtuqDBwMp7WeWr/eLq9ScOiCz/tUtC58= X-Received: by 2002:a05:6512:159c:b0:4fe:8be:6065 with SMTP id bp28-20020a056512159c00b004fe08be6065mr3416540lfb.5.1691495023110; Tue, 08 Aug 2023 04:43:43 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:42 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:37 +0200 Subject: [PATCH v3 06/10] interconnect: qcom: qcm2290: Set AB coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-6-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=1336; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=gKAcxl1xTWi9i07xf8cB7oRhF8MPHDTJc+D4hon02Tw=; b=/bhzfzY1MtFGMTp+JULsYOGnTOJIwGJE49F01H2p/MlyJ9JEx0rnCkANXo4at1X8Tkomohnvh OqvdFmQjUgZBW8klOIAOfgdxaBhjsxg6abuLyt5iCorjdgBVtxRUJaA 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,URIBL_BLOCKED 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: 1773687609631259196 X-GMAIL-MSGID: 1773687609631259196 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 Tue Aug 8 11:43:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2331105vqr; Tue, 8 Aug 2023 12:00:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfivMxC6YAhHXxnrv+Vi03fN5T2L1IufPEw6LxXNbV8trjPT3SwmKDVYXfx2iCt9cxQfDK X-Received: by 2002:a17:906:311a:b0:994:673:8af6 with SMTP id 26-20020a170906311a00b0099406738af6mr419801ejx.29.1691521219787; Tue, 08 Aug 2023 12:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691521219; cv=none; d=google.com; s=arc-20160816; b=HHIVPv6gPfencZZ7+5A0xV6SkdcOitUPTN4SHpK+HqTDWudH99l1ZY/DNZtsdtE5lP yRVEhkXJFlFOAUsT5wJ3bzx0WZsE7eSGfoH6N0WGYWaat6mg4eMqCYZdtTO7IOvSrnIC GK1TVkULXjoEmobsbiNwjKD4T2bM5Ql03xcf10v1BLDsU9183Fqz1FfwLq+512bKKJLK saTLZquqLFmHm2m32vJwmUhFOgM+Pk5XyzMDN9BwCrLIpol5UHPshaAr9qdNuFYHUT3u XrdycRjRkFVm9zNoHsTrnFzX3uFnx6c8rnFlFnZiXA8v/GY29MtYlKqC99pMUYODrHOW 06CA== 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=T6ap3YiI681TkcHRiROGi/vTjKOQRh02kxg4n4fpa5+vKa5gcDAo5LAMRncuznGOmt 2GUGS2k/Vs5olI2mNMR2asuh3jUCgpCcdKRauXdK9mY3vupBqnWv8tGNupUmjv/U/5Uu KEUqmY/iWWMqh9BBjgnFeJOyOwa/ahR7t2yPwoHBnN00XK9qDoif0AocCawz6Jl1bM5x h4ZXrencoaawHBpT6J1E6zb2Ihk09YCFPIfKVS0uOm8fdqnHsJw0tdD10ZaZ4TEoMFRq R8IfERTGZUr4i3dplzcxO1x5SlqChK4kntnZ/7BcJHs29ToE0tM7RDhKfmYoGyYEsfFk 3ZWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fjea7EtZ; 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 lj3-20020a170906f9c300b009930740da67si226226ejb.380.2023.08.08.11.59.54; Tue, 08 Aug 2023 12:00:19 -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=Fjea7EtZ; 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 S231221AbjHHP6K (ORCPT + 99 others); Tue, 8 Aug 2023 11:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjHHP4k (ORCPT ); Tue, 8 Aug 2023 11:56:40 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CBA95BA7 for ; Tue, 8 Aug 2023 08:43:52 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fe2d218eedso49954985e9.0 for ; Tue, 08 Aug 2023 08:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691509422; x=1692114222; 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=Fjea7EtZ9j6mwiBEJIh8dIzRayTrHDSDSkYIP4tWikM+frpABlM+s1OYyAbI+FpXde CEeyGaGNio7xt+D48BUvVgbkwO5kwCblj8rRpuWQh+xo2wPgHbQ6Epan2AEVRGn5vYR0 +A3/YiKMrb6l9PHiRLPdN047iggzEOB/WRu1sO7urXgiAT5OfwprAAYr3fxDqSmGZZvw c3vt42xl6kxtUfE7xFR+1kp/nHZu9ugyxAGtRWAqEkyakoakfaVC2WUEEO6xkCu8qNRl 9t4pRwjWS+kCVkD0ghSSROhM98btzEu/tENlldPI3LnPNGdxakadlLgCGIWEDj+zdgyE e9fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691509422; x=1692114222; 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=aV1NN/kBOKrYSCXsT75c8toBiCKLTciorykQVuJ4zshIMJqnZCO8DQ1y2o1ncuZZF/ y5tZyFeUELHTMQfk3QPMNcfIDvV9Oql41ktrqp7V1p8H/Wd+rIGH+vkKoXQEH4map2C1 sa5NKXuOey7GThDpAouTfMd0rHPB9050iY+LrGCVNxn2ZAYE8luKOA30tRbMx1eIMHPp jw128QTV5Vyi1IxIIhnN9G8J1lUnkSSibWqAXNQV8EK9uv4EQ3iT4gaM3MT9WJD9zcHD 7IJwGmgI8MmgOKYUGvkyXTJTYzzzzC35XnuzrCLmv+V4CMNMG0xDH5oH4WZ7My/My1KG nToA== X-Gm-Message-State: AOJu0Yzy5fn+0ne23gnoGk9+txG/EuMIpylkLXGDZEmDXkPDTmFsRsNm DyzBxueUMd6MQkYuTJRjZBxwlKo4vNz8UFjMocM= X-Received: by 2002:a05:6512:1598:b0:4fb:8bea:f5f6 with SMTP id bp24-20020a056512159800b004fb8beaf5f6mr10188044lfb.34.1691495024243; Tue, 08 Aug 2023 04:43:44 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:43 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:38 +0200 Subject: [PATCH v3 07/10] interconnect: qcom: qcm2290: Update EBI channel configuration MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-7-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=1320; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=+JCeGo0Q7sjfDzWjkGg+7ykqgtb42uWuVVMLb5STXRI=; b=kP/Ep84xH1Hu5VyTi/X5EdDQntTJIZBSHWF06vlxwCDpZi0bIpkqQ5Da38SWKULLxX6Ar2wu5 ZB0IYGCkYwDBC4GBGBIEMmpmnalm/DCz4COpfhANKRfGNaIkAba4j/2 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,URIBL_BLOCKED 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: 1773688554490325935 X-GMAIL-MSGID: 1773688554490325935 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 Tue Aug 8 11:43:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2362854vqr; Tue, 8 Aug 2023 13:00:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9HZNjSEPaHxo5+ztK80MTNkjF5DCeEj5OIOPU1MyE1Bjs7VHdSWnIl8RwYJRvUGu2MT71 X-Received: by 2002:a05:6808:23c7:b0:3a7:b011:8960 with SMTP id bq7-20020a05680823c700b003a7b0118960mr928566oib.40.1691524843346; Tue, 08 Aug 2023 13:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691524843; cv=none; d=google.com; s=arc-20160816; b=tkN5Xvqae2QYtk//yHqJp21hwqzcC79xo0VJU1T0IEW7g7a/HUThu2DwienN49yFYr oealWJzuRQVlpKWvVenSZ4+RfWJ3fgU0j7b/xUlhljjSyZzaLragGuuPjGkOLVSX9Dci 8opnCzWPntlDDf5OW9rPu01F09/RzLP7RN7FgyUJrBwaS1MCCn5nLRhLrKPBtoxWUrga Kp34xccCWZvzRjKWcPsRPNAQzLRNlq+1Rb670qlrYxP1WoJm2l7UHOFHxlO6uJYIXq5w AFtk0vUEg8O4obhm+eZTEWdWsQ68qze9mtpBHsL57gvOHZY18H8uWstQKJFJk3/SZt/B 9Ziw== 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=ofXZgZvGCuWlCgcmY8yMpkdl6WzSRRC8Up9y6Azv6VQVVlLF4wNtgpMXfAUMFo24Bb uD4vsb/NuRODqsvGmYX0lQ/tzmqxtwX/VDOjiCW06ZsmcTI8P1kf4ACkmF8qaztRKLTz A6NOH1ADmhdNVE3YxPJFD1FuHusCRPA/UuftmA48ewNh4LOT2gCSzYbXGD59rafZgyl7 Yu7d46pvP7CNmvstAG/ggLDpmV3LSeAhQGhVetx4tQy+9BvA4SLs3nTsm2G4PhseOLYR qsWbIBm+HB/Kpe7MLSdCWKRpZbGchY2uiC8aPKjZmgbEorceCswTDMuPNVLz4hYWJQLh SsqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nfnx+IZd; 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 12-20020a63154c000000b00563df304ec1si7350415pgv.664.2023.08.08.13.00.29; Tue, 08 Aug 2023 13:00:43 -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=Nfnx+IZd; 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 S235645AbjHHSYr (ORCPT + 99 others); Tue, 8 Aug 2023 14:24:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235663AbjHHSYT (ORCPT ); Tue, 8 Aug 2023 14:24:19 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFDE32272E for ; Tue, 8 Aug 2023 10:36:20 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-99bdf08860dso19391166b.0 for ; Tue, 08 Aug 2023 10:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691516179; x=1692120979; 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=Nfnx+IZdw+3GEAy2sWkFszWMwvtpQ6WQBQHLJpV6spV/Y6cuMajuTxkjjV25HwD4pI gJI1Of/bQtLVJAThNsG1mBHxxg6FMJgvnFP9LLun9aL4WaxrOMRNDDO/jTnCI6nOZEOT FWLBbqMC7fHqYRBqFNEAknxme92YwghhA9doS72Ft81uFZaaZxG3TQyaZEm6etEfpQtw gdwqqWiyFKvBOie/BWJAAQ4wFiHijUAhlyEcM/Tr6MEqRgS+n8vjcpjzGBppo2xxg9Be 8aDsN1O1cLMOoPjmCm2oeaHeQFK17vny6/7zkXz2wj7WVF0yjC7juZFpKxP4aia4gl7l K2lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691516179; x=1692120979; 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=ag+JURN4sKl6plaq9G16xGoZG8u4nG2kN5Uo0BpmIHpTw2YgCnGmNzHpnud5v+0q9K sc1f0Ir8fIrptx6nNoVdKyefxqQN5fq4JA+RqPhbZc/ZwvKC1/oZz0Pt5RB0Y7LkuwwP lY6pTWHCm1fn5SRgOCi+2XHUCqT1/bsKW6ylYJ2n4Gc+r+ZivNrHOdWIqWEHSRZVn8RI G6JlWwXQPwn4Vqfyoj4OSdYRt6BQfuCLATXKdLKOdaruRw2kdqaqr6iiNqmHGNuFaJvJ EqJ27sxcdBReFJk3Rlbp4dNPmue0eJvQ1JNkjrFGKQC09chEfdNAVI8LlLeeLulA9Mts KHkQ== X-Gm-Message-State: AOJu0Yzoib/bmXMol5JLHlWA0t9VdpLEtEJKtywXqRaahqj/Iz0vdyoU YPVLOxeSg0M7k9pt2MyELGm/CFtrAvhqiH6Nprw= X-Received: by 2002:a05:6512:32a4:b0:4fb:fdf1:8b25 with SMTP id q4-20020a05651232a400b004fbfdf18b25mr3031231lfe.24.1691495025312; Tue, 08 Aug 2023 04:43:45 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:44 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:39 +0200 Subject: [PATCH v3 08/10] interconnect: qcom: sdm660: Set AB/IB coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-8-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=1519; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EjLG3n/q4YI8bbEqplfHVOwV0syrmI4lAF1qcHGTJvw=; b=EnNVF/Cr9uzLzEU4BBg3kNfteX8HGav2OxqYe3b702ezBcqQnBiKJXPeKjEEqpkCP0IXg0ZPZ 0Il6GgQVQ25CyjPK0/MyGHqxPxzBT36JDWPV8X6rvNGRMAfLmNFuhLu 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,URIBL_BLOCKED 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: 1773692354149430736 X-GMAIL-MSGID: 1773692354149430736 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 Tue Aug 8 11:43:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2414360vqr; Tue, 8 Aug 2023 14:50:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFePF7jh6Pg7ge5hT7LAGlYo38mZ5HjeCGXOCACfM6VWjvWwups+yRmqvniLPtpWGFTbqBL X-Received: by 2002:a17:90a:d384:b0:263:9661:a35c with SMTP id q4-20020a17090ad38400b002639661a35cmr663623pju.8.1691531424410; Tue, 08 Aug 2023 14:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691531424; cv=none; d=google.com; s=arc-20160816; b=TSrOhPR/IgC8CtJJXqDGEY2r1GgWW091PHeHxCwbo/346zayX/FvHxPnsNTjb8NNN9 3QN/fpeqvPrnHiv8nFXD4lrqPuoVwcWUHKGXcjgSNVS6na90iOLK2RbTgvs+w0D3VDvV 1EyX6OU2YYExb1Gz1wjoTwXHx//jv4TbHOUhYBsquPzm9fAZ5DTqVELyiUhYb38Gg3Sz Utm56NlK/X1aJNJs95HtHznb18flhAATDUdmjDDVmmcyHMSSYqhsC13OFbe2DS2EsDxw OH9pCh+hkTEIEB6+g01ytWT4KiTzSME5kLOD54jFPvsjGM/+NYNRW0wDmUvH3mr2ne6k YIFQ== 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=JZrhbIUBpTt+lhoWxRWgqxUFIS+OLSUKnCPvssu52rDt8+W0Ut7RtW5TdtjJisC9Cg IcpkniPQ92rMNLs213xIIPpme/IkbYj6Du+qDT3YlHNVL9VQaJ4I/NMUJ0n3xyaISeq3 v73MWQojh+rBhHeSHtOHp6F3tgI76lVXJcMJf7+aRaC/NvyxEgQcdN9eKC2R+cvbhkUj nWbs5aVqqBqQz8WfIgZ86RlWm+PZBMOb+kqu2P2qAwrYssQkzhgwTo6ou14YrPhHvT/e BTRl996TJICA94R1N7HMV5Q28NmCtbr/BHHOh+fIJA6pg/17d5EYyz3oSzFRPVIRDqOQ iCiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r0z+PRLt; 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 pi4-20020a17090b1e4400b002680dba282csi24683pjb.182.2023.08.08.14.50.11; Tue, 08 Aug 2023 14:50:24 -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=r0z+PRLt; 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 S235107AbjHHRvr (ORCPT + 99 others); Tue, 8 Aug 2023 13:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231256AbjHHRvJ (ORCPT ); Tue, 8 Aug 2023 13:51:09 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1BAB5E80 for ; Tue, 8 Aug 2023 09:22:54 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fe2d218eedso50315625e9.0 for ; Tue, 08 Aug 2023 09:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691511755; x=1692116555; 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=r0z+PRLt0/zbirxy25Qkewfrp4xsC6480ww6wEuyuWau5XeYgVOkvz5mtAUHQ42MSV wTx9HJo9d6ee7r0Jz8wqkChRRoe5BQqvabD/0ZpDb6DZmL2mEkKspe+MLgWNjGM8XO1z xJPf/ZJPu0e88bF/xdbmmmlRQHzAQdk8zwJmOBNen8tXokpmiUmgNue9exX45cbiNtxI oBr1GV+hpp98/aQmnWX3WX9VAAVuwoVf7KJP26LErtkD1vH1C4XA4aEQL4ZqyMRKqVaJ 1pyGt9bsuYcDAzIPD1oSdFQ6EUt7IBFnOjbjlByDUInfstTEHVGmx0BPxru11DI1qGSW 3kxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691511755; x=1692116555; 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=OqTLLvohen50ngUVIaRIW2OEioKqnY+KxApKAFCpS4oviqmRwfCyqNmaIHzmqzi9rp frZ0L7ZBxisFkfnnDlKWWAjQrQGJI6rzAzUdgckPgAt6mhs3w/J+EAGQnS0YQhtGcBlD 5rZLVY2kX9HsYoWhpHoeRccZ3AhdXJqdoRfvFzYPwLvLiZYM2c25BegzQ/jbVYqR13D2 /bfpRakySxkfEfBJVvfnWkP5T/z7UQlf89K7gR5xFBQ+KETwF1gn4LHARV1gg5XRiBCC GIkYyik0g7dq+i4TNQCvCQpXz0FbzuPyWKBlPPKmbPFBXZlB0uCNlAPpMMXFYZIY/Fg7 gOlw== X-Gm-Message-State: AOJu0YwwGWla4TwUPrNXnOPSuU23R/goxs0ZHKyQe9bEJCfdHgOmQPLy alPpoUHRkx0GogOakTnI3oUCvu7sZ1ivvuj8d7k= X-Received: by 2002:a05:6512:10d2:b0:4fd:d538:b97b with SMTP id k18-20020a05651210d200b004fdd538b97bmr9355921lfg.29.1691495026441; Tue, 08 Aug 2023 04:43:46 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:46 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:40 +0200 Subject: [PATCH v3 09/10] interconnect: qcom: msm8996: Set AB/IB coefficients MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-9-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=1682; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6Ylk54qLtCUKuTX9FA4QTRZGSUqgBkVW+4oTAnkFbFA=; b=G6C3tehG5i+wpYLksQeibNa9TcRRryQx2c1C+PbgLjLNinmWth7Kgiq6h+P+yrqSg+hvkS8hs P/WvsN11oQzB97MrKtKeOynWWxsSz6KKpBWsjH96NjyOnz66wttLu7H 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,URIBL_BLOCKED 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: 1773699254871858393 X-GMAIL-MSGID: 1773699254871858393 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 Tue Aug 8 11:43:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 132715 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2326243vqr; Tue, 8 Aug 2023 11:50:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwL4PVMN4nSeFVyKFgSxNPZftxTkDWw/TTIwDlAMQj40w6S1pv4MeBxFaiERfbGhNhVnnT X-Received: by 2002:a05:6a20:7da7:b0:136:ea0e:d23 with SMTP id v39-20020a056a207da700b00136ea0e0d23mr467044pzj.11.1691520625500; Tue, 08 Aug 2023 11:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691520625; cv=none; d=google.com; s=arc-20160816; b=R4wOwWdO0N/wN8+PEo1+t1e92dgUX9T1AMi1C33Nsbn9wh4M+WrCQlydt71MdjbOuI 1drjlIf/W5Wk6OMQfHVRmvYZN1gBOT5ilRcBX3xDIWBsWbR+4x34vO0X7TNHRJ6N3rtk BM5VUhz9VN+gjJ31QVtJVssyLt4CjVl101/HSlq1z4Qa2LYwNyGtNpc8TWOXjfVz7yX0 9JNkCvWAamMT3gQFTCFKraq2KVyBSXxP9jcdAhL6oRsIsmfVBDB3FIPNc6hjuIw0TXeb rK8qkTA1vxpRzNMVqk8VkJwLURX2l4QzAHXLGlM23C75o5BGj0IYskwmyeJmaPllFSrk ahFg== 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=WLgWmZDXI+7PA/tCxKdChP7EEm6HakzsKLLishyTPzU=; fh=eQYZoDkT5yiXC4FOuYG6Kem76e5j3IG0APJeW7cmDrc=; b=CvGGOueSmOqH8uY/clqIsG+low/CmSIGCkUkQGxkBkxf/vi76FoWDH5tRd0kniviia xWFWkrNtIehaPMJKpg/XkQ+mxwir2gaS++gbF7G17NZ61XB4gLs42dwoDE58xGJAXDGM kYYI81Qz3gMwy9QWAqCiotyyWQUwwwX6eoQ+Bfh0/gVmMh32YzD8p0VRIJBNa8cX26xd wXQomLqG/piT5K4xCb+Y93rf6/1S99uXt/kZChOLCv2DsgaDnzUWJ3sJvQMzspH5Qt2W JX2RbRU7fO0zmaKF+LapvDlhH8kZlfWS7HuL/s2ouQD9iGsbp7YkRnYGVY83n7bdwn3U a9OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BHG3zKtY; 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 cq8-20020a056a00330800b00687346d94c4si7491181pfb.334.2023.08.08.11.50.12; Tue, 08 Aug 2023 11:50:25 -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=BHG3zKtY; 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 S233227AbjHHQju (ORCPT + 99 others); Tue, 8 Aug 2023 12:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjHHQjM (ORCPT ); Tue, 8 Aug 2023 12:39:12 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD9215583 for ; Tue, 8 Aug 2023 08:54:15 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-98377c5d53eso805728966b.0 for ; Tue, 08 Aug 2023 08:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691510045; x=1692114845; 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=WLgWmZDXI+7PA/tCxKdChP7EEm6HakzsKLLishyTPzU=; b=BHG3zKtYKHDAbybsewWSfTo0jjBTCVS4qtIwYEdxhalRy1wAf930aHvJDE92ffDiJ4 Bps8PlRXjUBww/jEnboWkx8XB4KQA3tFDZXyzMp9C+q/41Ri5GP4EB02N/Za0YetcNrU IFCOIl7i5WJxd46yqwRVShcqaF4gd/CosMa1pTqHAbMEoaiqzckzcaev55kQ3sqNboFh JQ1WiPcIRsH66UVxmlxmQ+2zCDZscP5LbcUuzPXcZRIp+12LJO+FPyqg1BUrulsybxiN 7NQDwRzS5cLcw5zUiwhpiDgUTCisbYflVmw2bw/LpW/N4JCkzY4oeUk/kXZP60ynqLKs 6tjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691510045; x=1692114845; 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=WLgWmZDXI+7PA/tCxKdChP7EEm6HakzsKLLishyTPzU=; b=ZICQPzNrawv85p+3e8z7Fm4GWsKYQgGAMhBDao7koPkhDvJmhogCWAXKOQxqA1aZBk /12TDeDRRa1k79mA6STIz6FyhaC5vroA9/rAtlDMMsS4s2LnJNmPTuIgSnbF+k/Ho1hh tQreHIcVGfgJ4pCeZ0kXXzduEjYZSilBPKBUixJzzjWOUdNehpxa6eVh8qjPcESUeCtW zlxWVFWP3Wz+UG3idR+n6QCpZk0GLMl7cVNyxaeHbIfy8+MGVyXzPLhsFAsqm7+kuvlX De/J1DGgzbt9KHDjggjADKB0EIpSng4UG4APFNmGeE1S+k7F0EFlqj9d507/Ta7ZqqPd 0kYg== X-Gm-Message-State: AOJu0YxLSR2f5HfbGjHXPok146AxR+bUYK97k251yEIRpTC6hrorl7F2 yDKWdkbQNojBNfKc4LOXXoBXEJEFfIpiCECroio= X-Received: by 2002:a05:6512:1185:b0:4fe:45ca:f8e7 with SMTP id g5-20020a056512118500b004fe45caf8e7mr7216190lfr.57.1691495028083; Tue, 08 Aug 2023 04:43:48 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id j20-20020ac253b4000000b004fbdba4b075sm1861679lfh.57.2023.08.08.04.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 04:43:47 -0700 (PDT) From: Konrad Dybcio Date: Tue, 08 Aug 2023 13:43:41 +0200 Subject: [PATCH v3 10/10] clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect MIME-Version: 1.0 Message-Id: <20230726-topic-icc_coeff-v3-10-dee684d6cdd2@linaro.org> References: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@linaro.org> In-Reply-To: <20230726-topic-icc_coeff-v3-0-dee684d6cdd2@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=1691495013; l=1855; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6rZrHWsPHWWpd+L+pVqcUMQuVU01TmS5LCQGYAT1X0Q=; b=jtBpHrfD+ymd4XqtHtbF/noRNPMY58C9Ej/e6oBO74GRvFvp0xnbWwQis4SQSnKJbpvuAezcV O1Vfy8GohTlAwg/NRNh5jnTxAmB6T34tNgUqWUBA1EdFDKu7EABgkpv 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,URIBL_BLOCKED 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: 1773687931385971972 X-GMAIL-MSGID: 1773687931385971972 As it turns out, it's yet another interconnect bus clock. Move it there. See [1] for reference. [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/02f8c342b23c20a5cf967df649814be37a08227c%5E%21/#F0 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[] = {