All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Piel <Eric.Piel@lifl.fr>
To: Ian Campbell <icampbell@arcom.com>
Cc: cpufreq@lists.linux.org.uk
Subject: Re: [PATCH] CPUFreq Support for PXA255
Date: Thu, 14 Jul 2005 15:32:30 +0200	[thread overview]
Message-ID: <42D6696E.4080505@lifl.fr> (raw)
In-Reply-To: <1121341256.10537.12.camel@icampbell-debian>

14.07.2005 13:40, Ian Campbell wrote/a écrit:
> Hi, 
Hello,

I don't know so much about cpufreq, so only very few comments:
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ 2.6/arch/arm/mach-pxa/cpu-pxa.c	2005-07-14 10:57:04.000000000 +0100
> +
> +static void pxa_select_freq_table(struct cpufreq_policy *policy,
> +				  pxa_freqs_t ** settings,
> +				  struct cpufreq_frequency_table **table)
> +{
> +	if (strcmp(policy->governor->name, "performance") == 0) {
> +		if (settings)
> +			*settings = pxa255_run_freqs;
> +		if (table)
> +			*table = pxa255_run_freq_table;
> +	} else {
> +		if (settings)
> +			*settings = pxa255_turbo_freqs;
> +		if (table)
> +			*table = pxa255_turbo_freq_table;
> +	}
> +}
So your driver depends on a hard-coded name of a governor ? It seems 
suspicious...


> +
> +static int pxa_set_target(struct cpufreq_policy *policy,
> +			  unsigned int target_freq, unsigned int relation)
> +{
:
> +
> +	/* Get the current policy */
> +	pxa_select_freq_table(policy, &pxa_freq_settings, &pxa_freqs_table);
> +
> +	/* Lookup the next frequency */
> +	if (cpufreq_frequency_table_target(policy, pxa_freqs_table,
> +					   target_freq, relation, &idx))
> +		return -EINVAL;
> +
> +	freqs.old = get_clk_frequency_khz(0);
> +	freqs.new = pxa_freq_settings[idx].khz;
It's probably a good idea to include such a code:
	if (freqs.new == freqs.old)
		return 0;

This avoid to do lots of things while it would change nothing.


> +static int pxa_cpufreq_init(struct cpufreq_policy *policy)
> +{
:
> +	policy->cpuinfo.min_freq = PXA25x_MIN_FREQ;
> +	policy->cpuinfo.transition_latency = 1000;	/* FIXME: 1 ms, assumed */
If you want to say 1ms, you have to write 1000000 (it's in nanosecond). 
This value is quite important for the ondemand governor so if you have 
better knowledge of the latency, don't hesitate to fix it!

> +
> +static struct cpufreq_driver pxa_cpufreq_driver = {
> +	.verify	= pxa_verify_policy,
> +	.target	= pxa_set_target,
> +	.init	= pxa_cpufreq_init,
> +	.get	= pxa_cpufreq_get,
> +	.name	= "PXA25x",
> +};
Not sure it's a good idea to put the name in uppercase.

Eric

  reply	other threads:[~2005-07-14 13:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-14 11:40 [PATCH] CPUFreq Support for PXA255 Ian Campbell
2005-07-14 13:32 ` Eric Piel [this message]
2005-07-14 14:11   ` Ian Campbell
2005-07-15 16:41 ` Dominik Brodowski
2005-07-18 11:02   ` Ian Campbell
2005-07-18 12:01     ` Dominik Brodowski
2005-07-18 12:11       ` Ian Campbell
2005-07-18 14:31         ` Ian Campbell
2005-07-18 15:03           ` Dominik Brodowski
2005-07-18 15:06             ` Ian Campbell
2005-07-19 10:15 ` Ian Campbell
2005-07-23 19:16   ` Dominik Brodowski
2005-07-25 11:54     ` Ian Campbell

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=42D6696E.4080505@lifl.fr \
    --to=eric.piel@lifl.fr \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=icampbell@arcom.com \
    /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.