@@ -329,97 +329,7 @@ EXPORT_SYMBOL_GPL(smpboot_unregister_percpu_thread);
329
329
#ifndef CONFIG_HOTPLUG_CORE_SYNC
330
330
static DEFINE_PER_CPU (atomic_t , cpu_hotplug_state ) = ATOMIC_INIT (CPU_POST_DEAD );
331
331
332
- /*
333
- * Called to poll specified CPU's state, for example, when waiting for
334
- * a CPU to come online.
335
- */
336
- int cpu_report_state (int cpu )
337
- {
338
- return atomic_read (& per_cpu (cpu_hotplug_state , cpu ));
339
- }
340
-
341
- /*
342
- * If CPU has died properly, set its state to CPU_UP_PREPARE and
343
- * return success. Otherwise, return -EBUSY if the CPU died after
344
- * cpu_wait_death() timed out. And yet otherwise again, return -EAGAIN
345
- * if cpu_wait_death() timed out and the CPU still hasn't gotten around
346
- * to dying. In the latter two cases, the CPU might not be set up
347
- * properly, but it is up to the arch-specific code to decide.
348
- * Finally, -EIO indicates an unanticipated problem.
349
- *
350
- * Note that it is permissible to omit this call entirely, as is
351
- * done in architectures that do no CPU-hotplug error checking.
352
- */
353
- int cpu_check_up_prepare (int cpu )
354
- {
355
- if (!IS_ENABLED (CONFIG_HOTPLUG_CPU )) {
356
- atomic_set (& per_cpu (cpu_hotplug_state , cpu ), CPU_UP_PREPARE );
357
- return 0 ;
358
- }
359
-
360
- switch (atomic_read (& per_cpu (cpu_hotplug_state , cpu ))) {
361
-
362
- case CPU_POST_DEAD :
363
-
364
- /* The CPU died properly, so just start it up again. */
365
- atomic_set (& per_cpu (cpu_hotplug_state , cpu ), CPU_UP_PREPARE );
366
- return 0 ;
367
-
368
- case CPU_DEAD_FROZEN :
369
-
370
- /*
371
- * Timeout during CPU death, so let caller know.
372
- * The outgoing CPU completed its processing, but after
373
- * cpu_wait_death() timed out and reported the error. The
374
- * caller is free to proceed, in which case the state
375
- * will be reset properly by cpu_set_state_online().
376
- * Proceeding despite this -EBUSY return makes sense
377
- * for systems where the outgoing CPUs take themselves
378
- * offline, with no post-death manipulation required from
379
- * a surviving CPU.
380
- */
381
- return - EBUSY ;
382
-
383
- case CPU_BROKEN :
384
-
385
- /*
386
- * The most likely reason we got here is that there was
387
- * a timeout during CPU death, and the outgoing CPU never
388
- * did complete its processing. This could happen on
389
- * a virtualized system if the outgoing VCPU gets preempted
390
- * for more than five seconds, and the user attempts to
391
- * immediately online that same CPU. Trying again later
392
- * might return -EBUSY above, hence -EAGAIN.
393
- */
394
- return - EAGAIN ;
395
-
396
- case CPU_UP_PREPARE :
397
- /*
398
- * Timeout while waiting for the CPU to show up. Allow to try
399
- * again later.
400
- */
401
- return 0 ;
402
-
403
- default :
404
-
405
- /* Should not happen. Famous last words. */
406
- return - EIO ;
407
- }
408
- }
409
-
410
- /*
411
- * Mark the specified CPU online.
412
- *
413
- * Note that it is permissible to omit this call entirely, as is
414
- * done in architectures that do no CPU-hotplug error checking.
415
- */
416
- void cpu_set_state_online (int cpu )
417
- {
418
- (void )atomic_xchg (& per_cpu (cpu_hotplug_state , cpu ), CPU_ONLINE );
419
- }
420
-
421
332
#ifdef CONFIG_HOTPLUG_CPU
422
-
423
333
/*
424
334
* Wait for the specified CPU to exit the idle loop and die.
425
335
*/
0 commit comments