From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
xen-devel@lists.xensource.com, bp@suse.de,
stefan.bader@canonical.com
Subject: Re: [PATCH] ACPI: Add fixups for AMD P-state figures.
Date: Wed, 6 Mar 2013 10:53:07 -0500 [thread overview]
Message-ID: <20130306155307.GB13118@phenom.dumpdata.com> (raw)
In-Reply-To: <5137150502000078000C375D@nat28.tlf.novell.com>
On Wed, Mar 06, 2013 at 09:05:57AM +0000, Jan Beulich wrote:
> >>> On 05.03.13 at 22:33, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > +static void amd_fixup_frequency(struct xen_processor_px *px)
> > +{
> > + u32 hi, lo, fid, did;
> > + int index = px->control & 0x00000007;
> > +
> > + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
> > + return;
>
> This is pointless, the driver as a whole is already AMD specific.
>
> > +
> > + if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
> > + || boot_cpu_data.x86 == 0x11) {
>
> Instead I wonder whether this could (properly inverted) serve as
> an early return condition, reducing indentation on the subsequent
> block.
>
> > + rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
> > + /*
> > + * MSR C001_0064+:
> > + * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
> > + */
> > + if (!(hi & (1UL << 31)))
> > + return;
> > +
> > + fid = lo & 0x3f;
> > + did = (lo >> 6) & 7;
> > + if (boot_cpu_data.x86 == 0x10)
> > + px->core_frequency = (100 * (fid + 0x10)) >> did;
> > + else
> > + px->core_frequency = (100 * (fid + 8)) >> did;
>
> 0x10 vs 8? Please settle on decimal (preferred) or hex numbers in
> a calculation like this.
>
> > + }
> > +}
>
> And as Boris already pointed out - indentation here should be
> consistent in itself _and_ with the rest of the file.
I not sure if it is my editor - but under vim it looks fine. It is just
when I send it and look under 'mutt' then I see it.
Either way, let me make the changes you suggested and send out
a revised patch shortly.
>
> > +
> > +static void amd_fixup_freq(struct processor_performance *perf)
> > +{
> > +
> > + int i;
>
> unsigned int
>
> Jan
>
> > +
> > + for (i = 0; i < perf->state_count; i++)
> > + amd_fixup_frequency(&perf->states[i]);
> > +
> > +}
> > static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
> > {
> > struct acpi_cpufreq_data *data;
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
next prev parent reply other threads:[~2013-03-06 15:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 19:45 [PATCH] ACPI: Add fixups for AMD P-state figures Konrad Rzeszutek Wilk
2013-03-05 20:22 ` Boris Ostrovsky
2013-03-05 21:33 ` Konrad Rzeszutek Wilk
2013-03-05 22:12 ` Boris Ostrovsky
2013-03-06 9:05 ` Jan Beulich
2013-03-06 10:30 ` Borislav Petkov
2013-03-06 15:53 ` Konrad Rzeszutek Wilk [this message]
2013-03-06 9:48 ` Stefan Bader
2013-03-06 15:51 ` Konrad Rzeszutek Wilk
2013-03-06 21:37 ` Konrad Rzeszutek Wilk
2013-03-07 8:45 ` Stefan Bader
2013-03-07 14:17 ` Konrad Rzeszutek Wilk
2013-03-07 14:55 ` Stefan Bader
-- strict thread matches above, loose matches on Subject: below --
2013-03-07 18:49 Konrad Rzeszutek Wilk
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=20130306155307.GB13118@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@suse.de \
--cc=stefan.bader@canonical.com \
--cc=xen-devel@lists.xensource.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.