Re: [CHECKER] Implementation inconsistencies involving writes

From: Dominik Brodowski
Date: Wed Apr 28 2004 - 15:46:29 EST


On Tue, Apr 27, 2004 at 08:54:15PM -0700, Ken Ashcraft wrote:
> I'm trying to cross check implementations of the same interface for
> errors. I assume that if functions are assigned to the same function
> pointer, they are implementations of a common interface and should be
> consistent with each other.

> [BUG] <linux@xxxxxxxx> not writing policy->governor. looks like it is
> necessary to write a default value there.

It surely _looks like_ it's a bug, but it isn't. cpufreq drivers can either
have a "->target" or a "->setpolicy" function defined in the cpufreq_driver
struct. If it's ->target, ->governor needs to be set, if it's ->setpolicy,
->governor may not be set, or at least should not be set. As there's only
one ->setpolicy cpufreq driver (longrun), it's not as clear as it should be.

The difference between target and setpolicy cpufreq drivers is the
following: on the first type, the CPU can be set to run at a specific
frequency. setpolicy drivers can set the CPU to a frequency range; the CPU
itself at which frequency to run within this range -- an interesting feature
of Transmeta CPUs, which made this distinction necessary.

Dominik

Attachment: pgp00000.pgp
Description: PGP signature