[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150828104202.GC4191@hr-slim.amd.com>
Date: Fri, 28 Aug 2015 18:42:02 +0800
From: Huang Rui <ray.huang@....com>
To: Ingo Molnar <mingo@...nel.org>
CC: Borislav Petkov <bp@...e.de>, Jean Delvare <jdelvare@...e.de>,
"Guenter Roeck" <linux@...ck-us.net>,
Andy Lutomirski <luto@...capital.net>,
"Andreas Herrmann" <herrmann.der.user@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
John Stultz <john.stultz@...aro.org>,
Frédéric Weisbecker <fweisbec@...il.com>,
<lm-sensors@...sensors.org>, <linux-kernel@...r.kernel.org>,
<x86@...nel.org>,
Andreas Herrmann <herrmann.der.user@...glemail.com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
Borislav Petkov <bp@...en8.de>,
"Fengguang Wu" <fengguang.wu@...el.com>,
Aaron Lu <aaron.lu@...el.com>, Tony Li <tony.li@....com>
Subject: Re: [PATCH 10/15] hwmon, fam15h_power: add compute unit accumulated
power
On Fri, Aug 28, 2015 at 10:03:35AM +0200, Ingo Molnar wrote:
>
> * Huang Rui <ray.huang@....com> wrote:
>
> > @@ -249,6 +254,21 @@ static int fam15h_power_init_data(struct pci_dev *f4,
> >
> > data->max_cu_acc_power = tmp;
> >
> > + cores_per_cu = amd_get_cores_per_cu();
> > + cu_num = boot_cpu_data.x86_max_cores / cores_per_cu;
> > +
> > + WARN_ON_ONCE(cu_num > MAX_CUS);
> > +
> > + for (cpu = 0; cpu < cu_num * cores_per_cu; cpu += cores_per_cu) {
>
> so 'cu_num * cores_per_cu' is really a roundabout way to say
> boot_cpu_data.x86_max_cores?
>
Oh, yes. :)
I will update it at v2.
> > + cu = cpu / cores_per_cu;
> > + if (rdmsrl_safe_on_cpu(cpu, MSR_F15H_CU_PWR_ACCUMULATOR,
> > + &data->cu_acc_power[cu])) {
> > + pr_err("Failed to read compute unit power accumulator MSR on core%d\n",
> > + cpu);
>
> Please don't break printk lines mid-line - ignore checkpatch in this case.
>
OK, I got it.
> Also, the message talks about 'core', while a CPU ID is printed.
>
Yes, but actually this value is for the compute unit which the core
belongs to.
E.X. the MSR_F15H_CU_PWR_ACCUMULATOR value is the same between core 0
and core 1. Because they belong to the same compute unit.
Thanks,
Rui
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists