mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
hwmon: (fam15h_power) Use topology_core_id()
Use the provided topology helper function instead of fiddling in cpu_data. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Tested-by: Sohil Mehta <sohil.mehta@intel.com> Tested-by: Michael Kelley <mikelley@microsoft.com> Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20230814085112.506988471@linutronix.de
This commit is contained in:
parent
09253672b5
commit
94f0b3978e
1 changed files with 3 additions and 4 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <linux/cpumask.h>
|
#include <linux/cpumask.h>
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
#include <linux/topology.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/msr.h>
|
#include <asm/msr.h>
|
||||||
|
|
||||||
|
@ -134,15 +135,13 @@ static DEVICE_ATTR_RO(power1_crit);
|
||||||
static void do_read_registers_on_cu(void *_data)
|
static void do_read_registers_on_cu(void *_data)
|
||||||
{
|
{
|
||||||
struct fam15h_power_data *data = _data;
|
struct fam15h_power_data *data = _data;
|
||||||
int cpu, cu;
|
int cu;
|
||||||
|
|
||||||
cpu = smp_processor_id();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* With the new x86 topology modelling, cpu core id actually
|
* With the new x86 topology modelling, cpu core id actually
|
||||||
* is compute unit id.
|
* is compute unit id.
|
||||||
*/
|
*/
|
||||||
cu = cpu_data(cpu).cpu_core_id;
|
cu = topology_core_id(smp_processor_id());
|
||||||
|
|
||||||
rdmsrl_safe(MSR_F15H_CU_PWR_ACCUMULATOR, &data->cu_acc_power[cu]);
|
rdmsrl_safe(MSR_F15H_CU_PWR_ACCUMULATOR, &data->cu_acc_power[cu]);
|
||||||
rdmsrl_safe(MSR_F15H_PTSC, &data->cpu_sw_pwr_ptsc[cu]);
|
rdmsrl_safe(MSR_F15H_PTSC, &data->cpu_sw_pwr_ptsc[cu]);
|
||||||
|
|
Loading…
Reference in a new issue