Message ID | 20230217-topic-icc-fixes-v5-v5-8-c9a550f9fdb9@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;aimixsaka@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Fri, 17 Feb 2023 02:46:44 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id d24so1069399lfs.8 for <linux-kernel@vger.kernel.org>; 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 <konrad.dybcio@linaro.org> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Georgi Djakov <djakov@kernel.org>, Evan Green <evgreen@chromium.org>, Jun Nie <jun.nie@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Brian Masney <masneyb@onstation.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Yassine Oudjana <y.oudjana@protonmail.com> Cc: Georgi Djakov <georgi.djakov@linaro.org>, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio <konrad.dybcio@linaro.org> 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
The great interconnecification fixation
|
|
Commit Message
Konrad Dybcio
Feb. 17, 2023, 10:46 a.m. UTC
A0NoC only does bus scaling through RPM votes and does not have any
ICC clocks. Describe this.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
drivers/interconnect/qcom/msm8996.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 17.02.2023 11:46, Konrad Dybcio wrote: > A0NoC only does bus scaling through RPM votes and does not have any > ICC clocks. Describe this. > > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- This is bad, as devm_clk_get_bulk{"", _optional} doesn't check if num_clocks makes sense and passes "-1" down the devres alloc chain.. I'll rework this for the next revision by simply assigning the common "bus", "bus_a" set everywhere instead of relying on it being there by default.. Konrad > 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, >
On 17.02.2023 20:27, Konrad Dybcio wrote: > > > On 17.02.2023 11:46, Konrad Dybcio wrote: >> A0NoC only does bus scaling through RPM votes and does not have any >> ICC clocks. Describe this. >> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >> --- > This is bad, as devm_clk_get_bulk{"", _optional} doesn't > check if num_clocks makes sense and passes "-1" down the > devres alloc chain.. > > I'll rework this for the next revision by simply assigning > the common "bus", "bus_a" set everywhere instead of relying > on it being there by default.. Or maybe I shouldn't, as that will require redefining the array over and over again.. Perhaps just passing <&xo_board>, <&xo_board> to a0noc's "bus", "bus_a", similar to what's been done on SDM630's GNoC would be less messy? Konrad > > Konrad >> 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, >>
On Fri, 17 Feb 2023 at 21:53, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > > > > On 17.02.2023 20:27, Konrad Dybcio wrote: > > > > > > On 17.02.2023 11:46, Konrad Dybcio wrote: > >> A0NoC only does bus scaling through RPM votes and does not have any > >> ICC clocks. Describe this. > >> > >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > >> --- > > This is bad, as devm_clk_get_bulk{"", _optional} doesn't > > check if num_clocks makes sense and passes "-1" down the > > devres alloc chain.. > > > > I'll rework this for the next revision by simply assigning > > the common "bus", "bus_a" set everywhere instead of relying > > on it being there by default.. > Or maybe I shouldn't, as that will require redefining the array > over and over again.. Perhaps just passing <&xo_board>, <&xo_board> > to a0noc's "bus", "bus_a", similar to what's been done on SDM630's > GNoC would be less messy? What about simply skipping a call to devm_clk_get if num_bus_clocks is negative? > > Konrad > > > > Konrad > >> 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, > >>
On 17.02.2023 21:26, Dmitry Baryshkov wrote: > On Fri, 17 Feb 2023 at 21:53, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: >> >> >> >> On 17.02.2023 20:27, Konrad Dybcio wrote: >>> >>> >>> On 17.02.2023 11:46, Konrad Dybcio wrote: >>>> A0NoC only does bus scaling through RPM votes and does not have any >>>> ICC clocks. Describe this. >>>> >>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>> --- >>> This is bad, as devm_clk_get_bulk{"", _optional} doesn't >>> check if num_clocks makes sense and passes "-1" down the >>> devres alloc chain.. >>> >>> I'll rework this for the next revision by simply assigning >>> the common "bus", "bus_a" set everywhere instead of relying >>> on it being there by default.. >> Or maybe I shouldn't, as that will require redefining the array >> over and over again.. Perhaps just passing <&xo_board>, <&xo_board> >> to a0noc's "bus", "bus_a", similar to what's been done on SDM630's >> GNoC would be less messy? > > What about simply skipping a call to devm_clk_get if num_bus_clocks is negative? I tested that locally before reporting the mistake on my side and while it works, I just consider it.. ugly, because: num_clocks = >0 => use the externally specified num_/clocks (logical) =0 => use the default 2 <0 => consider there's zero ..but maybe that's just me.. if you don't find it ugly, I may just go with that. Konrad > >> >> Konrad >>> >>> Konrad >>>> 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, >>>> > > >
On 17/02/2023 22:28, Konrad Dybcio wrote: > > > On 17.02.2023 21:26, Dmitry Baryshkov wrote: >> On Fri, 17 Feb 2023 at 21:53, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: >>> >>> >>> >>> On 17.02.2023 20:27, Konrad Dybcio wrote: >>>> >>>> >>>> On 17.02.2023 11:46, Konrad Dybcio wrote: >>>>> A0NoC only does bus scaling through RPM votes and does not have any >>>>> ICC clocks. Describe this. >>>>> >>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>> --- >>>> This is bad, as devm_clk_get_bulk{"", _optional} doesn't >>>> check if num_clocks makes sense and passes "-1" down the >>>> devres alloc chain.. >>>> >>>> I'll rework this for the next revision by simply assigning >>>> the common "bus", "bus_a" set everywhere instead of relying >>>> on it being there by default.. >>> Or maybe I shouldn't, as that will require redefining the array >>> over and over again.. Perhaps just passing <&xo_board>, <&xo_board> >>> to a0noc's "bus", "bus_a", similar to what's been done on SDM630's >>> GNoC would be less messy? >> >> What about simply skipping a call to devm_clk_get if num_bus_clocks is negative? > I tested that locally before reporting the mistake on my side and > while it works, I just consider it.. ugly, because: > > num_clocks = >> 0 => use the externally specified num_/clocks (logical) > =0 => use the default 2 > <0 => consider there's zero > > ..but maybe that's just me.. if you don't find it ugly, I may just > go with that. Would 'lesser ugliness' count? Maybe add a define 'ICC_RPM_NO_CLOCKS = -1'? I think that spawning default bus & bus_a everywhere would be worse. When this driver is rewritten in Rust, we'll have a clear distinction between None (meaning default two clocks) and Some(0) (meaning no clocks). Wait, does that sound even more ugly?
On Fri, Feb 17, 2023 at 09:28:54PM +0100, Konrad Dybcio wrote: > > > On 17.02.2023 21:26, Dmitry Baryshkov wrote: > > On Fri, 17 Feb 2023 at 21:53, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > >> > >> > >> > >> On 17.02.2023 20:27, Konrad Dybcio wrote: > >>> > >>> > >>> On 17.02.2023 11:46, Konrad Dybcio wrote: > >>>> A0NoC only does bus scaling through RPM votes and does not have any > >>>> ICC clocks. Describe this. > >>>> > >>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > >>>> --- > >>> This is bad, as devm_clk_get_bulk{"", _optional} doesn't > >>> check if num_clocks makes sense and passes "-1" down the > >>> devres alloc chain.. > >>> > >>> I'll rework this for the next revision by simply assigning > >>> the common "bus", "bus_a" set everywhere instead of relying > >>> on it being there by default.. > >> Or maybe I shouldn't, as that will require redefining the array > >> over and over again.. Perhaps just passing <&xo_board>, <&xo_board> > >> to a0noc's "bus", "bus_a", similar to what's been done on SDM630's > >> GNoC would be less messy? > > > > What about simply skipping a call to devm_clk_get if num_bus_clocks is negative? > I tested that locally before reporting the mistake on my side and > while it works, I just consider it.. ugly, because: > > num_clocks = > >0 => use the externally specified num_/clocks (logical) > =0 => use the default 2 Why not let go of this "convenience" and have num_clocks actually mean number of clocks? Regards, Bjorn > <0 => consider there's zero > > ..but maybe that's just me.. if you don't find it ugly, I may just > go with that. > > Konrad > > > >> > >> Konrad > >>> > >>> Konrad > >>>> 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, > >>>> > > > > > >
On 23.02.2023 15:07, Bjorn Andersson wrote: > On Fri, Feb 17, 2023 at 09:28:54PM +0100, Konrad Dybcio wrote: >> >> >> On 17.02.2023 21:26, Dmitry Baryshkov wrote: >>> On Fri, 17 Feb 2023 at 21:53, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: >>>> >>>> >>>> >>>> On 17.02.2023 20:27, Konrad Dybcio wrote: >>>>> >>>>> >>>>> On 17.02.2023 11:46, Konrad Dybcio wrote: >>>>>> A0NoC only does bus scaling through RPM votes and does not have any >>>>>> ICC clocks. Describe this. >>>>>> >>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>> --- >>>>> This is bad, as devm_clk_get_bulk{"", _optional} doesn't >>>>> check if num_clocks makes sense and passes "-1" down the >>>>> devres alloc chain.. >>>>> >>>>> I'll rework this for the next revision by simply assigning >>>>> the common "bus", "bus_a" set everywhere instead of relying >>>>> on it being there by default.. >>>> Or maybe I shouldn't, as that will require redefining the array >>>> over and over again.. Perhaps just passing <&xo_board>, <&xo_board> >>>> to a0noc's "bus", "bus_a", similar to what's been done on SDM630's >>>> GNoC would be less messy? >>> >>> What about simply skipping a call to devm_clk_get if num_bus_clocks is negative? >> I tested that locally before reporting the mistake on my side and >> while it works, I just consider it.. ugly, because: >> >> num_clocks = >>> 0 => use the externally specified num_/clocks (logical) >> =0 => use the default 2 > > Why not let go of this "convenience" and have num_clocks actually mean > number of clocks? Sounds good.. Should I keep the default "bus", "bus_a" on absence of .bus_clocks still, to avoid duplicating objects? Konrad > > Regards, > Bjorn > >> <0 => consider there's zero >> >> ..but maybe that's just me.. if you don't find it ugly, I may just >> go with that. >> >> Konrad >>> >>>> >>>> Konrad >>>>> >>>>> Konrad >>>>>> 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, >>>>>> >>> >>> >>>
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,