From: Eric Anholt <eric@anholt.net>
To: Remi Pommarel <repk@triplefau.lt>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Lee Jones <lee@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
linux-rpi-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] clk: bcm2835: Support for clock parent selection
Date: Mon, 09 Nov 2015 08:38:50 -0800 [thread overview]
Message-ID: <87h9kvw2jp.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20151105185336.GJ13534@cruxbox>
[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]
Remi Pommarel <repk@triplefau.lt> writes:
> Hi,
>
> On Wed, Nov 04, 2015 at 06:03:31PM -0800, Eric Anholt wrote:
>
> [...]
>
>>
>> It looks like you've dropped the use of the divisor off of the PLL
>> channel when setting a rate. That seems bad for all the other clocks in
>> the system, and a feature we couldn't lose.
>
> Sorry, but I'm not sure to understand your point here. Are you afraid
> that clocks such as PWM, H264, etc, have lost the ability to divide the
> rate from the PLL or oscillator clock they cosume as source ?
>
> If so, I think it's ok. If I'm not wrong here, clk_set_rate() first
> calls clk->determinate_rate() then calls clk->set_rate(). This patch
> makes bcm2835_clock_determine_source() to only select the parent to use
> and does not set the clock's rate itself. The clock's rate is set later
> on when bcm2835_clock_set_parent() is called.
>
> bcm2835_clock_set_parent() still divides the parent rate so we are not
> loosing this feature here.
I see. You're leaving req->rate as-is, so that it gets passed back in
on the set_rate() call. Since you've chosen only a parent with a
rate greater than ours, we know we'll be able to divide into it.
This has the downside that anything using the min/max rate clamping
doesn't get to know before setting that we might be out of bounds.
> It would probably be better to have bcm2835_clock_determine_source()
> selects the parent by choosing the one that provides the rate which,
> after being divided, generates the highest but lower rate out of the
> PWM clock itself.
>
> Moreover, if you agree with the above modification I see no reason to
> not call it "bcm2835_clock_determine_rate"
This sounds like what the function should be doing.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-11-09 16:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 23:08 [PATCH 0/2] Add PWM clock support for bcm2835 Remi Pommarel
2015-11-04 23:08 ` [PATCH 1/2] clk: bcm2835: Support for clock parent selection Remi Pommarel
2015-11-05 2:03 ` Eric Anholt
2015-11-05 18:53 ` Remi Pommarel
2015-11-09 16:38 ` Eric Anholt [this message]
2015-11-04 23:08 ` [PATCH 2/2] clk: bcm2835: Add PWM clock support Remi Pommarel
2015-11-05 2:17 ` Eric Anholt
2015-11-05 18:59 ` Remi Pommarel
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=87h9kvw2jp.fsf@eliezer.anholt.net \
--to=eric@anholt.net \
--cc=lee@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=repk@triplefau.lt \
--cc=sboyd@codeaurora.org \
--cc=swarren@wwwdotorg.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