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: 654714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82FF7C64EC4 for ; Fri, 17 Feb 2023 10:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbjBQKqj (ORCPT ); Fri, 17 Feb 2023 05:46:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbjBQKqi (ORCPT ); Fri, 17 Feb 2023 05:46:38 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87F8A63595 for ; Fri, 17 Feb 2023 02:46:35 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id g16so1202973lfv.4 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=i3cruepqNX585KH9bKmW1CJJkgUaCxOwxz0kYYB2a7NKbhUzaHhpCXXhffhgtqH+Wz 63wqspjCXFwLHorB16kYr4dGYWS9h3PNw1anOu+ueuKB8fCztv72Nz29TgP4r19fM4fR acmJEt5CIHzShH0iqesrlkWbjoePvmYy1N734hWwJgSLlE0caE2hIxvIS4Ssfavu9Do2 oJhGdp60iPxV2vqHs5Muk62KY6K15T/PUUJdc+7CzREV1OvdDMGznArfX9+DRVbWpW4L lqMN0Le0p22CeGq+ABZQ5YAgvEX1M/3m/NvCyZJ8EOasZqDp4aGyQGdrMBz1WE9/okBJ ynng== X-Gm-Message-State: AO0yUKUm7gItHpjWSyPs3W6oBeXtUZezD/VhVlaFL0YR0GjIafEWLAFz UPxYLtR1Kb82sArK2jvEdoyGUw== X-Google-Smtp-Source: AK7set9CFybII5DzWno5W84GW/eIYkkvmlI9Pc5UoP4WoeAp2y/z9KTGNal3UcfDdXwOMDoqW8CSHQ== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 655016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92087C64ED8 for ; Fri, 17 Feb 2023 10:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbjBQKql (ORCPT ); Fri, 17 Feb 2023 05:46:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229889AbjBQKqi (ORCPT ); Fri, 17 Feb 2023 05:46:38 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CCF25FBF2 for ; Fri, 17 Feb 2023 02:46:37 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id x4so910962lfq.2 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=8J7Y1CSFlURMzSHfXfbeUviBO4Y58x5dbCzGWChkraLnQeu45D3Z5wYWVdCPDD69VF 4sz8UpMdaDKoS8YkRxlEYHXhHa/MJmdVa6f0gHlBa3KmWPMbXA8uAnRIKTF8RV38Iz7b tPYXR0sPhEoTQb/vzPl2mTIlMNq7SIjE5HbZ+VcJxEr7/Fp4ypTFzvQUOMaH3KHS2b97 awM96Ikz7X2OZs11owgApIlXybxMrINUu/dvPUTDvjkciYOCaa1swEjPrfpoGA6GfS7O VxYotmnaukE+gRksam+iEI0qnjeHNhMULdnqsZ7oLANj1m5hcFg09sle8p2cLjBT5T7R w9MA== X-Gm-Message-State: AO0yUKUEE4zS0oNZJLZzF2h41fISgnxEhJsHLnqafY7Za/0BeGNLYsfC XbdqRjz+gsGwxNe5HDZ0nBxuIA== X-Google-Smtp-Source: AK7set+Y1pfHXR2h3/1ZVtNtlCLzVk2iFx+zdkUyTFwRjXOQwQOHlAXlV6oxvtd7meL6IULWLyylwA== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 654713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F2AEC677F1 for ; Fri, 17 Feb 2023 10:46:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbjBQKqn (ORCPT ); Fri, 17 Feb 2023 05:46:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjBQKqj (ORCPT ); Fri, 17 Feb 2023 05:46:39 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593F1635AE for ; Fri, 17 Feb 2023 02:46:38 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id d28so1112733lfv.13 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=zfgjYH+3LBcP5SgMfkBQJ3ONUtVGRlOb2n+JUZ1ho4GRwpKH307MnTn4BySAO5ngMR w/HxICvkGb7BGBqhBOpru2quZ+eaE3Yl/wLVhOkqwyo6ogXeOQhPyDOo3ueTu0faVSxd zxn+1b6+FJlWoOsGb+YluMUE93H5zV0efc4zIc4M2m8ubiywFp7nry6+d1fsTz5h7Kox 1HhO9RV1yimFG+ZtqhGXrpWgzZx4p95E/jH3umhyPqUvshTcpmSina7RQrNgFb7kfPDh WJhjwsvnG4AXdUW/uYjCjhr6bh+yUmcB53uCeaWQnssE+vpnjwPfM10lP+QX5IZ8Hxk0 PVZw== X-Gm-Message-State: AO0yUKW+uFf3mXNwrzuR0hvEUE4iL2JblqvFSR0tu9emawQ9IMJ2YruE vs7Jrypw/3E9QeYZCcanRU9nnA== X-Google-Smtp-Source: AK7set8HxLN5QJZa7aXty06Alvq62w3MD6azAVgwNNTZIUqZXOdEw6NoxZlKAGqi1S3qqDQg8/zbNw== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 655015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C01FC64ED9 for ; Fri, 17 Feb 2023 10:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbjBQKqm (ORCPT ); Fri, 17 Feb 2023 05:46:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbjBQKqk (ORCPT ); Fri, 17 Feb 2023 05:46:40 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A21A635B3 for ; Fri, 17 Feb 2023 02:46:38 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id t8so833161lft.11 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=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=S8UZbilovRfCrkdkdxUay+WDZHAkkzBClpm0V0tRoUQBcOrB0g9x4Fx7qvQfuewCyH UeAQDWjlcVFqWP6VeA9RRc0VslB39JlVSC9OTx1UeyoWj8vvbQQxTE6CLiEXQwLFFolg XoYXMDl5N/NzOi1xBU7nyxJ2gn6ynSobB6OGO8i6k+8tD2bUNDjhKFEhCYnTlVU4taAN 2UX5f7hpKUNqR0+SODDULUlYInIdD1UFWtyf0oyEcWnw+Us7ZxI1xMNKZaC8SVYyXk8B 3ZpPWBZtaQcQxRuGK/Ilb8Bzgd2K8PyfNM/IZb+qllaYt9+VrLUVggcj01o942gl8puZ TaKw== X-Gm-Message-State: AO0yUKUe1GwdVIY5ja62RkDlSG0yMoIIIeEAuyy0ZgZJFti0jFaJiVCx 2euxAuZ+2SGgKcS3ozvilrFdrA== X-Google-Smtp-Source: AK7set+nJuq+kwi6hiqL0KohFCGNjPzeCl6bdtgwTdgYx/CTBpeV0/OrjhQyGyhkNOrRa9++oJMmVQ== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 655014 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7EE4C636D4 for ; Fri, 17 Feb 2023 10:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbjBQKqt (ORCPT ); Fri, 17 Feb 2023 05:46:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjBQKqo (ORCPT ); Fri, 17 Feb 2023 05:46:44 -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 CE63C635BC for ; Fri, 17 Feb 2023 02:46:39 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id p19so1039700lfr.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=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=oXLJDWbAHvN9shSq/FCbqTGuyt7IAOgB9MsBOuX6PydwEYE+ugym+/gSRB8mn6G87V 8j48RVovOOWKoJziZv7ZjN4RkQtP1liCqRQG1jgsPPXFNFmxgEIXMbYGAixagMCLTPvF KJztMb0LE9CoSTYYhSmJbXp5izWTaFQQbDLLUaw8FVS/5kEO2MYsSG89FqQWPvd5UT3W oQacI2oz5di68T/pz8G5gMnv/KO+pKcQlEHvuUru/psog9lqoUnvrmw5wa9bEvAEicw+ THqqg7hKxffHpj649h4L4Il1gYaBo/wNHKxJQye52ieOrl6Mc+GiMCoceQ7Hncswc+ly Xdpg== X-Gm-Message-State: AO0yUKWXRwL3cbYgIMmuhifWBLC0yTwf8MroMULe9JN9F477c/JEOyMx seYy1XX/wKc/azVnFVNA0qc/9A== X-Google-Smtp-Source: AK7set8kMF6hq8uzp/ZoeOSDX6mSYEz6U4PUe8eC1poZ5jXbjITjJsgsSG1fcRpGoyNQf9hMEw37ww== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 654712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A1D6C05027 for ; Fri, 17 Feb 2023 10:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbjBQKqy (ORCPT ); Fri, 17 Feb 2023 05:46:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjBQKqp (ORCPT ); Fri, 17 Feb 2023 05:46:45 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 672D8635BE for ; Fri, 17 Feb 2023 02:46:42 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id bx13so681455ljb.3 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=lKhNwMgHECTHemRPEPWh6TBSOS7vxZ5DIuWtbVHb6ky4uLKAwBq0pQzk3cLBlu9Ypd OsExC9gpHULzwSxgyhCbcGcPwvnVu/g5kDG083FdTkw4WeyFITWShimu5aSKensMzMG6 782oQxWeIR/kwA7V41P04j6KTsi0l1cIOm2vK5WiJp6ZQ/HWIkmQ3N5DwCWtfpMincyg 6TGt8Gts5mX/NKQeQ/B5B4fqGzxS5jVSqHgRfQi3GOT1nM8YNnL5G0gHSn1qhlxB6ync 3hoJsXkFg85iFx8bkJp9EyZQV2cMRQ9UY6sqCIQTvpQYZbh+53Xl2eLAkBYaRWBQ1Pcj C6ww== X-Gm-Message-State: AO0yUKUCYoqZbbwv2zX/oINSa7AXUkkJmNWOnF7y4gB2Uqlc+BmB3e7B GyPToW7+Yiqr//EC2pIlb+vzZQ== X-Google-Smtp-Source: AK7set+02k7RKsHrmItnzOi2GjS6hKY+Iwsps/Ti5tr1Oof1GkjKruE9xyi6cuhYmdQ/7Yf7o7e2aw== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 655013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C297C636D4 for ; Fri, 17 Feb 2023 10:47:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbjBQKrD (ORCPT ); Fri, 17 Feb 2023 05:47:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjBQKqs (ORCPT ); Fri, 17 Feb 2023 05:46:48 -0500 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CCB1644C3 for ; Fri, 17 Feb 2023 02:46:43 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id f3so482037ljn.12 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=ISE4WGyKBYhUyCgZ/bk4yNKexcKmQ4LawTmYOVcHvr531o83VosTrBVbdZNz0idyGj NW24W6SjVMxVdg6M4GGub3nsXyY9z18FYxsbhYVXt7W9vWftm/vftP+xTTxk+j/aW9rX 0tsJEta9cf55acYN7U1fel6sOmJM6g2zXpjD0JNrfhtTSY6Yb47BfKdvo56W4zex87oA MVCfZfZs9lrRkWyLYlYcWX/yM3iCFVz92FX72f6WNK6kw0p7GhMpc2MyZK0LekI4XF0p UBqO83tNzb+3d9PYNVm86L4O3YrYTb+KiQbbKmo6mLoaCZfmB5duW2vtBLnI9yJnNAYV /xzA== X-Gm-Message-State: AO0yUKVBY+OJ7VcDbUEys2ofsYR/k6nZX50d+TsEa6O4sonAtBJzm5sE pe6g0tllTGn/1Gb0bPFCvran/Q== X-Google-Smtp-Source: AK7set/EAFPURO6z3yLtlqei7ycpiwltwi+qBdgt5h0ULlyGLdM5suUx9fQ4ik/VgJvJdnj3X7FhQQ== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 654711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEAC4C636D7 for ; Fri, 17 Feb 2023 10:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbjBQKrF (ORCPT ); Fri, 17 Feb 2023 05:47:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbjBQKqx (ORCPT ); Fri, 17 Feb 2023 05:46:53 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE34963BEB for ; Fri, 17 Feb 2023 02:46:44 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id i13so1293768lfe.1 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=Fc5r8SoLPzxmqRY1OH/I0Qnessu7fTmbCkSObLRgdAVvCvnK9ir5zZGQiZDjL29tOR Rwe09f7WMhFGosL1bOPfB2v7mGb5EXdPxJWpX3oKNU3Zpw+5GAR9ploOQpfhcFN/IwP7 D/o6zSjubr1upujRn2VEdTAtHRjy501S9i5+uvYaKwFH15DgZ0s5Gw2qBLrImKQpXPZG 1IHBP+9gTzXLPxhfOG/3SnrIV3FGBLmgCtlaf4U9+8gbYWlS62ngIbXR+tA5JD1/e4Tv zeOd+WmRGU2RDys0354kU6enxqf85B7XQ9UESDofkvNE3qFlcJAZEmJuSUkdxpCLucv8 yx4A== X-Gm-Message-State: AO0yUKWTqZwt1sDuV/hrRZr1sk4lyO2OphNxATupQFeTTIa8FURs2+nT 9D5TE7NCucqjRjap+PQoqq7o0A== X-Google-Smtp-Source: AK7set9hDY73DJqGTveEBX+RQrfn/+Jk2FSuul8+0z1IyNWCWKhD1iARv2I6So/d49Z0RznVb4kDKQ== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 655012 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F637C05027 for ; Fri, 17 Feb 2023 10:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjBQKrN (ORCPT ); Fri, 17 Feb 2023 05:47:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbjBQKrD (ORCPT ); Fri, 17 Feb 2023 05:47:03 -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 461E3644CE for ; Fri, 17 Feb 2023 02:46:46 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id u22so1242829lfu.5 for ; Fri, 17 Feb 2023 02:46:46 -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=G+wMfqltSLUAdJBFw0NAKzRs16N9dmooA6nW8r2Y9Zq6LH7Ulwm7D/ZdYgVhLIltOK FHjVwzCmqBineXyZXlrC4yccfEoK7HCXV6BDIcU4Nz0NG0yc93nNIoNTbdbtwo+0ZQ/5 Ew6LI5IyXpeNMlSY1YbuHCHeP0XOB2F6PKfyl508btgFmcAG0DVp8Kdogd2VvdNYXJzD sj6EyHtdSCRH2iT8PqHoxEKql+P2GsrvQPzRjTmM+Pr71aiHdQyfMgLWGW/4ubDdqNRp O0ipzWsh4yIb/wiaNMQFaXaKDYP5405ky26I2c0uXwm4Sdh305sL3sge3uSOZWu9I0Kq Zs6A== X-Gm-Message-State: AO0yUKWavouhx5H1HCQ0U/b0x3Jv/cfr+X6cLHtr5u5XYCwdXHyX9uVo 60+lxLlBL80EbT3kkcbpVkMGHA== X-Google-Smtp-Source: AK7set/KOt4MODQVD/uWSLyLAfds7ypN1w2Qigdsvw/j3xllf/mfSjA/+3ShtHP8y1TfzcE+WNLUHg== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: 654710 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E3CDC636D4 for ; Fri, 17 Feb 2023 10:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjBQKrO (ORCPT ); Fri, 17 Feb 2023 05:47:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbjBQKrD (ORCPT ); Fri, 17 Feb 2023 05:47:03 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A7A8644D0 for ; Fri, 17 Feb 2023 02:46:46 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id e30so682930ljb.8 for ; Fri, 17 Feb 2023 02:46:46 -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=6WFDElBaGPxZ7x3aGwCI1faslkBei8zp+ROS2ckNOVlRa8sZCHGExI6j+BSO7C30D/ yNEeSwNvG4kl80PN0Y177vjfQC3gwAz6vNQs4PgugbGnF0ajH+LdTmNgurBdTgNMeNtY 7sHDBi0nfR1LzQmkxHBIcMcXpPopZK6Er5TxY5BiiqLRYNkzlR7TKCZ6QmKMFp+5y4Vb 8Rjdkv5GkHQXvhQmPgTvqHYAP8iOx6eTFm0qIDOsIRAZxO/tifyo+lgWHhBwl1/Hliih icnob5ovvVAP9AloT2f3xyZZA4tSUugBVnXTTDF3qUom6T39AANCXt3RoGgIO3swxXMa sITg== X-Gm-Message-State: AO0yUKUHVKwIR5Yh7pQhvTOI7x7tbG5hBiDvbt19BzE/120m3M1g5vHn viXGJ8mB5FeCfTzw4LGysW0oDw== X-Google-Smtp-Source: AK7set8YPXVOhX95P8BHybZ0yF7DQ14DmrU2Ma3cK5WTeI2AqchRxe+rXSXSklTjMpm5wimfKxP5iw== 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= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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");