Re: [PATCH][try 2] architectural pstate driver for powernow-k8

From: Andy Whitcroft
Date: Thu Oct 11 2007 - 04:00:48 EST


On Tue, Oct 09, 2007 at 03:43:20PM -0500, Mark Langsdorf wrote:
> On Tuesday 09 October 2007 15:06, Andi Kleen wrote:
> > "Mark Langsdorf" <mark.langsdorf@xxxxxxx> writes:
> >
> > > This patch should apply cleanly to the 2.6.22.6 kernel.
> >
> > Isn't that a little old? The earliest this could be merged
> > is the upcomming 2.6.24 tree. Best you submit it against .23
> > or better -mm.
>
> Good point.
>
> This patch should apply cleanly to the 2.6.23-rc8-mm2 kernel.  It changes
> the powernow-k8 driver code that deals with 3rd generation Opteron, Phenom,
> and later processors to match the architectual pstate driver described
> in the AMD64 Architecture Programmer's Manual Volume 2 Chapter 18.  The
> initial implementation of the hardware pstate driver for PowerNow!
> used some processor-version specific features, and would not be
> maintainable in the long term as the processor features changed.
> This architectural driver should work on all future AMD processors.
>
> -Mark Langsdorf
> Operating System Resarch Center
> AMD
>
> Signed-off-by <mark.langsdorf@xxxxxxx>
> Acked-by <andreas.herrmann3@xxxxxxx>
[...]
> /* get fid did for hardware pstate transition */
> pstate = index & HW_PSTATE_MASK;
> - if (pstate > MAX_HW_PSTATE)
> + if (pstate > data->max_hw_pstate);
> return 0;

checkpatch picked up this dodgy if. I suspect that the ';' is wrong
from the context.

> - fid = (index & HW_FID_INDEX_MASK) >> HW_FID_INDEX_SHIFT;
> - did = (index & HW_DID_INDEX_MASK) >> HW_DID_INDEX_SHIFT;
> - freqs.old = find_khz_freq_from_fiddid(data->currfid, data->currdid);
> - freqs.new = find_khz_freq_from_fiddid(fid, did);
> + freqs.old = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
> + freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);

-apw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/