@@ -1172,19 +1172,28 @@ static struct cpuhp_step cpuhp_bp_states[] = {
1172
1172
.teardown = NULL ,
1173
1173
.cant_stop = true,
1174
1174
},
1175
+ /*
1176
+ * Preparatory and dead notifiers. Will be replaced once the notifiers
1177
+ * are converted to states.
1178
+ */
1175
1179
[CPUHP_NOTIFY_PREPARE ] = {
1176
1180
.name = "notify:prepare" ,
1177
1181
.startup = notify_prepare ,
1178
1182
.teardown = notify_dead ,
1179
1183
.skip_onerr = true,
1180
1184
.cant_stop = true,
1181
1185
},
1186
+ /* Kicks the plugged cpu into life */
1182
1187
[CPUHP_BRINGUP_CPU ] = {
1183
1188
.name = "cpu:bringup" ,
1184
1189
.startup = bringup_cpu ,
1185
1190
.teardown = NULL ,
1186
1191
.cant_stop = true,
1187
1192
},
1193
+ /*
1194
+ * Handled on controll processor until the plugged processor manages
1195
+ * this itself.
1196
+ */
1188
1197
[CPUHP_TEARDOWN_CPU ] = {
1189
1198
.name = "cpu:teardown" ,
1190
1199
.startup = NULL ,
@@ -1197,24 +1206,56 @@ static struct cpuhp_step cpuhp_bp_states[] = {
1197
1206
/* Application processor state steps */
1198
1207
static struct cpuhp_step cpuhp_ap_states [] = {
1199
1208
#ifdef CONFIG_SMP
1209
+ /* Final state before CPU kills itself */
1210
+ [CPUHP_AP_IDLE_DEAD ] = {
1211
+ .name = "idle:dead" ,
1212
+ },
1213
+ /*
1214
+ * Last state before CPU enters the idle loop to die. Transient state
1215
+ * for synchronization.
1216
+ */
1217
+ [CPUHP_AP_OFFLINE ] = {
1218
+ .name = "ap:offline" ,
1219
+ .cant_stop = true,
1220
+ },
1221
+ /*
1222
+ * Low level startup/teardown notifiers. Run with interrupts
1223
+ * disabled. Will be removed once the notifiers are converted to
1224
+ * states.
1225
+ */
1200
1226
[CPUHP_AP_NOTIFY_STARTING ] = {
1201
1227
.name = "notify:starting" ,
1202
1228
.startup = notify_starting ,
1203
1229
.teardown = notify_dying ,
1204
1230
.skip_onerr = true,
1205
1231
.cant_stop = true,
1206
1232
},
1233
+ /* Entry state on starting. Interrupts enabled from here on. Transient
1234
+ * state for synchronsization */
1235
+ [CPUHP_AP_ONLINE ] = {
1236
+ .name = "ap:online" ,
1237
+ },
1238
+ /* Handle smpboot threads park/unpark */
1207
1239
[CPUHP_AP_SMPBOOT_THREADS ] = {
1208
1240
.name = "smpboot:threads" ,
1209
1241
.startup = smpboot_unpark_threads ,
1210
1242
.teardown = NULL ,
1211
1243
},
1244
+ /*
1245
+ * Online/down_prepare notifiers. Will be removed once the notifiers
1246
+ * are converted to states.
1247
+ */
1212
1248
[CPUHP_AP_NOTIFY_ONLINE ] = {
1213
1249
.name = "notify:online" ,
1214
1250
.startup = notify_online ,
1215
1251
.teardown = notify_down_prepare ,
1216
1252
},
1217
1253
#endif
1254
+ /*
1255
+ * The dynamically registered state space is here
1256
+ */
1257
+
1258
+ /* CPU is fully up and running. */
1218
1259
[CPUHP_ONLINE ] = {
1219
1260
.name = "online" ,
1220
1261
.startup = NULL ,
@@ -1232,7 +1273,11 @@ static int cpuhp_cb_check(enum cpuhp_state state)
1232
1273
1233
1274
static bool cpuhp_is_ap_state (enum cpuhp_state state )
1234
1275
{
1235
- return state > CPUHP_BRINGUP_CPU ;
1276
+ /*
1277
+ * The extra check for CPUHP_TEARDOWN_CPU is only for documentation
1278
+ * purposes as that state is handled explicitely in cpu_down.
1279
+ */
1280
+ return state > CPUHP_BRINGUP_CPU && state != CPUHP_TEARDOWN_CPU ;
1236
1281
}
1237
1282
1238
1283
static struct cpuhp_step * cpuhp_get_step (enum cpuhp_state state )
0 commit comments