linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taniya Das <tdas@codeaurora.org>
To: Stephen Boyd <sboyd@kernel.org>, skannan@codeaurora.org
Cc: Evan Green <evgreen@google.com>,
	rjw@rjwysocki.net, Viresh Kumar <viresh.kumar@linaro.org>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Rajendra Nayak <rnayak@codeaurora.org>,
	anischal@codeaurora.org, devicetree@vger.kernel.org,
	robh@kernel.org, amit.kucheria@linaro.org
Subject: Re: [PATCH v7 2/2] cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver
Date: Wed, 8 Aug 2018 15:45:26 +0530	[thread overview]
Message-ID: <c83e4248-aef2-bb40-8d8e-47d9b2918cc7@codeaurora.org> (raw)
In-Reply-To: <153370933225.220756.12056174025047430491@swboyd.mtv.corp.google.com>



On 8/8/2018 11:52 AM, Stephen Boyd wrote:
> Quoting skannan@codeaurora.org (2018-08-06 13:46:05)
>> On 2018-08-03 15:24, Stephen Boyd wrote:
>>> Quoting skannan@codeaurora.org (2018-08-03 12:52:48)
>>>> On 2018-08-03 12:40, Evan Green wrote:
>>>>> Hi Taniya,
>>>>>
>>>>> On Tue, Jul 24, 2018 at 3:44 AM Taniya Das <tdas@codeaurora.org> wrote:
>>>>>>
>>>>>> +               if (src)
>>>>>> +                       c->table[i].frequency = c->xo_rate * lval /
>>>>>> 1000;
>>>>>> +               else
>>>>>> +                       c->table[i].frequency = INIT_RATE / 1000;
>>>>>
>>>>> I don't know much about how this hardware works, but based on the
>>>>> mask, src has 4 possible values. So does 0 mean INIT_RATE, and 1, 2,
>>>>> and 3 all mean xo_rate?
>>>>>
>>>>> Also, is INIT_RATE really constant? It sounds like gpll0 (or
>>>>> gpll0_out_even?). You're already getting the xo clock, why not get
>>>>> gpll0's real rate as well?
>>>>
>>>> Actually I was about to comment and say NOT to get clocks just to get
>>>> their rate. The XO_RATE is just a multiplication factor. This HW/FW
>>>> can
>>>> change in the future and make the multiplication factor to 1KHz.
>>>
>>> So future changes to this hardware are going to make this register
>>> return the final frequency that we should use? Sounds great! But that
>>> isn't how it's working right now. We need to have XO in the binding
>>> here
>>> so the driver can work with different XO frequencies in case that ever
>>> happens. Same story for GPLL0. Hardcoding this stuff in the driver just
>>> means we'll have to swizzle things in the driver when it changes.
>>
>> XO being a different frequency in a Qualcomm chip is way way less likely
>> than anything else we are discussing here. In the 10+years I've been
>> there this has never changed.
>>
>> So, how about making this binding optional? If it's not present we can
>> make assumptions for XO rate and init rate. That'll handle your
>> hypothetical use case while also being optimized.
> 
> Optional properties are almost never correct for clks. Either the clk
> goes there or it doesn't go there. The only time it's optional is if the
> HW has the choice of generating the clk itself internally or to use an
> external clk as input.
> 
> In this case, it's not optional, it's actually used so marking it
> optional is highly confusing.
> 
>>
>>>> We also
>>>> can't really control any of the clocks going to this block from Linux
>>>> (it's all locked down).
>>>
>>> This shouldn't matter. The clocks going to this hardware block are
>>> described by the firmware to the OS by means of the DT node. If the
>>> firmware or the hardware decides to change the input clks then the
>>> binding can have different clk nodes used.
>>
>> There are tons of clocks that are input to blocks in an SoC that are
>> never controlled by Linux. Or are expose in DT because they are set up
>> ahead of time and can't change. So, why make an exception here?
> 
> Because the driver doesn't have to hard-code some frequency that can
> easily come from the DT, making it more flexible for frequency plan
> changes. It doesn't matter about control of clks at all here, so this
> comparison is just plain wrong.
> 
>>
>>>> The INIT_RATE will
>>>> always be 300 MHz independent of what source it's coming from (as in,
>>>> if
>>>> GPLL0 can't give 300, the HW design will be so that we'll find a
>>>> different source).
>>>>
>>>> So, I'd like to remove any clock bindings for this driver.
>>>
>>> No. Bindings describe how the hardware is connected. Please don't
>>> remove
>>> clocks from the binding just because probe defer is a concern.
>>
>> Binding describes hardware controllable by the OS. That's the reality.
>> Let's not add mandatory clock bindings for clocks that the OS can't do
>> anything about.
>>
> 
> It seems that you believe clks should only be used to turn on/off and
> control rates. That is not the whole truth. Sometimes clks are there
> just to express the clk frequencies that are present in the design so
> that drivers can figure out what to do.
> 

Stephen,

As this clock is not configurable by linux clock drivers and we really 
do not care the parent src(as mentioned by Saravana) to generate the 
300MHz, would it be good to define a fixed rate clock so as to express 
the HW connectivity & frequency?

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation.

--

  reply	other threads:[~2018-08-08 10:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 10:42 [PATCH v7 0/2] cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver Taniya Das
2018-07-24 10:42 ` [PATCH v7 1/2] dt-bindings: cpufreq: Introduce QCOM CPUFREQ Firmware bindings Taniya Das
2018-08-03 23:46   ` Stephen Boyd
2018-08-06 20:54     ` skannan
2018-08-07 11:12       ` Sudeep Holla
2018-08-07 19:24         ` skannan
2018-08-08  2:46           ` Taniya Das
2018-08-08  6:15             ` Stephen Boyd
2018-08-08  8:37               ` Sudeep Holla
2018-07-24 10:42 ` [PATCH v7 2/2] cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver Taniya Das
2018-08-03 19:40   ` Evan Green
2018-08-03 19:52     ` skannan
2018-08-03 22:24       ` Stephen Boyd
2018-08-06 20:46         ` skannan
2018-08-08  6:22           ` Stephen Boyd
2018-08-08 10:15             ` Taniya Das [this message]
2018-08-23 18:38               ` Stephen Boyd
2018-09-23  9:35                 ` Taniya Das
2018-08-29 18:01   ` Matthias Kaehlcke
2018-09-23  9:40     ` Taniya Das
2018-09-24 17:02       ` Matthias Kaehlcke
2018-09-09 14:34   ` Amit Kucheria
2018-09-23  9:43     ` Taniya Das
2018-09-10 19:30   ` Matthias Kaehlcke
2018-09-23  9:48     ` Taniya Das
2018-09-24 16:44       ` Matthias Kaehlcke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c83e4248-aef2-bb40-8d8e-47d9b2918cc7@codeaurora.org \
    --to=tdas@codeaurora.org \
    --cc=amit.kucheria@linaro.org \
    --cc=anischal@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=evgreen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rnayak@codeaurora.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=skannan@codeaurora.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).