public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <borislav.petkov@amd.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Langsdorf <mark.langsdorf@amd.com>,
	<linux-kernel@vger.kernel.org>, <cpufreq@vger.kernel.org>,
	<bhavna.sarathy@amd.com>, <joachim.deguara@amd.com>
Subject: Re: [PATCH 2/3] [cpufreq] powernow-k8: add core performance boost support
Date: Thu, 4 Mar 2010 22:43:59 +0100	[thread overview]
Message-ID: <20100304214359.GA29002@aftab> (raw)
In-Reply-To: <20100304132328.3391dba5.akpm@linux-foundation.org>

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


      reply	other threads:[~2010-03-04 21:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 20:58 [PATCH 2/3] [cpufreq] powernow-k8: add core performance boost support Mark Langsdorf
2010-03-04 21:23 ` Andrew Morton
2010-03-04 21:43   ` Borislav Petkov [this message]

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=20100304214359.GA29002@aftab \
    --to=borislav.petkov@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhavna.sarathy@amd.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=joachim.deguara@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.langsdorf@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox