lkml.org 
[lkml]   [2010]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] [cpufreq] powernow-k8: add core performance boost support
From: Andrew Morton <akpm@linux-foundation.org>
Date: Thu, Mar 04, 2010 at 01:23:28PM -0800

Hi Andrew,

[..]

> > +/* CPB 0=disable, 1=enable. */
> > +static void cpb_toggle(u32 t)
> > +{
> > + if (cpb_capable) {
> > + u32 lo, hi;
> > + rdmsr(MSR_K7_HWCR, lo, hi);
> > +
>
> The newline usually goes after end-of-locals, before start-of-code.

Done.

> > + if (t)
> > + lo &= ~(1 << 25);
> > + else
> > + lo |= (1 << 25);
> > +
> > + wrmsr(MSR_K7_HWCR, lo, hi);
> > +
> > + printk(KERN_ERR "CPB: %s.\n", (t ? "on" : "off"));
>
> Why KERN_ERR? It's not an error?
>
> Do we want a printk here at all? Under which circumstances will it come
> out? Does it have sufficient context for people to be able to
> understand what it means, and which subsystem it's referring to? If
> you phone your Aunt Tillie and tell her "CPB: on", will she understand
> what you mean?

This isn't actually supposed to be there - it was there only for
debugging.

These patches weren't supposed to go out just yet so please drop them
from your tree for now - I'll have corrected versions with proper
changelogs soon.

> > --- a/include/linux/cpufreq.h
> > +++ b/include/linux/cpufreq.h
> > @@ -104,6 +104,10 @@ struct cpufreq_policy {
> >
> > struct kobject kobj;
> > struct completion kobj_unregister;
> > +
> > + struct flags {
> > + unsigned long cpb:1; /* toggle CPB on this cpu */
> > + } flags;
> > };
>
> Bear in mind that the compiler provides no atomicity support for
> bitfields. So if someone later comes along and adds a new field to
> `flags', they will need to provide external synchronisation (ie: a
> lock) to protect that field during modifications to `cpb'.
>
> IOW, this is a bit of a hand-grenade.

Ok, I'll switch to a unsigned long for the flags.

Thanks.

--
Regards/Gruss,
Boris.

-
Advanced Micro Devices, Inc.
Operating Systems Research Center



\
 
 \ /
  Last update: 2010-03-04 22:47    [W:0.750 / U:1.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site