From: Bjorn Andersson Subject: Re: [RFC PATCH] clk: qcom: clk-rpmh: Add IPA clock support Date: Wed, 5 Dec 2018 23:33:04 -0800 Message-ID: <20181206073304.GB5232@tuxbook-pro> References: <1543895413-1553-1-git-send-email-daidavid1@codeaurora.org> <1543895413-1553-2-git-send-email-daidavid1@codeaurora.org> <154395145491.88331.1174781210192403998@swboyd.mtv.corp.google.com> <8dafe631-4b16-94cd-392e-84728f2bb382@linaro.org> <154396284056.88331.12279283832884556349@swboyd.mtv.corp.google.com> <154399414865.88331.2447825064224349951@swboyd.mtv.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <154399414865.88331.2447825064224349951@swboyd.mtv.corp.google.com> Sender: linux-kernel-owner@vger.kernel.org To: Stephen Boyd Cc: Alex Elder , David Dai , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, georgi.djakov@linaro.org, evgreen@google.com, tdas@codeaurora.org List-Id: linux-arm-msm@vger.kernel.org On Tue 04 Dec 23:15 PST 2018, Stephen Boyd wrote: > Quoting David Dai (2018-12-04 17:14:10) > > > > On 12/4/2018 2:34 PM, Stephen Boyd wrote: > > > Quoting Alex Elder (2018-12-04 13:41:47) > > >> On 12/4/18 1:24 PM, Stephen Boyd wrote: > > >>> Quoting David Dai (2018-12-03 19:50:13) > > >>>> Add IPA clock support by extending the current clk rpmh driver to support > > >>>> clocks that are managed by a different type of RPMh resource known as > > >>>> Bus Clock Manager(BCM). > > >>> Yes, but why? Does the IPA driver need to set clk rates and that somehow > > >>> doesn't work as a bandwidth request? > > >> The IPA core clock is a *clock*, not a bus. Representing it as if > > >> it were a bus, abusing the interconnect interface--pretending a bandwidth > > >> request is really a clock rate request--is kind of kludgy. I think Bjorn > > >> and David (and maybe Georgi? I don't know) decided a long time ago that > > >> exposing this as a clock is the right way to do it. I agree with that. > > >> > > > But then we translate that clock rate into a bandwidth request to the > > > BCM hardware? Seems really weird because it's doing the opposite of what > > > you say is abusive. What does the IPA driver plan to do with this clk? > > > Calculate a frequency by knowing that it really boils down to some > > > bandwidth that then gets converted back into some clock frequency? Do we > > > have the user somewhere that can be pointed to? > > The clock rate is translated into a unitless threshold value sent as > > part of the rpmh msg > > that BCM takes to select a performance. In this case, the unit > > conversion is based on > > the unit value read from the aux data which is in Khz. I understand that > > this wasn't > > explicitly mentioned anywhere and I'll improve on that next patch. > > How is this different from bus bandwidth requests? In those cases the > bandwidth is calculated in bits per second or something like that, and > written to the hardware so it can convert that bandwidth into kHz and > set a bus clk frequency in the clock controller? So in the IPA case > we've skipped the bps to kHz conversion step and gone straight to the > clk frequency setting part? Is a BCM able to aggregate units of > bandwidth or kHz depending on how it's configured and this BCM is > configured for kHz? > My objection to the use of msm_bus vs clock framework is not related to how the actual interface of configuring the hardware looks like. It's simply a matter of how this is represented in software, between some provider and the IPA driver. The IPA driver wants the IPA block to tick at 75MHz and I do not think it's appropriate to achieve that by requesting a path between IPA Core and IPA Core of 75000000 Kbytes/s. Regards, Bjorn