@@ -178,7 +178,7 @@ static int get_pl_prim(struct rapl_domain *rd, int pl, enum pl_prims prim)
178178
179179struct rapl_defaults {
180180 u8 floor_freq_reg_addr ;
181- int (* check_unit )(struct rapl_domain * rd , int cpu );
181+ int (* check_unit )(struct rapl_domain * rd );
182182 void (* set_floor_freq )(struct rapl_domain * rd , bool mode );
183183 u64 (* compute_time_window )(struct rapl_domain * rd , u64 val ,
184184 bool to_raw );
@@ -828,16 +828,16 @@ static int rapl_write_pl_data(struct rapl_domain *rd, int pl,
828828 * power unit : microWatts : Represented in milliWatts by default
829829 * time unit : microseconds: Represented in seconds by default
830830 */
831- static int rapl_check_unit_core (struct rapl_domain * rd , int cpu )
831+ static int rapl_check_unit_core (struct rapl_domain * rd )
832832{
833833 struct reg_action ra ;
834834 u32 value ;
835835
836836 ra .reg = rd -> regs [RAPL_DOMAIN_REG_UNIT ];
837837 ra .mask = ~0 ;
838- if (rd -> rp -> priv -> read_raw (cpu , & ra )) {
838+ if (rd -> rp -> priv -> read_raw (rd -> rp -> lead_cpu , & ra )) {
839839 pr_err ("Failed to read power unit REG 0x%llx on CPU %d, exit.\n" ,
840- ra .reg , cpu );
840+ ra .reg , rd -> rp -> lead_cpu );
841841 return - ENODEV ;
842842 }
843843
@@ -856,16 +856,16 @@ static int rapl_check_unit_core(struct rapl_domain *rd, int cpu)
856856 return 0 ;
857857}
858858
859- static int rapl_check_unit_atom (struct rapl_domain * rd , int cpu )
859+ static int rapl_check_unit_atom (struct rapl_domain * rd )
860860{
861861 struct reg_action ra ;
862862 u32 value ;
863863
864864 ra .reg = rd -> regs [RAPL_DOMAIN_REG_UNIT ];
865865 ra .mask = ~0 ;
866- if (rd -> rp -> priv -> read_raw (cpu , & ra )) {
866+ if (rd -> rp -> priv -> read_raw (rd -> rp -> lead_cpu , & ra )) {
867867 pr_err ("Failed to read power unit REG 0x%llx on CPU %d, exit.\n" ,
868- ra .reg , cpu );
868+ ra .reg , rd -> rp -> lead_cpu );
869869 return - ENODEV ;
870870 }
871871
@@ -1242,7 +1242,7 @@ static int rapl_package_register_powercap(struct rapl_package *rp)
12421242 return ret ;
12431243}
12441244
1245- static int rapl_check_domain (int cpu , int domain , struct rapl_package * rp )
1245+ static int rapl_check_domain (int domain , struct rapl_package * rp )
12461246{
12471247 struct reg_action ra ;
12481248
@@ -1263,7 +1263,7 @@ static int rapl_check_domain(int cpu, int domain, struct rapl_package *rp)
12631263 */
12641264
12651265 ra .mask = ENERGY_STATUS_MASK ;
1266- if (rp -> priv -> read_raw (cpu , & ra ) || !ra .value )
1266+ if (rp -> priv -> read_raw (rp -> lead_cpu , & ra ) || !ra .value )
12671267 return - ENODEV ;
12681268
12691269 return 0 ;
@@ -1292,7 +1292,7 @@ static int rapl_get_domain_unit(struct rapl_domain *rd)
12921292 return - ENODEV ;
12931293 }
12941294
1295- ret = defaults -> check_unit (rd , rd -> rp -> lead_cpu );
1295+ ret = defaults -> check_unit (rd );
12961296 if (ret )
12971297 return ret ;
12981298
@@ -1334,14 +1334,14 @@ static void rapl_detect_powerlimit(struct rapl_domain *rd)
13341334/* Detect active and valid domains for the given CPU, caller must
13351335 * ensure the CPU belongs to the targeted package and CPU hotlug is disabled.
13361336 */
1337- static int rapl_detect_domains (struct rapl_package * rp , int cpu )
1337+ static int rapl_detect_domains (struct rapl_package * rp )
13381338{
13391339 struct rapl_domain * rd ;
13401340 int i ;
13411341
13421342 for (i = 0 ; i < RAPL_DOMAIN_MAX ; i ++ ) {
13431343 /* use physical package id to read counters */
1344- if (!rapl_check_domain (cpu , i , rp )) {
1344+ if (!rapl_check_domain (i , rp )) {
13451345 rp -> domain_map |= 1 << i ;
13461346 pr_info ("Found RAPL domain %s\n" , rapl_domain_names [i ]);
13471347 }
@@ -1445,7 +1445,7 @@ struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv)
14451445 topology_physical_package_id (cpu ));
14461446
14471447 /* check if the package contains valid domains */
1448- if (rapl_detect_domains (rp , cpu )) {
1448+ if (rapl_detect_domains (rp )) {
14491449 ret = - ENODEV ;
14501450 goto err_free_package ;
14511451 }
0 commit comments