@@ -1041,7 +1041,7 @@ static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target)
1041
1041
return _cpu_down (cpu , 0 , target );
1042
1042
}
1043
1043
1044
- static int do_cpu_down (unsigned int cpu , enum cpuhp_state target )
1044
+ static int cpu_down (unsigned int cpu , enum cpuhp_state target )
1045
1045
{
1046
1046
int err ;
1047
1047
@@ -1051,11 +1051,18 @@ static int do_cpu_down(unsigned int cpu, enum cpuhp_state target)
1051
1051
return err ;
1052
1052
}
1053
1053
1054
- int cpu_down (unsigned int cpu )
1054
+ /**
1055
+ * cpu_device_down - Bring down a cpu device
1056
+ * @dev: Pointer to the cpu device to offline
1057
+ *
1058
+ * This function is meant to be used by device core cpu subsystem only.
1059
+ *
1060
+ * Other subsystems should use remove_cpu() instead.
1061
+ */
1062
+ int cpu_device_down (struct device * dev )
1055
1063
{
1056
- return do_cpu_down ( cpu , CPUHP_OFFLINE );
1064
+ return cpu_down ( dev -> id , CPUHP_OFFLINE );
1057
1065
}
1058
- EXPORT_SYMBOL (cpu_down );
1059
1066
1060
1067
int remove_cpu (unsigned int cpu )
1061
1068
{
@@ -1178,8 +1185,8 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen, enum cpuhp_state target)
1178
1185
}
1179
1186
1180
1187
/*
1181
- * The caller of do_cpu_up might have raced with another
1182
- * caller. Ignore it for now .
1188
+ * The caller of cpu_up() might have raced with another
1189
+ * caller. Nothing to do .
1183
1190
*/
1184
1191
if (st -> state >= target )
1185
1192
goto out ;
@@ -1223,7 +1230,7 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen, enum cpuhp_state target)
1223
1230
return ret ;
1224
1231
}
1225
1232
1226
- static int do_cpu_up (unsigned int cpu , enum cpuhp_state target )
1233
+ static int cpu_up (unsigned int cpu , enum cpuhp_state target )
1227
1234
{
1228
1235
int err = 0 ;
1229
1236
@@ -1257,11 +1264,18 @@ static int do_cpu_up(unsigned int cpu, enum cpuhp_state target)
1257
1264
return err ;
1258
1265
}
1259
1266
1260
- int cpu_up (unsigned int cpu )
1267
+ /**
1268
+ * cpu_device_up - Bring up a cpu device
1269
+ * @dev: Pointer to the cpu device to online
1270
+ *
1271
+ * This function is meant to be used by device core cpu subsystem only.
1272
+ *
1273
+ * Other subsystems should use add_cpu() instead.
1274
+ */
1275
+ int cpu_device_up (struct device * dev )
1261
1276
{
1262
- return do_cpu_up ( cpu , CPUHP_ONLINE );
1277
+ return cpu_up ( dev -> id , CPUHP_ONLINE );
1263
1278
}
1264
- EXPORT_SYMBOL_GPL (cpu_up );
1265
1279
1266
1280
int add_cpu (unsigned int cpu )
1267
1281
{
@@ -1289,7 +1303,7 @@ int bringup_hibernate_cpu(unsigned int sleep_cpu)
1289
1303
1290
1304
if (!cpu_online (sleep_cpu )) {
1291
1305
pr_info ("Hibernated on a CPU that is offline! Bringing CPU up.\n" );
1292
- ret = cpu_up (sleep_cpu );
1306
+ ret = cpu_up (sleep_cpu , CPUHP_ONLINE );
1293
1307
if (ret ) {
1294
1308
pr_err ("Failed to bring hibernate-CPU up!\n" );
1295
1309
return ret ;
@@ -1306,7 +1320,7 @@ void bringup_nonboot_cpus(unsigned int setup_max_cpus)
1306
1320
if (num_online_cpus () >= setup_max_cpus )
1307
1321
break ;
1308
1322
if (!cpu_online (cpu ))
1309
- cpu_up (cpu );
1323
+ cpu_up (cpu , CPUHP_ONLINE );
1310
1324
}
1311
1325
}
1312
1326
@@ -2129,9 +2143,9 @@ static ssize_t write_cpuhp_target(struct device *dev,
2129
2143
goto out ;
2130
2144
2131
2145
if (st -> state < target )
2132
- ret = do_cpu_up (dev -> id , target );
2146
+ ret = cpu_up (dev -> id , target );
2133
2147
else
2134
- ret = do_cpu_down (dev -> id , target );
2148
+ ret = cpu_down (dev -> id , target );
2135
2149
out :
2136
2150
unlock_device_hotplug ();
2137
2151
return ret ? ret : count ;
0 commit comments