From: Sean Anderson <sean.anderson@seco.com>
To: Stephen Boyd <sboyd@kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Vinod Koul <vkoul@kernel.org>,
linux-phy@lists.infradead.org
Cc: Rob Herring <robh+dt@kernel.org>,
Bagas Sanjaya <bagasdotme@gmail.com>,
devicetree@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linuxppc-dev@lists.ozlabs.org,
Ioana Ciornei <ioana.ciornei@nxp.com>,
linux-arm-kernel@lists.infradead.org,
Camelia Alexandra Groza <camelia.groza@nxp.com>,
Madalin Bucur <madalin.bucur@nxp.com>,
Jonathan Corbet <corbet@lwn.net>,
Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v8 4/9] phy: fsl: Add Lynx 10G SerDes driver
Date: Tue, 1 Nov 2022 19:27:21 -0400 [thread overview]
Message-ID: <45463950-7a4f-758d-d6a1-b8fdf9bfd319@seco.com> (raw)
In-Reply-To: <20221101201020.B6180C433C1@smtp.kernel.org>
On 11/1/22 16:10, Stephen Boyd wrote:
> Quoting Sean Anderson (2022-10-28 09:33:59)
>> On 10/28/22 12:13, Sean Anderson wrote:
>> > On 10/27/22 19:03, Stephen Boyd wrote:
>> >>> + ref = devm_clk_get(dev, ref_name);
>> >>> + if (IS_ERR(clk->ref)) {
>> >>> + ret = PTR_ERR(clk->ref);
>> >>> + dev_err_probe(dev, ret, "could not get %s\n", ref_name);
>> >>> + goto out;
>> >>> + }
>> >>> +
>> >>> + clk->ref = __clk_get_hw(ref);
>> >>
>> >> Please don't use __clk_get_hw() for this. Instead use struct
>> >> clk_parent_data and set a DT index in the index member to map to this
>> >> clk.
>> >
>> > OK
>>
>> Oh, I remember why I did this. I need the reference clock for clk_hw_round_rate,
>> which is AFAICT the only correct way to implement round_rate.
>>
>
> Is the reference clk the parent of the clk implementing
> clk_ops::round_rate()?
Yes. We may be able to produce a given output with multiple reference
rates. However, the clock API provides no mechanism to say "Don't ask
for the parent clock to be rate X, you just tried it and the parent
clock can't support it." So instead, we loop over the possible reference
rates and pick the first one which the parent says it can round to.
--Sean
next prev parent reply other threads:[~2022-11-01 23:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 19:11 [PATCH v8 0/9] phy: Add support for Lynx 10G SerDes Sean Anderson
2022-10-27 19:11 ` [PATCH v8 2/9] dt-bindings: phy: Add Lynx 10G phy binding Sean Anderson
2022-10-27 19:11 ` [PATCH v8 3/9] dt-bindings: clock: Add ids for Lynx 10g PLLs Sean Anderson
2022-10-27 21:49 ` Stephen Boyd
2022-10-27 21:59 ` Sean Anderson
2022-10-27 19:11 ` [PATCH v8 4/9] phy: fsl: Add Lynx 10G SerDes driver Sean Anderson
2022-10-27 23:03 ` Stephen Boyd
2022-10-28 16:13 ` Sean Anderson
2022-10-28 16:33 ` Sean Anderson
2022-11-01 20:10 ` Stephen Boyd
2022-11-01 23:27 ` Sean Anderson [this message]
2022-12-07 2:17 ` Stephen Boyd
2022-12-08 15:36 ` Sean Anderson
2022-12-12 23:37 ` Stephen Boyd
2022-12-13 22:34 ` Sean Anderson
2022-11-01 20:07 ` Stephen Boyd
2022-11-01 23:41 ` Sean Anderson
2022-10-29 9:11 ` Bagas Sanjaya
2022-10-31 15:33 ` Sean Anderson
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=45463950-7a4f-758d-d6a1-b8fdf9bfd319@seco.com \
--to=sean.anderson@seco.com \
--cc=bagasdotme@gmail.com \
--cc=camelia.groza@nxp.com \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=ioana.ciornei@nxp.com \
--cc=kishon@ti.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=madalin.bucur@nxp.com \
--cc=mturquette@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=vkoul@kernel.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