From patchwork Fri Feb 17 10:46:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816627wrn; Fri, 17 Feb 2023 02:47:36 -0800 (PST) X-Google-Smtp-Source: AK7set+aJil+mknK/i5kQmWUU4u0SYVufHUzE6iGhs0NDMkY8JzJudVupeZQZ7+yux14iFVfVpIR X-Received: by 2002:a05:6a20:144c:b0:a2:c3b0:f637 with SMTP id a12-20020a056a20144c00b000a2c3b0f637mr144176pzi.26.1676630856537; Fri, 17 Feb 2023 02:47:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630856; cv=none; d=google.com; s=arc-20160816; b=eeVWHEjynjaUg3miZTmDPIbdkalBRssUzMFGYSm2L0ZcpKJMO8PexbtwZwgnuz94A2 RYKEK98FSey/kj5OjNGl6fykSrum1g4mfWHPGPwAJTBtRpxCo66ilRF6dlhGJ5kiXT60 0eAp4tdPMv3/Yn2ejNcg7tWKK4x1+VwB/MtQrM1SLycoruUefVWj/m5vuJhT+RFx6iwl RIiPmPdhLbeHrCscqCdqzMXGuRijGN1p9WuDmMEfGPkqKuzWOJ28S85yutwmatj3KjnN 4/ROj8vWz2tNOGTvniCOsvYWEFHa3MqoqYMfUmb8iLEDCXzhDX/dOAKfyD4GjZCizlVr TEKA== 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=x2YOWjcFWDSCJRKhThoreWlOz8b57o2c2Tr6FolnlTU=; b=DVeY+AY9oHOWg77vCWGZuoCfVQ0m4nD4B8MKQvlJ4ZlvzN8zFZak0BUBqYDvhb+WSt zqi3MdlWaGbG99ASfXck+ufeK2qtoW/PCxWg3+kl2x0Xn8WZd/pwFHD723dT8G8zOgoz M8o9FPUmRWIEo/uJm6gE+Oo6zsrn2HMQmTIJ4UCINZWmqVdgFrp4GVeyJwYAkXCQuK1+ AsLKv+M+9Lttx5imhLoHxlXmVsXG+3LZjwvcNuaHdaPNr6swL0tiSZEHd8Igv0C3BNyz NWQZ8GJCcmUUSFFdc9xEUwFawi6AgtkyxSXFL+sNfQRUXBZwC3u1xODW6UZhgjbwRUMn S+xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AM4e3Dmw; 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 k5-20020a6555c5000000b004d21beccd9esi4516138pgs.498.2023.02.17.02.47.23; Fri, 17 Feb 2023 02:47:36 -0800 (PST) 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=AM4e3Dmw; 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 S229918AbjBQKqk (ORCPT + 99 others); Fri, 17 Feb 2023 05:46:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjBQKqh (ORCPT ); Fri, 17 Feb 2023 05:46:37 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 890AD6359A for ; Fri, 17 Feb 2023 02:46:35 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id z18so1329086lfd.0 for ; Fri, 17 Feb 2023 02:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=x2YOWjcFWDSCJRKhThoreWlOz8b57o2c2Tr6FolnlTU=; b=AM4e3DmweDpeDr8ruXbKbiVj8XWXKpU5flwVYy/YhpnO000xRVs6X6yK7AbbNwlioF St5R9Iy4zjrCjw6bxBCfIiWIHg0NDzDZdWbXcPAQ1mL/gOSXLo8rme4RA9OvfW6j831f LGeuUtipI1WM9uQ/Y+PRLfAke37IDkyxg6Avukc3W+yFy5NUmtadfRmXwRT0iUHXl8Wc +ZapnwvGshKcIueUz9LVEB+xOZ9hwA1CLCcKMSqfuFudkNHcSzgxf3RP7R8EHH7rtUW2 02UvvznH78j9EIFatZSkV9lpII0vRNJeWimgYi3HctuVCZVYzm3nMnnJViL6MiQcpSyG PvBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=x2YOWjcFWDSCJRKhThoreWlOz8b57o2c2Tr6FolnlTU=; b=jH+xVMHOwDs2d26D97UPGL+5iXils2on0h04WTXRvSA1pMwe14pQehExlsILnD8F3K Skwbj14DWrh8nPY9RQAbtA53HEQG1wC/uWrAiSijdcbrxF8y8/47dEZkM052BWVzTBkH yYNGnFmX35Rx1ppwwTWpdGzdskr83wumGFublbnyxRO4NQti9UK8hfm9HHqUfDbczUHh bHomj3ucW8d5Fk4rxVh9R+zykGz1B+pJXOiwh4PdhJ4Q/j9d6U19s8QZtGhta5R+dleF eQAEoF2psa5iAgzaIh1pxRNPAbXv/27iuVjfDELCxHCFk8sMjmlwzLBvj4IP3mteM02S 3meA== X-Gm-Message-State: AO0yUKVgukG0rASTzu0t4Yf7cJTrKUhZwxcWGG7Yh+XOOmBIkIACYNxz 8YX0Vhffp2sw1EsFrhu/Uyp0LQ== X-Received: by 2002:ac2:551c:0:b0:4d8:6255:265f with SMTP id j28-20020ac2551c000000b004d86255265fmr273340lfk.20.1676630793936; Fri, 17 Feb 2023 02:46:33 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:33 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:22 +0100 Subject: [PATCH v5 01/10] interconnect: qcom: rpm: make QoS INVALID default, separate out driver data MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-1-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=4821; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=fW0/q7Y4jn5JjCXEuz/icnbq3YzHFaKCGchWxIjH/5g=; b=bt6O8yFpjiliV9Zv1OUdqyf7xnDMzvo5ML+awQqSYLp1ox69/UDILp79tKZRQVLGLIksa1r0umto SjEjjpxyDZS6Im456TbIQ+6OXQE3YaiYsKwBfon71vp8nK9cdXwR 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074876669959155?= X-GMAIL-MSGID: =?utf-8?q?1758074876669959155?= Currently, NOC_QOS_MODE_FIXED is defined as 0x0, which makes it the "default" option (as that's what uninitialized members of partially initialized structs are set to), which should really have been NOC_QOS_MODE_INVALID, and that's what people (wrongly) assumed was the case when .qos.qos_mode was not defined and what really makes the most sense.. That resulted in {port 0, prio 0, areq_prio 0, urg_fwd = false, rpm-voted} QoS being always voted for, because the code flow assumed "hey, it's fixed QoS, so let's just roll with whatever parameters are set" [again, set by partial struct initialization, as these fields were left unfilled by the developers]. That is of course incorrect, and on many of these platforms port 0 is MAS_APPS_PROC, which 9/10 times is supposed to be handled by the ap_owned path, not to mention the rest of the parameters may differ. Arguably, the APPS node is the most important one, next to EBI0.. The modes are defined as preprocessor constants. They are not used anywhere outside the driver or sent to any remote processor outside qcom_icc_set_noc_qos(), which is easily worked around. Separate the type specified in driver data from the value sent to msmbus. Make the former an enum for better mainainability. This is an implicit fix for every SMD RPM ICC driver that didn't explicitly specify NOC_QOS_MODE_INVALID on non-AP_owned nodes that don't have QoS settings. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Fixes: 6c6fe5d3dc5e ("interconnect: qcom: Add MSM8939 interconnect provider driver") Fixes: 4e60a9568dc6 ("interconnect: qcom: add msm8974 driver") Fixes: 7add937f5222 ("interconnect: qcom: Add MSM8996 interconnect provider driver") Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 24 +++++++++++++----------- drivers/interconnect/qcom/icc-rpm.h | 10 ++++++---- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index df3196f72536..ffbeeca8c2b0 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -48,6 +48,9 @@ #define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000)) #define NOC_QOS_MODEn_MASK 0x3 +#define NOC_QOS_MODE_FIXED_VAL 0x0 +#define NOC_QOS_MODE_BYPASS_VAL 0x2 + static int qcom_icc_set_qnoc_qos(struct icc_node *src, u64 max_bw) { struct icc_provider *provider = src->provider; @@ -153,7 +156,7 @@ static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) struct qcom_icc_provider *qp; struct qcom_icc_node *qn; struct icc_provider *provider; - u32 mode = NOC_QOS_MODE_BYPASS; + u32 mode = NOC_QOS_MODE_BYPASS_VAL; int rc = 0; qn = src->data; @@ -167,18 +170,17 @@ static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) return 0; } - if (qn->qos.qos_mode != NOC_QOS_MODE_INVALID) - mode = qn->qos.qos_mode; - - if (mode == NOC_QOS_MODE_FIXED) { - dev_dbg(src->provider->dev, "NoC QoS: %s: Set Fixed mode\n", - qn->name); + if (qn->qos.qos_mode == NOC_QOS_MODE_FIXED) { + dev_dbg(src->provider->dev, "NoC QoS: %s: Set Fixed mode\n", qn->name); + mode = NOC_QOS_MODE_FIXED_VAL; rc = qcom_icc_noc_set_qos_priority(qp, &qn->qos); if (rc) return rc; - } else if (mode == NOC_QOS_MODE_BYPASS) { - dev_dbg(src->provider->dev, "NoC QoS: %s: Set Bypass mode\n", - qn->name); + } else if (qn->qos.qos_mode == NOC_QOS_MODE_BYPASS) { + dev_dbg(src->provider->dev, "NoC QoS: %s: Set Bypass mode\n", qn->name); + mode = NOC_QOS_MODE_BYPASS_VAL; + } else { + /* How did we get here? */ } return regmap_update_bits(qp->regmap, @@ -244,7 +246,7 @@ static int __qcom_icc_set(struct icc_node *n, struct qcom_icc_node *qn, ret = qcom_icc_rpm_set(qn->mas_rpm_id, qn->slv_rpm_id, sum_bw); if (ret) return ret; - } else if (qn->qos.qos_mode != -1) { + } else if (qn->qos.qos_mode != NOC_QOS_MODE_INVALID) { /* set bandwidth directly from the AP */ ret = qcom_icc_qos_set(n, sum_bw); if (ret) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index a49af844ab13..8ba1918d7997 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -97,10 +97,12 @@ struct qcom_icc_desc { unsigned int qos_offset; }; -/* Valid for both NoC and BIMC */ -#define NOC_QOS_MODE_INVALID -1 -#define NOC_QOS_MODE_FIXED 0x0 -#define NOC_QOS_MODE_BYPASS 0x2 +/* Valid for all bus types */ +enum qos_mode { + NOC_QOS_MODE_INVALID = 0, + NOC_QOS_MODE_FIXED, + NOC_QOS_MODE_BYPASS, +}; int qnoc_probe(struct platform_device *pdev); int qnoc_remove(struct platform_device *pdev); From patchwork Fri Feb 17 10:46:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816654wrn; Fri, 17 Feb 2023 02:47:41 -0800 (PST) X-Google-Smtp-Source: AK7set/GhJAdpNIhk94oLNgCpJhm38UWPRBnFqNeLq/uGqZewkvfLz2veqSkPJrOuwey3hd/5t9B X-Received: by 2002:a17:902:e84a:b0:19a:a267:f16c with SMTP id t10-20020a170902e84a00b0019aa267f16cmr12885967plg.31.1676630861225; Fri, 17 Feb 2023 02:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630861; cv=none; d=google.com; s=arc-20160816; b=nDKe5TbDFpeEaFRmFH2ddXStbADRlE2ywrw4tNUM2sgjvqhF485nFNZXvCHgkfxPIP H+enOKpx4qaZfTNDNOE4+Zfl3qtCkdd/jT4Vv8TPn9F0JPpDO4Ry7t6AgWtf+2LPIl6m dN4cVNssMhiLybeLVMpsNyZnJDbIcgx9EOdCOT/aLaTfjn+9VmH8paCcArMmueSj0aSK lJKHVxLBAM/2KP6PlTknnwXiwzIcfUiX7kxVOIwQpe7nkrH9eXXffh575WLgVqjkRBY1 mBZwxC0AR2wscjmwTrrUvRUehu2RnEoqza1tlYmhTohxL3E7plr2WRX6i34G1Ed4WESx +UJw== 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=6rjG/3ow1ZOTG1eHHIqytTbppYsh/DRQVP8JWOKWwcE=; b=n8uz7ztXVgRBfwis65EVZLeNwEy7ztkylpeQHRFnYxiVMWBgfTPdpf5lgidMP/wP45 m4b5Kz7Bjpk3bzaZgpcDyj3kPUg+7b2i+EDaqqsQjgt+sOgDJFH5hhwMffmxnfj8JyQk Kf6/88IykuZnnlB1dInK5264jTDUTPBZsxMEEIhlufbW69FioXVyDK5njwhnMYBoRURa xfinWmuz+OB35bZo31j9VGl4eTJ1Sh/wcXleEJfSNl/TTfTEv2+qORv1b7/FcxHQmWHx 2a4quQIvdFb7DbHvx1xY4sJerd9QcLZI5K91o244uE7sdNDxiQxX98J0mausCkNqfh2k PQZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DHtsw9VB; 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 p2-20020a170902780200b0019ac36d3fbdsi3933670pll.98.2023.02.17.02.47.28; Fri, 17 Feb 2023 02:47:41 -0800 (PST) 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=DHtsw9VB; 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 S229759AbjBQKqo (ORCPT + 99 others); Fri, 17 Feb 2023 05:46:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbjBQKqj (ORCPT ); Fri, 17 Feb 2023 05:46:39 -0500 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 40443635A6 for ; Fri, 17 Feb 2023 02:46:37 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id p19so1039507lfr.9 for ; Fri, 17 Feb 2023 02:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=6rjG/3ow1ZOTG1eHHIqytTbppYsh/DRQVP8JWOKWwcE=; b=DHtsw9VBjVWeKrjyOHza14P3gG53yefORmaq1x059bl8olMt8wLzAz4KOH+bWWqpCa Hj0NjEZjaZwWwVdYWO5ffFgphidabkXcHrOROJSuHXP9YPDGBGTV8tnw6/f2250rqWKS TVzDlRL8Ogo96tZqTMPu1H40Gmv8t4ZgAozl8UWeE07ZyGMgeROznsTQYRirWDb+6bNB 83VyPK4r4RRfddzBgIIoXUD0gG/7RXK1JK12AHhtiCq4HDTD2oIvYrKoVGEX1YJinleN nBJrvSmNv/yb0rVQb2cbh1qHkRwZEikEcPO7/PzaIx+qptIqtG3+f5YxGvWejVjCvWVP ADow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6rjG/3ow1ZOTG1eHHIqytTbppYsh/DRQVP8JWOKWwcE=; b=pszt0etTAZVDZ7Npg4Q4KdMo8xHtzaaGcH1605m9M0uRzFzQIybp6T9zj+4zKHNVtS pa7GH2FY1oUWs29llL11vIGkHk0vRjUxw1AyrA01w2a938i2yxzKOHhtuqi2eoJhuZZi C7g264xpoe6e9fME0AqxwiWLw5SNOKZ38eIBsYLnXE7UGBzpOhPhjDqoaRK17DlOs6Te /gNn2yGS2/WDrewgzpSFcYDMDWLWPuSvkLOUolgAs3oQKB0PVqy5sVFoFQqZtOSeTfei 4NUHRBosI1EzYN0uhko+Sw6kPI81GP8tDMAUkKmhpJZQtWGOSKloLvdwRxZFGhjOSjrU 4xVA== X-Gm-Message-State: AO0yUKVaJQTiGmspDD4HfQEBqKYlJV3W10n01JFx2DTTlseuNL9OLXsZ DEtn54+Fu5e9Bv3eYEwuD6HvtA== X-Received: by 2002:ac2:4474:0:b0:4db:25f0:a159 with SMTP id y20-20020ac24474000000b004db25f0a159mr94874lfl.51.1676630795521; Fri, 17 Feb 2023 02:46:35 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:35 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:23 +0100 Subject: [PATCH v5 02/10] interconnect: qcom: rpm: Add support for specifying channel num MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-2-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=2390; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=owy+HTbDiqD53bbeRzW7lMPyKDJvsQwv0VsM/tqOHBQ=; b=0wO3Kb2K2bNGrwgjHl+MB1VQsq1MjB8wGaF78Q/vMoe0wPvHb6brtdYreCFZmdJJzbIiqktjBaHP 0gnspTheC6/VF6pZ1rKlrLh+NcxWRKpNnF8d8gldzkL3cbKQXlZr 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074881718144072?= X-GMAIL-MSGID: =?utf-8?q?1758074881718144072?= Some nodes, like EBI0 (DDR) or L3/LLCC, may be connected over more than one channel. This should be taken into account in bandwidth calcualtion, as we're supposed to feed msmbus with the per-channel bandwidth. Add support for specifying that and use it during bandwidth aggregation. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 7 ++++++- drivers/interconnect/qcom/icc-rpm.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index ffbeeca8c2b0..6bd20f62f8ed 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -317,6 +317,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, { struct icc_node *node; struct qcom_icc_node *qn; + u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; int i; /* Initialise aggregate values */ @@ -334,7 +335,11 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, list_for_each_entry(node, &provider->nodes, node_list) { qn = node->data; for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { - agg_avg[i] += qn->sum_avg[i]; + if (qn->channels) + sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels); + else + sum_avg[i] = qn->sum_avg[i]; + agg_avg[i] += sum_avg[i]; agg_peak[i] = max_t(u64, agg_peak[i], qn->max_peak[i]); } } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 8ba1918d7997..8aed5400afda 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -66,6 +66,7 @@ struct qcom_icc_qos { * @id: a unique node identifier * @links: an array of nodes where we can go next while traversing * @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) * @sum_avg: current sum aggregate value of all avg bw requests * @max_peak: current max aggregate value of all peak bw requests @@ -78,6 +79,7 @@ struct qcom_icc_node { u16 id; const u16 *links; u16 num_links; + u16 channels; u16 buswidth; u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; u64 max_peak[QCOM_ICC_NUM_BUCKETS]; From patchwork Fri Feb 17 10:46:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816760wrn; Fri, 17 Feb 2023 02:47:57 -0800 (PST) X-Google-Smtp-Source: AK7set/2NgTUzMUAgCcgGOA6IkHlJi4OAikuBqoumU3X3plOVG2CBZIJdYEvO06cHtmDH7+C7ffW X-Received: by 2002:a17:906:4e90:b0:8a5:8620:575 with SMTP id v16-20020a1709064e9000b008a586200575mr668809eju.3.1676630877697; Fri, 17 Feb 2023 02:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630877; cv=none; d=google.com; s=arc-20160816; b=DL2FsY0mgqU3ftkNT90z80/c2aYy0YKzFKO/LshCcu3qxmoRdv4E+Z5MNzL7ZALjA3 Gq+rxy/loy785aOUfMthoPYTZ3a/V43psb8O+JjU+Eur/dRyBhJR2sO8W2CpNzIMRDoj sMvfvBfctlhzldRjRvj1d3cFDN2B1Ej0lgkjlmy5Id8LIvp963BzGzxJR8CUy/li2dSV USGzjWcJJSLeAO/812ndn5Nq95Fqz/XtiKgLb2HRKSV/QWBxEEus/ATfVLAbcHvfZNjX pFZSYp1WLChNFX23cJHkPHhOoLxQuvuZUf6XJ4/N5iO2YpqaM1vO1nPAdRlAZdNGgP4/ dVzQ== 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=M1ChaGpjQwwb81za9r3ksbVLIpw4MoGpa0RPeBLjHFc=; b=aSyZY2f/IbTCbhre/J2XB/wM3qfybM/IOUYBCjDW8Au7gg9WZJ4qmacGfDai5E+22h vVfbZviy6/zieDXJ2foHh31T5NwwXJS1l3yxgeVknSRtqxfnu6QMoKVuJtVI1Su/qH9n W9rlmqKD5gJvYUNo3T5SMD70eoqaqGMLPLAwdANBer3OvNAQsJxtzoSEZ0XvATMUDg26 ktUDTeKnbCInHEdFdO1KtJODq8kgQW6/X6qYlGrJO+1VMNGKTNdgfNI8fBnEmEV7a/xd F0OVYJ/7QtYsT/92kt4O/OhNsSIUdAoI+2seZAFlqpXGWJAOKM/bO+mU2SBm4+Yu47if ZOfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gMeQQgAn; 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 p13-20020a170907910d00b008b1381b7699si4627563ejq.422.2023.02.17.02.47.34; Fri, 17 Feb 2023 02:47:57 -0800 (PST) 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=gMeQQgAn; 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 S229852AbjBQKqs (ORCPT + 99 others); Fri, 17 Feb 2023 05:46:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbjBQKqj (ORCPT ); Fri, 17 Feb 2023 05:46:39 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AA12635AF for ; Fri, 17 Feb 2023 02:46:38 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id g16so1203106lfv.4 for ; Fri, 17 Feb 2023 02:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=M1ChaGpjQwwb81za9r3ksbVLIpw4MoGpa0RPeBLjHFc=; b=gMeQQgAnk1atn0rL6BryiTB78nsooMdcYRikoqKGpBVATtiJr7yjwgWFR7EX5DpTL1 WJ4S3MNL1wQCeAUPLq5qQm/SlT1RIvj37WwqHQ+zbBAQyX71vSAKhQk6lalqAWyVXhrH QGEI4imlsDcq8aeTsyI6hKolSzSZSYIrQ/746SZLZuLlaqXPNjprKEO/0ceUkaZffZXZ yPmKRJ+S4PEX354pZ50X6cZQ+QI666njircV8ZyinGuCelgABPO3t9AYAJKxF3mSJstA ksAeuDE+CkCgkc2Gl7Ws/yJGWK1yjs1hkWXL6tQdvSXfTakhtfyQDhRsVA6gu2F5JFXK CBhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=M1ChaGpjQwwb81za9r3ksbVLIpw4MoGpa0RPeBLjHFc=; b=L3b2pPQ9KCJxoSfLdW9/fHP/0EKbBXPfc1eYMBqvq0Q0D5TpHeEM9PpPP0y0xrsfqz +nBBd32jLbFOwWokjtlYNcQYn/cKbxdsvWjmMWRVKG3N0YRVwuN7MDmVB/XNtESP+ksx O4ejLRSaTRVN4RhrZH9gTG1OMcdiB6jQ3hfkDSxO9LywPb0tRMRUzCvmaChRpwOq5fEw p0mbOdg0zPYVjjxl1T4fezk5KB6BbPhEYSwjKilEYJM1LrzQHzdhll7LUFeeEqqMBGoX +w9yk65b5GvlUbVx1zck4HMfShQ3YYyW0Kx0QGAz8y6/pieEbn1nIXsmVtzuNaTLmRNL AdZA== X-Gm-Message-State: AO0yUKU+7eLWMblLX2sN47sBqsrwk2WLs7mZ/Tf+7uf+A3XP5R3gbefK d/WXjUJuE4SkcO5XFXoQO7zh3w== X-Received: by 2002:ac2:4352:0:b0:4b6:eaed:f18f with SMTP id o18-20020ac24352000000b004b6eaedf18fmr2875944lfl.38.1676630796758; Fri, 17 Feb 2023 02:46:36 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:36 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:24 +0100 Subject: [PATCH v5 03/10] interconnect: qcom: Sort kerneldoc entries MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-3-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=1082; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XFgUKc3AlZgnfCuw55xIk05sTMPQPjx7/I9LSefm9vw=; b=YKLLA28lh4MPb/UwnFbrn6LQ6RglPbnUhRasB1hdlK+lzAcmpZ+MsXq7QEMrAmDAY4HOFa7h1sB2 HRIZ6fvHCJ/wVt375KFfUx9Qr+AfjjVXWiVvZkxjC8jHOIynMTUn 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074898973783516?= X-GMAIL-MSGID: =?utf-8?q?1758074898973783516?= Sort the kerneldoc entries the same way the struct members are sorted. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 8aed5400afda..21f440beda86 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -23,12 +23,12 @@ enum qcom_icc_type { /** * struct qcom_icc_provider - Qualcomm specific interconnect provider * @provider: generic interconnect provider - * @bus_clks: the clk_bulk_data table of bus clocks * @num_clks: the total number of clk_bulk_data entries * @type: the ICC provider type - * @qos_offset: offset to QoS registers * @regmap: regmap for QoS registers read/write access + * @qos_offset: offset to QoS registers * @bus_clk_rate: bus clock rate in Hz + * @bus_clks: the clk_bulk_data table of bus clocks */ struct qcom_icc_provider { struct icc_provider provider; From patchwork Fri Feb 17 10:46:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816933wrn; Fri, 17 Feb 2023 02:48:26 -0800 (PST) X-Google-Smtp-Source: AK7set/nXaDmzf7zm04S5qyqTY45In7W92upoOeHJQWDf7YkFMuNATw9nRBGhUdAD+fDJOE6xwrk X-Received: by 2002:a17:903:2349:b0:19b:fa9:678b with SMTP id c9-20020a170903234900b0019b0fa9678bmr3461207plh.40.1676630906475; Fri, 17 Feb 2023 02:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630906; cv=none; d=google.com; s=arc-20160816; b=rIQ7BDmRalhWFrXbkKxdETgw/IXGc4sZDGQFf0yNVrSclArAQZ11iDjHfjzqAFDDwX gMp1dMskH16isf50Icr+4vZpi0X6OZuEff0NEcBnbYxuL1C80m4P+YYKmCOAC8GfjYCk vbPTjbuC8aqUkc6eYMEGFhCyv7sNCmhZUvFFMvfu8HyYu0Zz0Ll860cTw/s4xnKhW7Ct lCaFtnkrcm/wpvY2B5SaherTo6+/7r0ns34kj83akIfT/WGoM0Obl6im2++yl8muPjXF peT0gsc6WBKLn0w1P4MZ1FYzTEYAqOqYN2cLiHHqa4jKIP/cFMIDfpUC7D0dWNwhHqEM chIQ== 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=qLCSgPlEFjgrnaf1o9B10/qV2Xw5+RkSuETRk3unQ/4=; b=vVFBqjs6VijsY1v4qy35mRG4yMMGB2WAAq8iGsnonBGQGY/Mu2Q6amKHknMFMKis+X GVDTRomCg/IqMAIfLX7Y5+kwBQf/imEbIMlMD8T33kg6i39KXI1ZzA0/CnpvkCMHWQsZ lqW6uD1AKxmq2+RgwDRDbI2XSocwO0qQKz3yiXjkj2N5qT+Puy07X7dI+7Hdc5gqL33n qW+sNzuMJYLEZrFFb6zM88Q0yaxXEdqn1YuTrrovlLISWDPJdHs3jrJayQHR4HFurLMU jvCXxbFmPG4lLb97+ts3TaX5a0MmNjCZKlDql78gZhg48bDO8Wnarj63U4rWRk3PtNGN jOqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MCExyxiS; 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 n184-20020a6340c1000000b004fb411fd3c6si4909926pga.313.2023.02.17.02.48.13; Fri, 17 Feb 2023 02:48:26 -0800 (PST) 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=MCExyxiS; 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 S229913AbjBQKqv (ORCPT + 99 others); Fri, 17 Feb 2023 05:46:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbjBQKqm (ORCPT ); Fri, 17 Feb 2023 05:46:42 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4486359A for ; Fri, 17 Feb 2023 02:46:39 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id p19so1039609lfr.9 for ; Fri, 17 Feb 2023 02:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=qLCSgPlEFjgrnaf1o9B10/qV2Xw5+RkSuETRk3unQ/4=; b=MCExyxiSG1gl8HJjQzXoEPvnAfJ94qEGQp6fwb0a/6rl9f2QbBulvO3OJLcnmHN7hl 5Q1MU0gAOX/D2rJdFzYlEm4kDFLmblFKUMt9GpjCeeap7LnV7DiAfpiJhxKg8DuX8rZk 7Q+IT2AYH7J1c8/gG1JS5DgNAEzFnlr6gErMEiqXpcPdXnKQ+TH0jn78MSgRhHNJ7hNd zvKO/aSxj0pwrrGl6ETaF2NSBuRtyo2pMe/VfBLuvxcSfsOqFMoKFHb3XTWJgKu9vQsB 7ysvEIM3fnXZzVsnfEmO5iB9HNq5HzO8FoZt2dogXtS/nr5VzSTKnAmPWJ5gzd+VwkGW Zqcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=qLCSgPlEFjgrnaf1o9B10/qV2Xw5+RkSuETRk3unQ/4=; b=BVpAOp5KV8ulW+oX/na8f7BKBaWVtsHF3ghqAOnup0vXvK0QwDQBTmssVFgQCvrdcN RT2nBlniwSxx2QQOKwnZQ0UoyOEQlbzhRwa7pQ5TgKFwndwdrx9gwEuYHyTi/quzaBJp TxXJ9kAtNvZlp+/JePk+qts8fQIAA5MN0yqa9WUjivJeL2BDslvJ2/83P91XUr7/aB05 yj8JVzQrN52p8tlhHjpP0Up4U2UTLkdITuChmFQJze9NjJatWDfoEEqcDK7nf/2HgoWR 374gzfQ7rzcYkxswK+B5UtHc/OXoS3YVJt2pg+9Vaw6y88dnhdA0sUbg2RefjjD4IDUR rIww== X-Gm-Message-State: AO0yUKUwFho9cclNQwhFtMCvEvK1oAgbU6P3ntKNy2CUi0qQAvq2oXH2 16vK6TJRSejIxGo5ULL9Y4fklw== X-Received: by 2002:ac2:5a08:0:b0:4cd:47e:47a8 with SMTP id q8-20020ac25a08000000b004cd047e47a8mr2446726lfn.54.1676630798088; Fri, 17 Feb 2023 02:46:38 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:37 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:25 +0100 Subject: [PATCH v5 04/10] interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-4-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=4029; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=W+rSE1tUqQ1jgJBwxZdgMZwUhzhi1tVhw5LTiCFdq1A=; b=cP57bevX69D3xJcTCI6REx2841cKvWgloLCGHxzurRCsAzYiLn9wKB3EOQF62O8xE6KHGN7yFA2L gdX/+YZ1Dk/jgw3XCPSK+s9aRxda3flgzGuzPv83+7vQBLHTEE5r 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074929567253710?= X-GMAIL-MSGID: =?utf-8?q?1758074929567253710?= Rename the "clocks" (and _names) fields of qcom_icc_desc to "bus_clocks" in preparation for introducing handling of clocks that need to be enabled but not voted on with aggregate frequency. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 6 +++--- drivers/interconnect/qcom/icc-rpm.h | 4 ++-- drivers/interconnect/qcom/msm8996.c | 12 ++++++------ drivers/interconnect/qcom/sdm660.c | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 6bd20f62f8ed..7a54fe4ccadd 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -441,9 +441,9 @@ int qnoc_probe(struct platform_device *pdev) qnodes = desc->nodes; num_nodes = desc->num_nodes; - if (desc->num_clocks) { - cds = desc->clocks; - cd_num = desc->num_clocks; + if (desc->num_bus_clocks) { + cds = desc->bus_clocks; + cd_num = desc->num_bus_clocks; } else { cds = bus_clocks; cd_num = ARRAY_SIZE(bus_clocks); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 21f440beda86..d6b4c56bf02c 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -91,8 +91,8 @@ struct qcom_icc_node { struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; - const char * const *clocks; - size_t num_clocks; + const char * const *bus_clocks; + size_t num_bus_clocks; bool has_bus_pd; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 25a1a32bc611..69fc50a6fa5c 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1821,8 +1821,8 @@ static const struct qcom_icc_desc msm8996_a0noc = { .type = QCOM_ICC_NOC, .nodes = a0noc_nodes, .num_nodes = ARRAY_SIZE(a0noc_nodes), - .clocks = bus_a0noc_clocks, - .num_clocks = ARRAY_SIZE(bus_a0noc_clocks), + .bus_clocks = bus_a0noc_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_a0noc_clocks), .has_bus_pd = true, .regmap_cfg = &msm8996_a0noc_regmap_config }; @@ -1866,8 +1866,8 @@ static const struct qcom_icc_desc msm8996_a2noc = { .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), - .clocks = bus_a2noc_clocks, - .num_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .bus_clocks = bus_a2noc_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config }; @@ -2005,8 +2005,8 @@ static const struct qcom_icc_desc msm8996_mnoc = { .type = QCOM_ICC_NOC, .nodes = mnoc_nodes, .num_nodes = ARRAY_SIZE(mnoc_nodes), - .clocks = bus_mm_clocks, - .num_clocks = ARRAY_SIZE(bus_mm_clocks), + .bus_clocks = bus_mm_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), .regmap_cfg = &msm8996_mnoc_regmap_config }; diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 8d879b0bcabc..a22ba821efbf 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1516,8 +1516,8 @@ static const struct qcom_icc_desc sdm660_a2noc = { .type = QCOM_ICC_NOC, .nodes = sdm660_a2noc_nodes, .num_nodes = ARRAY_SIZE(sdm660_a2noc_nodes), - .clocks = bus_a2noc_clocks, - .num_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .bus_clocks = bus_a2noc_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), .regmap_cfg = &sdm660_a2noc_regmap_config, }; @@ -1659,8 +1659,8 @@ static const struct qcom_icc_desc sdm660_mnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_mnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_mnoc_nodes), - .clocks = bus_mm_clocks, - .num_clocks = ARRAY_SIZE(bus_mm_clocks), + .bus_clocks = bus_mm_clocks, + .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, }; From patchwork Fri Feb 17 10:46:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816762wrn; Fri, 17 Feb 2023 02:47:58 -0800 (PST) X-Google-Smtp-Source: AK7set9x8uG/4qroZkTza8uTW6YkEIWDzaFBiVhue8gsDaE4T1RE16iJkbsGQOd84K2TNvZG3Ryj X-Received: by 2002:a05:6a20:7f9b:b0:bf:58d1:ce92 with SMTP id d27-20020a056a207f9b00b000bf58d1ce92mr7073153pzj.17.1676630878301; Fri, 17 Feb 2023 02:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630878; cv=none; d=google.com; s=arc-20160816; b=cNeF9EN6Dt8KB0gdYINBUq2mpEiWRTw551wNE6vepDk+q0QpP9RzTIR9uKOCLSiZkn mFm+k7njcmxlFzkCOQdUx5MRqNm74SQTmQ4oGkIoIbybbSiPXq9afR+zdY/T4M1Cb4EF pVePFJ2b5ocZrXsoZUrVhw5yogVztVEb5vwoLdZKr2pK8fbTPqVtYxX+DhDDuuC3nXF7 R6VUR4n6h3HgznWda1xl1YeRt4T9SnA6cMeKKEu/pT4X1JQvf9ufnNbFXvEtrp0j96K1 HIsu6NflOikVWYKWL0l8msK8AFFTMZFXem47d8uEmBpRITMICQWQsQO1ZVaJLvoNvJpy 9+Pw== 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=2MZKW1luAupXiDdvhAWR5OgDUlxdbyScvUfNLPjc4eQ=; b=MCGNe7fDocPv0q8Tx3c53PVXQOXnB7g+yeLmaaL1H7zn3DXjIM3XGdomb3MX5y3VnS R41bBwetmZchbMVILl1jVvY+ToSqdRTTFrwbKHFztcM6OPChrOiUZCbhB9wqCKGUeL7x lwIfAvgaJAxd/MN/cek4UFs+J1DaCFYGDgPccFaKnKk9jWXTlQFoKD7NijvaKqhpsIqC xpqQT4LHzLeKjJ/g7gQUHsYxlZMyyjDuD1aYrWPECEXdO//EYuTMHxgtwArR7CCx6k5r jdeVMjxvpnpVZBevzpSCCpw2+M93287lJg9HGqsZiq42ZB9edQWanqXfN/Fhx9i6a20S T0Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kmd5DPUw; 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 f10-20020a63de0a000000b004770fe95989si4531708pgg.496.2023.02.17.02.47.45; Fri, 17 Feb 2023 02:47:58 -0800 (PST) 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=Kmd5DPUw; 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 S229971AbjBQKqx (ORCPT + 99 others); Fri, 17 Feb 2023 05:46:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbjBQKqo (ORCPT ); Fri, 17 Feb 2023 05:46:44 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 527AD635B1 for ; Fri, 17 Feb 2023 02:46:41 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id x4so911163lfq.2 for ; Fri, 17 Feb 2023 02:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=2MZKW1luAupXiDdvhAWR5OgDUlxdbyScvUfNLPjc4eQ=; b=Kmd5DPUwzulEC48gA6ic9WdlkQ/hNGjg4WdrrToQ29CqDM4JGKxmh49g9WlEAbrhDj Wz94fjSyHw5Qhh+6Y7nG4gV5wUCg6qjls8ZBzHJwBvsNMs5tsLeWN3oAl8juIGoC649a 0t1ncEVnlsoOYPP3J3F8gJAbA0kwYixnTWxX/U1tv16W7HKqHZsamgOsCcRRqGkzYwRb tiz17l6G05COkM+GKA3kTut+glzFqh2jwGx4z8jHpOYmG1Ng8QyzyPLiTr9mXWK+CcVL bJQag8Wbp9gwppXpUMEzWAdG3rVgfFxyJr8cHMNTbgibfsrAlRiZLdprjCHfe78HyWZ5 XQRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=2MZKW1luAupXiDdvhAWR5OgDUlxdbyScvUfNLPjc4eQ=; b=o3DqOxfOBKuH2hjVLeMzgbELRjPySBCu/gCclyylAP4PTtuzDLiOjMfKRZuAiEL3ps n2FflRw39I8iWIuflK9OjVlg/xnakK9z9jqjZ9nI35/XXxf+eBT0MsBWCjDAkb0FR98D EHd00TkYeSJAvy3NDPTKTeA2xMDNo2+kNS4/StHYEZ0Rdxs/12H6HKY+qsKqNP+pS0bo zX2yEcU9Y92nLSmAQ3RXPJRbxgCysd3n87gBa6/KF7WPbyb+b3efgS1yigUphbN9dBVx /hDtEha/3RhqNuH6zuwayFu3VpYbxUCAVdoifs58zCSBZcTeCNOP3BwENE0rUh0Y12RH iH4w== X-Gm-Message-State: AO0yUKVuhsEEq1C4iBxIDFhS9f7I7fjp5gufAF1C/v7nJKd2Jbs8KRNv ZdmijpUXLz0XqaUkT68SyWjEQA== X-Received: by 2002:ac2:5490:0:b0:4d8:7502:990b with SMTP id t16-20020ac25490000000b004d87502990bmr2392639lfk.64.1676630799341; Fri, 17 Feb 2023 02:46:39 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:39 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:26 +0100 Subject: [PATCH v5 05/10] interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-5-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=3438; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=aiMG32ahJtopvSpAYtuicAveB020UtGpy7a97D0jQ6M=; b=bWToGfiDHGkY4wV++Fm8DJyFVJXVAqKTWMe4CRzPQiX0tbrooaFBNY90Md8IuQT1y38MLHRAasdo Teug8/NwDZ62faBCvlpyzJf6IxVIB4gsXbqNztewiYUvXpF9HxE8 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074899813254398?= X-GMAIL-MSGID: =?utf-8?q?1758074899813254398?= In preparation for handling non-scaling clocks that we still have to enable, rename num_clocks to more descriptive num_bus_clocks. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 14 +++++++------- drivers/interconnect/qcom/icc-rpm.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 7a54fe4ccadd..f78c13e6c5ce 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -380,7 +380,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) return ret; } - for (i = 0; i < qp->num_clks; i++) { + for (i = 0; i < qp->num_bus_clks; i++) { /* * Use WAKE bucket for active clock, otherwise, use SLEEP bucket * for other clocks. If a platform doesn't set interconnect @@ -465,7 +465,7 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < cd_num; i++) qp->bus_clks[i].id = cds[i]; - qp->num_clks = cd_num; + qp->num_bus_clks = cd_num; qp->type = desc->type; qp->qos_offset = desc->qos_offset; @@ -495,11 +495,11 @@ int qnoc_probe(struct platform_device *pdev) } regmap_done: - ret = devm_clk_bulk_get_optional(dev, qp->num_clks, qp->bus_clks); + ret = devm_clk_bulk_get_optional(dev, qp->num_bus_clks, qp->bus_clks); if (ret) return ret; - ret = clk_bulk_prepare_enable(qp->num_clks, qp->bus_clks); + ret = clk_bulk_prepare_enable(qp->num_bus_clks, qp->bus_clks); if (ret) return ret; @@ -521,7 +521,7 @@ int qnoc_probe(struct platform_device *pdev) ret = icc_provider_add(provider); if (ret) { dev_err(dev, "error adding interconnect provider: %d\n", ret); - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); return ret; } @@ -554,7 +554,7 @@ int qnoc_probe(struct platform_device *pdev) return 0; err: icc_nodes_remove(provider); - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); icc_provider_del(provider); return ret; @@ -566,7 +566,7 @@ int qnoc_remove(struct platform_device *pdev) struct qcom_icc_provider *qp = platform_get_drvdata(pdev); icc_nodes_remove(&qp->provider); - clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); + clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); icc_provider_del(&qp->provider); return 0; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index d6b4c56bf02c..d4401f35f6d2 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -23,7 +23,7 @@ enum qcom_icc_type { /** * struct qcom_icc_provider - Qualcomm specific interconnect provider * @provider: generic interconnect provider - * @num_clks: the total number of clk_bulk_data entries + * @num_bus_clks: the total number of bus_clks clk_bulk_data entries * @type: the ICC provider type * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers @@ -32,7 +32,7 @@ enum qcom_icc_type { */ struct qcom_icc_provider { struct icc_provider provider; - int num_clks; + int num_bus_clks; enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; From patchwork Fri Feb 17 10:46:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp817018wrn; Fri, 17 Feb 2023 02:48:41 -0800 (PST) X-Google-Smtp-Source: AK7set9J/qRprcQzbIg1KiCp7Om0E/7cFTrgeo/Fgvj4B93JGN3szABiKITptL7U9XiMvVdj2t74 X-Received: by 2002:a17:902:fa8c:b0:19a:b754:4053 with SMTP id lc12-20020a170902fa8c00b0019ab7544053mr415537plb.26.1676630921561; Fri, 17 Feb 2023 02:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630921; cv=none; d=google.com; s=arc-20160816; b=lo+QEeTqiAxheRWtpgdmZpCroEbG5XeuW59zI/mZzAIMGogoU11amhInpBcl7OyzKa d/hKldojfSNXphdG57DbS7BAVZur3fp17a8A2LD6V7j/39kfZ2IybSOwEOdSDpuZQtBc NjcH8Z/+ViyQ24x+y0IjwaZwsMriTRuV5bnACOUUCcfZA9rAxTjhFsJOxZ4MkJUFaQ1+ DQQ+98q/h/dZDNeUAvY2n06FDXJj4V0dQJI6IU/Hz95frAs7esDBYBSs2xlEZCBepmJr IJiHFiCbewqXKkMiHZ8wotezTpY9Q32/q3RNaufCzkQtwboMQBHNRpeV4IbjMHCJ3OIz 8anQ== 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=3MHWwA73OFZ3bR5+vwT2j4l8Utx4DnHts3Akf3ykMvM=; b=Cmqif1bIu8bx2GItEsY91RNAI7LbmPUmmy41HnYfMqVppCFO4eEBTrfnzwnr5IJF7h zqyJuM34UpyN5DT419lEHraJ94Z766g1GhT5pQawMaUjksVJ8J3p/yKLi61MX5ZtoSoy u5MIIaAMu+Ohd+4mDAEwUNHHrvMzoSUe1Kv1dBvOrnEDJbSjRaWAJ3liF3ivWjhuE+DV r7I1Av82O9QVM34RZGL55kGvpzhT/Xg6VrE6DMPHhgLSSnf2TAeNkVBZUWdGT5v53b+n /PU4YcbHtR2iJlcKhNNNKY2ipiAGKesgEYD6jsVafY66V3QRZYloo2pasvkAaq1MQc6H d5mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fyw4+Y3e; 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 q10-20020a170902c74a00b0019b0b007981si2723989plq.531.2023.02.17.02.48.29; Fri, 17 Feb 2023 02:48:41 -0800 (PST) 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=fyw4+Y3e; 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 S229983AbjBQKq4 (ORCPT + 99 others); Fri, 17 Feb 2023 05:46:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbjBQKqp (ORCPT ); Fri, 17 Feb 2023 05:46:45 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 673EC63BF6 for ; Fri, 17 Feb 2023 02:46:42 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id z10so550523ljq.2 for ; Fri, 17 Feb 2023 02:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=3MHWwA73OFZ3bR5+vwT2j4l8Utx4DnHts3Akf3ykMvM=; b=fyw4+Y3eRRE5bsRDzpmxCSgFPMKgW2p91G/B1LKmextL5NeHfxtCME/byuSNUmtebq jPPAUrP+JNub257PY1pzLOS7hOujW3TnMN8P8MpyKxbnHB5sgdyDRqCjQXdtYTM8PJLh U+T34qgPfR/K0/THAPEM0n5BLlDZ0bPyxVJhbLwT3bPcx2BRBI47GnU+mDwunpibppA5 NkkvbbBKxSzsZoFFHyLDWlMK4HBDqU/e0vwVQ4n19fIAujggfgwh3nF7CchySkrnHpsV CpDruNpaSF16itos68qu47p6JWO16wTnToXWnvxFHGZlcLV6n3zrbEGnVXTo67B7GNKU o9tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3MHWwA73OFZ3bR5+vwT2j4l8Utx4DnHts3Akf3ykMvM=; b=r+8onaFs643Mej99/4NpaklRygGibZElQ7fy+LJKoZBlKYeyHSDTSM/+15+M+DoKtE j/qsoiiEkJMuq90/xk3dERg/MKSdV9YiAL38rmPW0zjadblMlwX036CAGwrnXfmD+klz k97k/ddLX7Y4VYRzUGL7aKApJx+uxL4USiYHvMwdHuPYx4EgZz6rpvLu1l+lI4uUROU1 bxplx6C9FtWfrhklYaAe8ylXjEyJ5Ayc31fXSDMLvggMiDfDFD4JPCxeqp1EfcqfsTOT aSKn+i4N3UYmWlSBxN0aXYiMRE/OosnXdX4QOzgG27P5lV6KUFbB024Hrm5cAlAxMYm4 w0yA== X-Gm-Message-State: AO0yUKUGH6xYWtI54SVfSkH2RdfKhJB+zW2r1vUXbiz+RDvYeGc9QfFc 8CHs2JqoGIktyyvZRqU8yj8T1w== X-Received: by 2002:a2e:b808:0:b0:293:4ae3:a0c4 with SMTP id u8-20020a2eb808000000b002934ae3a0c4mr50038ljo.2.1676630800626; Fri, 17 Feb 2023 02:46:40 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:40 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:27 +0100 Subject: [PATCH v5 06/10] interconnect: qcom: rpm: Handle interface clocks MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-6-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=8870; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=lrK4CgyASlp1FXP4xhjPdSbXvbaRtdChuTXbzfLQdS8=; b=N33qYbmOwCd4yPi9aA4tJuN4kKdJue8femdZMV6wSx3v00aLU1IocY6drY+n3sMr7MqlANxUdZXQ kn9osv54BlaqMSTrRmaoECQxlGNQOyrKgKK2sNzRie2N4IaPdja5 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074945183048998?= X-GMAIL-MSGID: =?utf-8?q?1758074945183048998?= Some (but not all) providers (or their specific nodes) require specific clocks to be turned on before they can be accessed. Failure to ensure that results in a seemingly random system crash (which would usually happen at boot with the interconnect driver built-in), resulting in the platform not booting up properly. Limit the number of bus_clocks to 2 (which is the maximum that SMD RPM interconnect supports anyway) and handle non-scaling clocks separately. Update MSM8996 and SDM660 drivers to make sure they do not regress with this change. This unfortunately has to be done in one patch to prevent either compile errors or broken bisect. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 48 ++++++++++++++++++++++++++++--------- drivers/interconnect/qcom/icc-rpm.h | 10 ++++++-- drivers/interconnect/qcom/msm8996.c | 22 +++++++---------- drivers/interconnect/qcom/sdm660.c | 16 +++++-------- 4 files changed, 60 insertions(+), 36 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index f78c13e6c5ce..1b382a2f2710 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -441,28 +441,43 @@ int qnoc_probe(struct platform_device *pdev) qnodes = desc->nodes; num_nodes = desc->num_nodes; - if (desc->num_bus_clocks) { - cds = desc->bus_clocks; - cd_num = desc->num_bus_clocks; + if (desc->num_intf_clocks) { + cds = desc->intf_clocks; + cd_num = desc->num_intf_clocks; } else { - cds = bus_clocks; - cd_num = ARRAY_SIZE(bus_clocks); + /* 0 intf clocks is perfectly fine */ + cd_num = 0; } - qp = devm_kzalloc(dev, struct_size(qp, bus_clks, cd_num), GFP_KERNEL); + qp = devm_kzalloc(dev, struct_size(qp, intf_clks, cd_num), GFP_KERNEL); if (!qp) return -ENOMEM; - qp->bus_clk_rate = devm_kcalloc(dev, cd_num, sizeof(*qp->bus_clk_rate), - GFP_KERNEL); - if (!qp->bus_clk_rate) - return -ENOMEM; - data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes), GFP_KERNEL); if (!data) return -ENOMEM; + for (i = 0; i < cd_num; i++) + qp->intf_clks[i].id = cds[i]; + qp->num_intf_clks = cd_num; + + if (desc->num_bus_clocks) { + cds = desc->bus_clocks; + cd_num = desc->num_bus_clocks; + } else { + cds = bus_clocks; + cd_num = ARRAY_SIZE(bus_clocks); + } + + /* + * This is not realistic, scaling is only possible with an + * always-active and an active-only clock, or at least one + * of them in some very bizzare cases. + */ + if (WARN_ON(cd_num > 2)) + cd_num = 2; + for (i = 0; i < cd_num; i++) qp->bus_clks[i].id = cds[i]; qp->num_bus_clks = cd_num; @@ -503,6 +518,14 @@ int qnoc_probe(struct platform_device *pdev) if (ret) return ret; + ret = devm_clk_bulk_get(dev, qp->num_intf_clks, qp->intf_clks); + if (ret) + return ret; + + ret = clk_bulk_prepare_enable(qp->num_intf_clks, qp->intf_clks); + if (ret) + return ret; + if (desc->has_bus_pd) { ret = dev_pm_domain_attach(dev, true); if (ret) @@ -521,6 +544,7 @@ int qnoc_probe(struct platform_device *pdev) ret = icc_provider_add(provider); if (ret) { dev_err(dev, "error adding interconnect provider: %d\n", ret); + clk_bulk_disable_unprepare(qp->num_intf_clks, qp->intf_clks); clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); return ret; } @@ -554,6 +578,7 @@ int qnoc_probe(struct platform_device *pdev) return 0; err: icc_nodes_remove(provider); + clk_bulk_disable_unprepare(qp->num_intf_clks, qp->intf_clks); clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); icc_provider_del(provider); @@ -566,6 +591,7 @@ int qnoc_remove(struct platform_device *pdev) struct qcom_icc_provider *qp = platform_get_drvdata(pdev); icc_nodes_remove(&qp->provider); + clk_bulk_disable_unprepare(qp->num_intf_clks, qp->intf_clks); clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); icc_provider_del(&qp->provider); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index d4401f35f6d2..729573f0d9fe 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -24,20 +24,24 @@ enum qcom_icc_type { * struct qcom_icc_provider - Qualcomm specific interconnect provider * @provider: generic interconnect provider * @num_bus_clks: the total number of bus_clks clk_bulk_data entries + * @num_intf_clks: the total number of intf_clks clk_bulk_data entries * @type: the ICC provider type * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers * @bus_clk_rate: bus clock rate in Hz * @bus_clks: the clk_bulk_data table of bus clocks + * @intf_clks: the clk_bulk_data table of interface clocks */ struct qcom_icc_provider { struct icc_provider provider; int num_bus_clks; + int num_intf_clks; enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; - u64 *bus_clk_rate; - struct clk_bulk_data bus_clks[]; + u64 bus_clk_rate[2]; + struct clk_bulk_data bus_clks[2]; + struct clk_bulk_data intf_clks[]; }; /** @@ -93,6 +97,8 @@ struct qcom_icc_desc { size_t num_nodes; const char * const *bus_clocks; size_t num_bus_clocks; + const char * const *intf_clocks; + size_t num_intf_clocks; bool has_bus_pd; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 69fc50a6fa5c..1a5e0ad36cc4 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -21,21 +21,17 @@ #include "smd-rpm.h" #include "msm8996.h" -static const char * const bus_mm_clocks[] = { - "bus", - "bus_a", +static const char * const mm_intf_clocks[] = { "iface" }; -static const char * const bus_a0noc_clocks[] = { +static const char * const a0noc_intf_clocks[] = { "aggre0_snoc_axi", "aggre0_cnoc_ahb", "aggre0_noc_mpu_cfg" }; -static const char * const bus_a2noc_clocks[] = { - "bus", - "bus_a", +static const char * const a2noc_intf_clocks[] = { "aggre2_ufs_axi", "ufs_axi" }; @@ -1821,8 +1817,8 @@ static const struct qcom_icc_desc msm8996_a0noc = { .type = QCOM_ICC_NOC, .nodes = a0noc_nodes, .num_nodes = ARRAY_SIZE(a0noc_nodes), - .bus_clocks = bus_a0noc_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_a0noc_clocks), + .intf_clocks = a0noc_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(a0noc_intf_clocks), .has_bus_pd = true, .regmap_cfg = &msm8996_a0noc_regmap_config }; @@ -1866,8 +1862,8 @@ static const struct qcom_icc_desc msm8996_a2noc = { .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), - .bus_clocks = bus_a2noc_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .intf_clocks = a2noc_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config }; @@ -2005,8 +2001,8 @@ static const struct qcom_icc_desc msm8996_mnoc = { .type = QCOM_ICC_NOC, .nodes = mnoc_nodes, .num_nodes = ARRAY_SIZE(mnoc_nodes), - .bus_clocks = bus_mm_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), + .intf_clocks = mm_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &msm8996_mnoc_regmap_config }; diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index a22ba821efbf..0e8a96f4ce90 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -127,15 +127,11 @@ enum { SDM660_SNOC, }; -static const char * const bus_mm_clocks[] = { - "bus", - "bus_a", +static const char * const mm_intf_clocks[] = { "iface", }; -static const char * const bus_a2noc_clocks[] = { - "bus", - "bus_a", +static const char * const a2noc_intf_clocks[] = { "ipa", "ufs_axi", "aggre2_ufs_axi", @@ -1516,8 +1512,8 @@ static const struct qcom_icc_desc sdm660_a2noc = { .type = QCOM_ICC_NOC, .nodes = sdm660_a2noc_nodes, .num_nodes = ARRAY_SIZE(sdm660_a2noc_nodes), - .bus_clocks = bus_a2noc_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_a2noc_clocks), + .intf_clocks = a2noc_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &sdm660_a2noc_regmap_config, }; @@ -1659,8 +1655,8 @@ static const struct qcom_icc_desc sdm660_mnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_mnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_mnoc_nodes), - .bus_clocks = bus_mm_clocks, - .num_bus_clocks = ARRAY_SIZE(bus_mm_clocks), + .intf_clocks = mm_intf_clocks, + .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, }; From patchwork Fri Feb 17 10:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816820wrn; Fri, 17 Feb 2023 02:48:09 -0800 (PST) X-Google-Smtp-Source: AK7set9yegSJqXf8v5h7r2NmeB+STYShgGMgirmqMzB213aOFouLv35lnvFkaJXZlPK5AcYCNBUs X-Received: by 2002:a17:90a:1ce:b0:234:8950:6d1f with SMTP id 14-20020a17090a01ce00b0023489506d1fmr6365791pjd.11.1676630889511; Fri, 17 Feb 2023 02:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630889; cv=none; d=google.com; s=arc-20160816; b=QRf5fGQGAIeUXPwqlKpfgBTnBbf1BntCKClSrsHGfrc/wpNvLr6+7qPPuoVLvB8Hz+ lZH6t5Vnc0Dquf+59Ls0XG0UtguWqjkvXDvjj1/5eDsJOrCsmA0T3k50mO44sP0l/ahx ZA/2t9RcpDK1BkxfINTQihA8k360gaB2R4tdXsfq8PdQmwiBfuK0ofSJOapx3HIJDA+y Aoqngj/56nPtdpQwNP58Ps9N0iu2zp4sNUoqWF9KKEXw7GcLMyPCimY15N/OUwajhHdj A8M+tmP7lo1hPqAlgEIXpni7c4wKeMbhXqKsvC6WpLnBW5uDUHo9rFfNAQUnXab/jpSF dTOg== 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=EoiQaMMXwDXYQsRgtWV4mTA63/tUIiHdh1PBizMV2mE=; b=ZA1fMDqraUU6OiaDeHzvn+EDPX90IILLMT1U2yBHORiFm5J8waPZZQW7bapyekQS/f R5jklPPnihI7V5RxQhKIIVgDTpOBsYac7Td3uyaFeb6cA+bM2PoNbg00//pi3n2BiYnT wVmW88dB0gSm+jitnufinJobL/cg2vSlO8U6FX4d6bB+jnpk6W3lmeOMBVzbwOOgM4o1 mRyj33lio4WPf8X7Fu/4Mb2UbQ6UVWdzfLKuLlPYEqaq2M3ai3O5iDDVZdwRXw2q5VQu VokMs5LiGBS33Ntv9pY9dlxO2zNOvsoh+vrTLRfPZXURhWjzQA2Rfkl7yv3drl19XQi4 6TlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/Tk77C7"; 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 x126-20020a633184000000b004ee642e01bfsi4689380pgx.214.2023.02.17.02.47.57; Fri, 17 Feb 2023 02:48:09 -0800 (PST) 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="q/Tk77C7"; 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 S230029AbjBQKrE (ORCPT + 99 others); Fri, 17 Feb 2023 05:47:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjBQKqq (ORCPT ); Fri, 17 Feb 2023 05:46:46 -0500 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6C1644C1 for ; Fri, 17 Feb 2023 02:46:43 -0800 (PST) Received: by mail-lj1-x22a.google.com with SMTP id bx13so681500ljb.3 for ; Fri, 17 Feb 2023 02:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=EoiQaMMXwDXYQsRgtWV4mTA63/tUIiHdh1PBizMV2mE=; b=q/Tk77C78rdYacg8u6jmhO6XQ8QhPm8IuVF1gXA7/t4slxvyDOUATh9eTr9WZMm3x2 JmGB+dCuADdZBX+izzyPfR146hCh1b71sq1JvooAFIydPEPgS9iXxf0GtEQ7P+kqZaUF 21B1ZDShbKjGjRGZot8kZIvdJ8VQTvkUnnabYiA1306obHAW1kHoMi7PhrMPrjSNl2Ws 53okno+fyjuKh7nSSxEOsjmUCM0rqbjVGxi4CraLS9bTSjNp1iq2eHTOpDbuiVCft3yx PnSK+P9r2F9cXP9VXD2dcKmDpNCg+npqD2aLi63AF7nQdyIr10fY1j/JoXZND53rhA3e EeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=EoiQaMMXwDXYQsRgtWV4mTA63/tUIiHdh1PBizMV2mE=; b=DDQgqVwa8ZkFJiYxSTRTO7fhaqsQM0w2f7EiKk0xwm45Dq0RH/5/DWTHNNdVnNj6Mo RDx6K5lgJBngGqqkr+y6f0GTHnuGXaySi5VYzcguO507iBijCt0P5939DwDldMGlhxS5 adg1EJAX7DdTtu1qZk4xRPXxJlQ6Szs8Ax+oNmyDsrlnFi8Bphcov1qfLMOm7R6L8bDB 72yBRRBZlQXnZSjP6hYUBiq2iPwLvpeUJV6U57v8FDhwmnrxD2fP+rXAsGFWDXqqIWsy 78no2TetJaq5U5+NvESNlE3zJPfwnkiOKvQvmhRTpAcugzCI4TYv3lKvzl/E74KdBmmy /wHg== X-Gm-Message-State: AO0yUKUbLv3kQeIXo9ISqMwYeBUzWlN3BusBQnvImnpjjhzQergiCDbg 9WO0eHXYBkOvhhGz0668fVmgOQ== X-Received: by 2002:a05:651c:1991:b0:293:4477:5df with SMTP id bx17-20020a05651c199100b00293447705dfmr132480ljb.37.1676630801874; Fri, 17 Feb 2023 02:46:41 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:41 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:28 +0100 Subject: [PATCH v5 07/10] interconnect: qcom: icc-rpm: Allow negative num_bus_clocks MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-7-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=1103; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0zGQQ3Z8BxpWRbcjEih3N3lnw1JS4c/rutJ4C0HFNWc=; b=m8qeHutvzcJ9ghyjAS6EUExhare4+FDIPLNFYVJDwolT4L6g5zbqa4u9OUFWtbvi9sW/+x6qgHQm eu8r8e7JCKUQ7SUDaEv8aS/POTgMNM7b2GDVLDh5epXKrW7mS/eU 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074911656029716?= X-GMAIL-MSGID: =?utf-8?q?1758074911656029716?= In some rare cases, buses will not have *any* bus-scaling clocks, which is "fine", as the voting can be done through RPM provided that the necessary QoS clocks are enabled. Allow specifying a negative (-1) number of clocks to make the driver accept such cases, without having to add a lot of boilerplate to all existing ICC drivers for SoCs with SMD RPM. FWIW this value was previously being assigned to a >>signed<< integer as well. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 729573f0d9fe..9dd631964b8c 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -96,7 +96,7 @@ struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; const char * const *bus_clocks; - size_t num_bus_clocks; + int num_bus_clocks; const char * const *intf_clocks; size_t num_intf_clocks; bool has_bus_pd; From patchwork Fri Feb 17 10:46:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58485 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816877wrn; Fri, 17 Feb 2023 02:48:19 -0800 (PST) X-Google-Smtp-Source: AK7set8k11HJXBtkiQztj6Jt98k3DpKJRIqLxEJyIkG4SqtisJMdcmVhsnICwxurTdjDmGmthewx X-Received: by 2002:a05:6a20:5488:b0:c7:6232:c6e2 with SMTP id i8-20020a056a20548800b000c76232c6e2mr3739731pzk.48.1676630898875; Fri, 17 Feb 2023 02:48:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630898; cv=none; d=google.com; s=arc-20160816; b=Wdge8MBwtObprdLhm9NaZ6HS8RJHVusqomNlGoHfuDzv5XrTVhh7BSpsYxd1r2hWch hRRVdKff3wJ8JZn9pO9Vsxli1U2lE9SU+/1Q53WzpZFXDey4NL9xRniumlTVwNYQoglp 3OXHdOZTIRmHQ662lkF6hB2+2xUsmfgRbJHOyWLKOmt/9HQuGWAUHtiCfL29a6cZr2Hp CDBPXmbpYHbxx1pixqAWCy03pD6XVlRFkfbSH4UOesLrcGFPLNWvchcqgsq3YHhc2z3p Fo6bw0ohIQly9T9BdDjfJJKbuDuPDlObYb2ddCqXPlbZDMAeAs26fNe88Gj+vSD7GPmP xKgg== 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=/VjEb3OZ7hQoHWr/0ps/r2NXNgbfLNbJhZAnYy2alS4=; b=qTFkjWcUEsmP5+n1m5SWTyQdsh6qGZ1i3xuMZCovivsCT3JOQ/pkqaB6uwhpqTypoT yOxjBEw0TNjeaHRFadnV227/foC+wwkejjNT/HYnMubG0FgBkqZBgZpqVDK3+Y/Qepi0 r2nn4qaUvDI7kefxtL8zS2QJ8swQZq2BsEEcmUB8af5crrxk+hSA6Ux8gJgPF1R1e3G8 QvArbNtRn5ve3x+nc5xQddYGWxcZchjJz5gYsS+U3mdm/j/lH/uViEfFUMZsM/N8dop0 vwXiQ5hHvjxo3YxcXdLENqQgNmaa54uI91OnhCSi9LyGbD4oHgaNYHFp7MxNczD9VCdG CPNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RP+xeW3s; 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 e6-20020a17090301c600b0019950f1e1f3si4432895plh.462.2023.02.17.02.48.06; Fri, 17 Feb 2023 02:48:18 -0800 (PST) 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=RP+xeW3s; 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 S229506AbjBQKrJ (ORCPT + 99 others); Fri, 17 Feb 2023 05:47:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjBQKqx (ORCPT ); Fri, 17 Feb 2023 05:46:53 -0500 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 AB4FA63BD5 for ; Fri, 17 Feb 2023 02:46:44 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id d24so1069399lfs.8 for ; Fri, 17 Feb 2023 02:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=/VjEb3OZ7hQoHWr/0ps/r2NXNgbfLNbJhZAnYy2alS4=; b=RP+xeW3syi9Km7CTq3L7nhVDks4S2DbTOI2lP+4X/jcRT5IFLi2jktnqCNAIOQ7EHx HYRc2H2SuUpzsvBU7aDbxWp4bjbev60BD0CtZ528nGp3ackWXEP2ZEwDAluwzrenCAhH arPeKPdK/YPMKc5PBZM4WJy7YZcLK2QT4JRDATpgclW75I6aUOf9W8Kgen71hZWby0nn HFGMDZ8wwuVaBcNUI1Jo1wFvb2lfdj/fKuidkNgcQ8qG2ZPBXP3B/OQc4HS5SD4nxYGX wQkkJUhgz4mTMW8y3LBY8dAh81qMgFeTqM0sQxldMArDR0c8ToesYyDiAvCMP9lCXUlG OPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=/VjEb3OZ7hQoHWr/0ps/r2NXNgbfLNbJhZAnYy2alS4=; b=NO5JYZpU+Nlb80y+IijSIb+OUPDb83vzYeSJwPa/fQNMeNr4urtNbP5bKJuN2DOZ8I wv6F1od9vFY9CWY+jiC6gjeeL2squ9ae7NJROXEbf9VOJVCgT8zw1qbdze8fkiN20KUZ sgosGQTP8tQvIaJVKbToblTOUYe7FW157YiOLSlWnIM5aakSysPiHYKrvi5qF+a/3o81 rPCnkRYyuVzvit2Pqb+UG0ivZIVWWLdU+rJmZINrHKrDEW6h/9Mn5DbPEE1lSUQHTcbT XcsBm6SZNsDnUZ31DvnOCtHVrFbWO+KKESM4x4Z7pIlIlmHMpwi82OXtm6gI4gMsKTKc Y+7g== X-Gm-Message-State: AO0yUKXv4NqPyIlDmYNZfngWE96NSvfEbRClFgnl61QySkzsAQlDHj3l d0kWUul1/6Sst8r6RVIoGZk8Jw== X-Received: by 2002:a05:6512:3742:b0:4ce:e95c:f300 with SMTP id a2-20020a056512374200b004cee95cf300mr2744757lfs.39.1676630803110; Fri, 17 Feb 2023 02:46:43 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:42 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:29 +0100 Subject: [PATCH v5 08/10] interconnect: qcom: msm8996: Specify no bus clock scaling on A0NoC MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-8-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=801; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=AREFOc1ndk8aH4dJx3DJJ2TVqe152RcGq0qoFxsutKs=; b=/IKip3wMWAQwdne5uZDTbmC7fQgRWhQBpwBO/KzB4CSDX45GGMGMJZbfAHAKAqfeJXGf9ZvRtBCN lAJZ9hKkAnMZxi+p4mhi3toFFuCUOqrbJIzHfIT9EILmY+yQ7kUu 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074921406341470?= X-GMAIL-MSGID: =?utf-8?q?1758074921406341470?= A0NoC only does bus scaling through RPM votes and does not have any ICC clocks. Describe this. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8996.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 1a5e0ad36cc4..45eb8675fb11 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1817,6 +1817,7 @@ static const struct qcom_icc_desc msm8996_a0noc = { .type = QCOM_ICC_NOC, .nodes = a0noc_nodes, .num_nodes = ARRAY_SIZE(a0noc_nodes), + .num_bus_clocks = -1, /* No bus clock scaling */ .intf_clocks = a0noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a0noc_intf_clocks), .has_bus_pd = true, From patchwork Fri Feb 17 10:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp817218wrn; Fri, 17 Feb 2023 02:49:14 -0800 (PST) X-Google-Smtp-Source: AK7set/7TU+auGYGj1pHFmWtL6M05Wr5vfMkVlby8LnAbMWL1fGP6NXAbYfOJZQtuIeMSrEN9hdf X-Received: by 2002:aa7:978a:0:b0:5a8:8535:18b with SMTP id o10-20020aa7978a000000b005a88535018bmr746735pfp.11.1676630954305; Fri, 17 Feb 2023 02:49:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630954; cv=none; d=google.com; s=arc-20160816; b=ibrfT1HIjqDMVOCRmgNCTipuj2K1A0TkgLHogRPVaflJdAn09vI4IpstzNFwi3nVFG r1xuWru4ZEkUyjHUcS2tuoptkJ3BRmOQdEH6a6nlzv8OngZ7UE4lT4llrGd0mrvcUQvb MOZpkmSiksEiGEySlsBtBC2tHvxqFWiJsi7yr7T0vey041kE2IDP8N6VfIwn/5L9Gb7J hxQQxbtMxN7qsMG+VPxz2Ivro+CBEX17/FvdQEA4OfajkQtl1KaifwID+JR5PqeMHrj5 aNcq1qrtIrncSLOrjYeB6grIAkluivZKRgicIeiOjGTnFZqv/Yvv9xafiR7+DYiU8c/F Ke1A== 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=sUZvSNJx+5CVUv1a1ome/kslg/vit8dOWhZX8VfXJjY=; b=l1fr5jKCtSA/u+GpwbOIT1nqCzFArpR624vHor5n/beAsMYv3fQUTKwXSj+z/BaJ1z XtNIJ7jrrESYim2pysp66vPqE5XLBOHz1g/qdJkSMLclFAAggpwqN6LOnnN2zj9jDpn4 U1UL7GRX2nv2jZrpfZ2tFbIu+383UP7VjqrWWurmhRL0TPJ12jl1p1aOZLYD0HjDpgBE O4hr1peA7djpi6Zq5uLJkx/xJrlE5pY5D0IWW9ptJl8Efov7VQHIyTdG9niilh/thCzN nawJz20NF8n2TK1jMuNBi2SziZOE1OdsQlwl3jReZL1OYOI9dPI4oilPyMr5s/sBALxP oQzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EXsdWyi0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020aa7951a000000b00593b8c172d8si4098750pfp.200.2023.02.17.02.49.02; Fri, 17 Feb 2023 02:49:14 -0800 (PST) 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=EXsdWyi0; 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 S230003AbjBQKrN (ORCPT + 99 others); Fri, 17 Feb 2023 05:47:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjBQKqx (ORCPT ); Fri, 17 Feb 2023 05:46:53 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC79A63BE0 for ; Fri, 17 Feb 2023 02:46:44 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id z18so1329609lfd.0 for ; Fri, 17 Feb 2023 02:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=sUZvSNJx+5CVUv1a1ome/kslg/vit8dOWhZX8VfXJjY=; b=EXsdWyi08Pn7WSIyxZUVREdsQR8UnirrYFke6f6W1etq8gPhRdj7ZgB4N7wIjtYzZT 7rO+638bw8CSKKLWyVwDLbHVRdlkiZCXp0pIPfkoxg4ABM56NPG/DqIri8GLjMrwxXE6 mxq7sRzyhPDfWE/L09Yj3zUq844ssUKqMguBGnB+ymP8VAUW55AEbNo5oyhZVhzk+bPm 7B8nKUdMF11d7GZgf0zBRtU8Mp6vLYRPQFz6at5//qzcCIrJm7Gr/jckq8GaoyKsatca 4HoSCZPWeKc6OOt9iKybUwE3Nto9K4MYWDqZ6SGXidgD9oX5sP/pzPE0dQdxepH0c5Jf Hqyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sUZvSNJx+5CVUv1a1ome/kslg/vit8dOWhZX8VfXJjY=; b=moan46gldHMXno1TthQUbzHkqd8gx0dY5Jc7GogJAdnp0f7N2KWgmNnB7n1QAUW7Ug JO482RBsspdCWS0756NRDuA3N/80qiQQC0pBtw8PgiJUFQYM9t0RjmhT3xOwQjChS+Dj 7KQrlhhhAogecK0iOyRbAsEHr5cFfB+RIOKwKoKCnVIcrHglGczRRsh3pq0sbS91jGRE lEIX4x2gMArpJHvJM2TCte5LjGE5lf2as7o2AfVdx+A4pw24QnGvNKO5ipJ9ipkCnTrk 8laWx+6dtNTQGvGd94MHXq1ItftPNoRgo7nbzaqM6yjfEJ1o6lrOOo8QyhNe7i6ri3s3 b2qg== X-Gm-Message-State: AO0yUKUtdHW12Nl4/PSYxzfQDW5WCp2BISnJ8ZatkiuGj4t9iCF9Y6gc finaajI6GnJi/QcJ96ZFYb8/iQ== X-Received: by 2002:a19:550f:0:b0:4a4:7be4:9baf with SMTP id n15-20020a19550f000000b004a47be49bafmr131985lfe.59.1676630804528; Fri, 17 Feb 2023 02:46:44 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:44 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:30 +0100 Subject: [PATCH v5 09/10] interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-9-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=1105; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=M6Z9fDv56JMA/vi+7eufxFCs9O0sn12I8qL5zKPdgGA=; b=4PU2DRlOt0EziTNs4oNm8eizsiGxce2VIGm7o4so4TLHPOOMLgZdmRPkufnOsNHyvGrwjURDmBk1 n49XNf+UC2baBget3SKLWOJw2zcRPo9w1gGP7CZEdSEDgYWnk/WJ 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074979390772771?= X-GMAIL-MSGID: =?utf-8?q?1758074979390772771?= Commit dd42ec8ea5b9 ("interconnect: qcom: rpm: Use _optional func for provider clocks") relaxed the requirements around probing bus clocks. This was a decent solution for making sure MSM8996 would still boot with old DTs, but now that there's a proper fix in place that both old and new DTs will be happy about, revert back to the safer variant of the function. Fixes: dd42ec8ea5b9 ("interconnect: qcom: rpm: Use _optional func for provider clocks") Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 1b382a2f2710..7c2ed224d0e7 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -510,7 +510,7 @@ int qnoc_probe(struct platform_device *pdev) } regmap_done: - ret = devm_clk_bulk_get_optional(dev, qp->num_bus_clks, qp->bus_clks); + ret = devm_clk_bulk_get(dev, qp->num_bus_clks, qp->bus_clks); if (ret) return ret; From patchwork Fri Feb 17 10:46:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58489 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp817444wrn; Fri, 17 Feb 2023 02:50:04 -0800 (PST) X-Google-Smtp-Source: AK7set+jpgpvUszoVIemk0RrsfEJ0ugxnoMfV3jvKZc1LgNa7QFY9ySWG1jVIRGASQhuGZsdRDkg X-Received: by 2002:a05:6a20:548d:b0:c7:464f:5557 with SMTP id i13-20020a056a20548d00b000c7464f5557mr4193828pzk.18.1676631003686; Fri, 17 Feb 2023 02:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676631003; cv=none; d=google.com; s=arc-20160816; b=sckWxbF3NB0sFtSW+pgX4gvqE9gaHlOmguCmMKbNZjxG8HOlE4MNaFBP0U+TZl9RJ5 e0E6VxhxcTdipJy8heq4aHUp43WV6S4UgkZnZOA5bsUzpsHNf6DUmkmlfW1va46PjWcy OVuzCuNElJ23fFMwYqvCgOyudpCvRftNis0M++DPx5nSIT0iFSw8BcLgp2msSNm2EHez GI1yH9Qv4zU6+laGYh+NGvcElaR5/pHcHP9XNUUhmFRCMrBZA9Z6AtlXiaEICj4g80f7 XgWHk+QDosn3cbcdRtg4txXKi/ZQqPkmeSPAWZCxe6pUC4cgWsOmm1EQhdmb46In0kMx ftFw== 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=odDokNhSe0XiR1J+qvgMZCsSwTEjlZob9GhOBF9OHvc=; b=vGajpG5hgtKiwlU8I2Y6hcWf2KjG4YKREVuQV4sz8p9mHG8lolNBcLhykd3IGzKN2Z ScqCLrdAfeporfiUMGg1nx1ePItTTNN8A4AX2sn9VLHYyoA2ZKzTpvrGdCsW4CwrtNH3 g7TzsJ9JKBPgLbEaQz82AOvdAiYJjWxTjXlDFqeCjxmdwAfgIh1Z4rBNQHUeuDTt8OVz jTH4o+xUtdRN0UgNgvMORGZ9hvDDZCmMkD9FDZwSUQmpU7V9NZ/bOXhrq/E3RZbdCmSz n0H/PyOWuvTerl/WV70LA1ggopyHLr5LZJx1zwxQNiSc0/PY8qlj/EWYmL120szPpMjd Uwug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D3K1+FTh; 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 f10-20020a63de0a000000b004770fe95989si4531708pgg.496.2023.02.17.02.49.51; Fri, 17 Feb 2023 02:50:03 -0800 (PST) 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=D3K1+FTh; 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 S230102AbjBQKrW (ORCPT + 99 others); Fri, 17 Feb 2023 05:47:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbjBQKrD (ORCPT ); Fri, 17 Feb 2023 05:47:03 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4A0644E0 for ; Fri, 17 Feb 2023 02:46:47 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id f22so557370lja.6 for ; Fri, 17 Feb 2023 02:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=odDokNhSe0XiR1J+qvgMZCsSwTEjlZob9GhOBF9OHvc=; b=D3K1+FTh9n03cNh00K7Ql0DlhbCiO3snRPzAQCYRUG/kv1+Of7CSMSAoNV9rbY5paP W8hvgn6W/Sx9JTN+Sk6WsfKqW9pGze1ppmWc5Vm6T6FeJ5HqtIZYxQE9oCSVtrU3pHaO fKawFEuoaf52WGrh27Axphw2tsY/FqQw1COM/V1OkpOjUs+v6Z+RQbjOlU77Aksh69AQ uCpNVZoWEbLRKnDFD//1Y9upK775vvik1CwIJzld+ydbJgnr7PFNmJ8r5kZR5k/qWJjZ RirViQ0GcfsuksJaQ2bYZkGkAUSspKsIepsQswI0tq74LifTEUjU0cYZ21n9LPxW2QwU bxPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=odDokNhSe0XiR1J+qvgMZCsSwTEjlZob9GhOBF9OHvc=; b=M1CBaAcIhZt0WqjmeDtiiHIzWFnFhJkwLp0M2S0dNQpkwgMFcCaavoDCqxBLVtYz44 WMVafcHrcfXdFANWrOHbiKbNZmt3bA57Eq/wrB1asGa9MkMAfb2OGhnx0eSAoAEHTXhG Yt6W/s47cguepP7BdCtCWU23tvboj5/B+EiUI/ws6IPGRWaVPRlusUjV7Fxi2dMofCwT bnv62xWCN1yPSi06kyEoNxVD3Tcyl4tiM7jk8zA0Ql7GaDW0YNSmdQ30T2vsF+9GcYW8 MZiffHZkb9eZaGhcpRW+/CK2ONr51hWGS8TqtGdrFabQoav0LewExS2Nqt/G14WH0K7r WIsw== X-Gm-Message-State: AO0yUKXAL8KJEtW3ktGULcxB5Fr1C8jA7I31C6/l/eSUJbpbP5aoP7ML LyoWf411Em+oE3zYl96nNpJ3gg== X-Received: by 2002:a05:651c:cb:b0:288:7a51:3882 with SMTP id 11-20020a05651c00cb00b002887a513882mr2620028ljr.10.1676630805803; Fri, 17 Feb 2023 02:46:45 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:45 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:31 +0100 Subject: [PATCH v5 10/10] interconnect: qcom: msm8996: Promote to core_initcall MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-10-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=1279; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=v+92vgE4LxpyLLy9TkKCUJhLtzjJRiMz2HkYa5ye5Ko=; b=ye4+EU5XrLH1YeGrsjD9r0V6qhdwvc1GMXE2fvuG0bZEIWXL6uWLEUYNCxBlRl9MS9g/djo7ZGI9 ccQmDLJEAYFbDFBz7+l3TTxtL/qOuMeqSDMG4MhgNym1eq7GwA6E 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758075031811258071?= X-GMAIL-MSGID: =?utf-8?q?1758075031811258071?= The interconnect driver is (or soon will be) vital to many other devices, as it's not a given that the bootloader will set up enough bandwidth for us or that the values we come into are reasonable. Promote the driver to core_initcall to ensure the consumers (i.e. most "meaningful" parts of the SoC) can probe without deferrals. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8996.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 45eb8675fb11..0e0395328dc7 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -2109,7 +2109,17 @@ static struct platform_driver qnoc_driver = { .sync_state = icc_sync_state, } }; -module_platform_driver(qnoc_driver); +static int __init qnoc_driver_init(void) +{ + return platform_driver_register(&qnoc_driver); +} +core_initcall(qnoc_driver_init); + +static void __exit qnoc_driver_exit(void) +{ + platform_driver_unregister(&qnoc_driver); +} +module_exit(qnoc_driver_exit); MODULE_AUTHOR("Yassine Oudjana "); MODULE_DESCRIPTION("Qualcomm MSM8996 NoC driver");