[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIjT6U24iwkBkqHW@gerhold.net>
Date: Tue, 13 Jun 2023 22:39:05 +0200
From: Stephan Gerhold <stephan@...hold.net>
To: Konrad Dybcio <konrad.dybcio@...aro.org>
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Georgi Djakov <djakov@...nel.org>,
Leo Yan <leo.yan@...aro.org>,
Evan Green <evgreen@...omium.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Marijn Suijten <marijn.suijten@...ainline.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-clk@...r.kernel.org, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v4 17/22] interconnect: qcom: icc-rpm: Control bus rpmcc
from icc
On Tue, Jun 13, 2023 at 10:36:15PM +0200, Stephan Gerhold wrote:
> Not even compile tested this time!
Would have probably been worth it, sigh:
>
> /*
> * Downstream checks whether the requested rate is zero, but it makes little sense
> * to vote for a value that's below the lower threshold, so let's not do so.
> */
> if (qp->keep_alive)
> agg_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]
> = max(ICC_BUS_CLK_MIN_RATE, agg_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]);
>
> /* Some providers have a non-RPM-owned bus clock - convert kHz->Hz for the CCF */
> if (qp->bus_clk) {
> rate = max_t(u64, agg_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE],
> agg_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]);
> /* ARM32 caps clk_set_rate arg to u32.. Nothing we can do about that! */
> reate = min_t(u64, 1000ULL * rate, ULONG_MAX);
> return clk_set_rate(qp->bus_clk, rate);
> }
>
> for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) {
> /* RPM only accepts <=INT_MAX rates */
> rate = min_t(u64, active_rate, INT_MAX);
-> rate = min_t(u64, agg_clk_rate[i], INT_MAX);
> if (rate == qp->bus_clk_rate[i])
> continue;
>
> ret = qcom_icc_rpm_set_bus_rate(qp->bus_clk_desc, rate, i);
> if (ret)
> return ret;
>
> /* Cache the rate after we've successfully commited it to RPM */
> qp->bus_clk_rate[i] = rate;
> }
Powered by blists - more mailing lists