@@ -178,7 +178,7 @@ static int get_pl_prim(struct rapl_domain *rd, int pl, enum pl_prims prim)
178
178
179
179
struct rapl_defaults {
180
180
u8 floor_freq_reg_addr ;
181
- int (* check_unit )(struct rapl_domain * rd , int cpu );
181
+ int (* check_unit )(struct rapl_domain * rd );
182
182
void (* set_floor_freq )(struct rapl_domain * rd , bool mode );
183
183
u64 (* compute_time_window )(struct rapl_domain * rd , u64 val ,
184
184
bool to_raw );
@@ -828,16 +828,16 @@ static int rapl_write_pl_data(struct rapl_domain *rd, int pl,
828
828
* power unit : microWatts : Represented in milliWatts by default
829
829
* time unit : microseconds: Represented in seconds by default
830
830
*/
831
- static int rapl_check_unit_core (struct rapl_domain * rd , int cpu )
831
+ static int rapl_check_unit_core (struct rapl_domain * rd )
832
832
{
833
833
struct reg_action ra ;
834
834
u32 value ;
835
835
836
836
ra .reg = rd -> regs [RAPL_DOMAIN_REG_UNIT ];
837
837
ra .mask = ~0 ;
838
- if (rd -> rp -> priv -> read_raw (cpu , & ra )) {
838
+ if (rd -> rp -> priv -> read_raw (rd -> rp -> lead_cpu , & ra )) {
839
839
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 );
841
841
return - ENODEV ;
842
842
}
843
843
@@ -856,16 +856,16 @@ static int rapl_check_unit_core(struct rapl_domain *rd, int cpu)
856
856
return 0 ;
857
857
}
858
858
859
- static int rapl_check_unit_atom (struct rapl_domain * rd , int cpu )
859
+ static int rapl_check_unit_atom (struct rapl_domain * rd )
860
860
{
861
861
struct reg_action ra ;
862
862
u32 value ;
863
863
864
864
ra .reg = rd -> regs [RAPL_DOMAIN_REG_UNIT ];
865
865
ra .mask = ~0 ;
866
- if (rd -> rp -> priv -> read_raw (cpu , & ra )) {
866
+ if (rd -> rp -> priv -> read_raw (rd -> rp -> lead_cpu , & ra )) {
867
867
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 );
869
869
return - ENODEV ;
870
870
}
871
871
@@ -1242,7 +1242,7 @@ static int rapl_package_register_powercap(struct rapl_package *rp)
1242
1242
return ret ;
1243
1243
}
1244
1244
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 )
1246
1246
{
1247
1247
struct reg_action ra ;
1248
1248
@@ -1263,7 +1263,7 @@ static int rapl_check_domain(int cpu, int domain, struct rapl_package *rp)
1263
1263
*/
1264
1264
1265
1265
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 )
1267
1267
return - ENODEV ;
1268
1268
1269
1269
return 0 ;
@@ -1292,7 +1292,7 @@ static int rapl_get_domain_unit(struct rapl_domain *rd)
1292
1292
return - ENODEV ;
1293
1293
}
1294
1294
1295
- ret = defaults -> check_unit (rd , rd -> rp -> lead_cpu );
1295
+ ret = defaults -> check_unit (rd );
1296
1296
if (ret )
1297
1297
return ret ;
1298
1298
@@ -1334,14 +1334,14 @@ static void rapl_detect_powerlimit(struct rapl_domain *rd)
1334
1334
/* Detect active and valid domains for the given CPU, caller must
1335
1335
* ensure the CPU belongs to the targeted package and CPU hotlug is disabled.
1336
1336
*/
1337
- static int rapl_detect_domains (struct rapl_package * rp , int cpu )
1337
+ static int rapl_detect_domains (struct rapl_package * rp )
1338
1338
{
1339
1339
struct rapl_domain * rd ;
1340
1340
int i ;
1341
1341
1342
1342
for (i = 0 ; i < RAPL_DOMAIN_MAX ; i ++ ) {
1343
1343
/* use physical package id to read counters */
1344
- if (!rapl_check_domain (cpu , i , rp )) {
1344
+ if (!rapl_check_domain (i , rp )) {
1345
1345
rp -> domain_map |= 1 << i ;
1346
1346
pr_info ("Found RAPL domain %s\n" , rapl_domain_names [i ]);
1347
1347
}
@@ -1445,7 +1445,7 @@ struct rapl_package *rapl_add_package(int cpu, struct rapl_if_priv *priv)
1445
1445
topology_physical_package_id (cpu ));
1446
1446
1447
1447
/* check if the package contains valid domains */
1448
- if (rapl_detect_domains (rp , cpu )) {
1448
+ if (rapl_detect_domains (rp )) {
1449
1449
ret = - ENODEV ;
1450
1450
goto err_free_package ;
1451
1451
}
0 commit comments