All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	Lists linaro-kernel <linaro-kernel@lists.linaro.org>
Subject: Re: [PATCH] cpufreq: add frequency table to at32ap driver
Date: Tue, 13 Aug 2013 14:39:45 +0530	[thread overview]
Message-ID: <CAKohpokqMt2L_r3WR=vTPyW0kUS5wZ8FxS3ii=B=H=Yizuu=ig@mail.gmail.com> (raw)
In-Reply-To: <20130813090613.GA1850@samfundet.no>

On 13 August 2013 14:36, Hans-Christian Egtvedt <egtvedt@samfundet.no> wrote:
> Around Tue 13 Aug 2013 12:28:04 +0530 or thereabout, Viresh Kumar wrote:

>> .verify() looks to be pretty straight forward and so can be replaced by
>> the generic routine I wrote for that..
>
> I though you already had a patch to swap verify, hence the need to cleanup
> the cpufreq driver first to provide a frequency table?

Yes, that's what.. That generic routine can be used instead of your .verify()..

>> But .target() does some calculations which aren't very straight forward
>> to replace..
>>
>> I believe I can remove all below code and simply get the frequency
>> as suggested by cpufreq-core ??
>>
>>       /* Convert target_freq from kHz to Hz */
>>       freq = clk_round_rate(cpuclk, target_freq * 1000);
>>
>>       /* Check if policy->min <= new_freq <= policy->max */
>>       if(freq < (policy->min * 1000) || freq > (policy->max * 1000))
>>               return -EINVAL;
>
> This sanity checks that the frequency the system clock can generate is within
> the policy limits. It is initially feed the target_freq frequency.

This is already done in core.

> These values are already calculated during init and added to the table, so
> one shouldn't need to perform the clk_round_rate() call anymore.

good.

>>       pr_debug("cpufreq: requested frequency %u Hz\n", target_freq * 1000);
>>
>>       freqs.new = (freq + 500) / 1000;
>>       freqs.flags = 0;
>
> I don't know the details of how the cpufreq-core suggests frequencies. If it
> looks up in the frequency table, then we don't need this sanity check in
> .target().

Yes, it just picks the best match from freq table, though here is the actual
implementation..

https://lkml.org/lkml/2013/8/12/404

  reply	other threads:[~2013-08-13  9:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 19:10 [PATCH] cpufreq: add frequency table to at32ap driver Hans-Christian Egtvedt
2013-08-13  5:08 ` Viresh Kumar
2013-08-13  5:11   ` Viresh Kumar
2013-08-13  6:52     ` Hans-Christian Egtvedt
2013-08-13  6:58       ` Viresh Kumar
2013-08-13  9:06         ` Hans-Christian Egtvedt
2013-08-13  9:09           ` Viresh Kumar [this message]
2013-08-13 13:30             ` Viresh Kumar
2013-08-14  6:07               ` Hans-Christian Egtvedt
2013-08-14  6:09                 ` Viresh Kumar
2013-08-13  6:49   ` Hans-Christian Egtvedt

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='CAKohpokqMt2L_r3WR=vTPyW0kUS5wZ8FxS3ii=B=H=Yizuu=ig@mail.gmail.com' \
    --to=viresh.kumar@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=egtvedt@samfundet.no \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.