@@ -71,7 +71,6 @@ struct cpuhp_cpu_state {
71
71
bool rollback ;
72
72
bool single ;
73
73
bool bringup ;
74
- int cpu ;
75
74
struct hlist_node * node ;
76
75
struct hlist_node * last ;
77
76
enum cpuhp_state cb_state ;
@@ -475,7 +474,7 @@ static inline bool cpu_smt_allowed(unsigned int cpu) { return true; }
475
474
#endif
476
475
477
476
static inline enum cpuhp_state
478
- cpuhp_set_state (struct cpuhp_cpu_state * st , enum cpuhp_state target )
477
+ cpuhp_set_state (int cpu , struct cpuhp_cpu_state * st , enum cpuhp_state target )
479
478
{
480
479
enum cpuhp_state prev_state = st -> state ;
481
480
bool bringup = st -> state < target ;
@@ -486,14 +485,15 @@ cpuhp_set_state(struct cpuhp_cpu_state *st, enum cpuhp_state target)
486
485
st -> target = target ;
487
486
st -> single = false;
488
487
st -> bringup = bringup ;
489
- if (cpu_dying (st -> cpu ) != !bringup )
490
- set_cpu_dying (st -> cpu , !bringup );
488
+ if (cpu_dying (cpu ) != !bringup )
489
+ set_cpu_dying (cpu , !bringup );
491
490
492
491
return prev_state ;
493
492
}
494
493
495
494
static inline void
496
- cpuhp_reset_state (struct cpuhp_cpu_state * st , enum cpuhp_state prev_state )
495
+ cpuhp_reset_state (int cpu , struct cpuhp_cpu_state * st ,
496
+ enum cpuhp_state prev_state )
497
497
{
498
498
bool bringup = !st -> bringup ;
499
499
@@ -520,8 +520,8 @@ cpuhp_reset_state(struct cpuhp_cpu_state *st, enum cpuhp_state prev_state)
520
520
}
521
521
522
522
st -> bringup = bringup ;
523
- if (cpu_dying (st -> cpu ) != !bringup )
524
- set_cpu_dying (st -> cpu , !bringup );
523
+ if (cpu_dying (cpu ) != !bringup )
524
+ set_cpu_dying (cpu , !bringup );
525
525
}
526
526
527
527
/* Regular hotplug invocation of the AP hotplug thread */
@@ -541,15 +541,16 @@ static void __cpuhp_kick_ap(struct cpuhp_cpu_state *st)
541
541
wait_for_ap_thread (st , st -> bringup );
542
542
}
543
543
544
- static int cpuhp_kick_ap (struct cpuhp_cpu_state * st , enum cpuhp_state target )
544
+ static int cpuhp_kick_ap (int cpu , struct cpuhp_cpu_state * st ,
545
+ enum cpuhp_state target )
545
546
{
546
547
enum cpuhp_state prev_state ;
547
548
int ret ;
548
549
549
- prev_state = cpuhp_set_state (st , target );
550
+ prev_state = cpuhp_set_state (cpu , st , target );
550
551
__cpuhp_kick_ap (st );
551
552
if ((ret = st -> result )) {
552
- cpuhp_reset_state (st , prev_state );
553
+ cpuhp_reset_state (cpu , st , prev_state );
553
554
__cpuhp_kick_ap (st );
554
555
}
555
556
@@ -581,7 +582,7 @@ static int bringup_wait_for_ap(unsigned int cpu)
581
582
if (st -> target <= CPUHP_AP_ONLINE_IDLE )
582
583
return 0 ;
583
584
584
- return cpuhp_kick_ap (st , st -> target );
585
+ return cpuhp_kick_ap (cpu , st , st -> target );
585
586
}
586
587
587
588
static int bringup_cpu (unsigned int cpu )
@@ -704,7 +705,7 @@ static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
704
705
ret , cpu , cpuhp_get_step (st -> state )-> name ,
705
706
st -> state );
706
707
707
- cpuhp_reset_state (st , prev_state );
708
+ cpuhp_reset_state (cpu , st , prev_state );
708
709
if (can_rollback_cpu (st ))
709
710
WARN_ON (cpuhp_invoke_callback_range (false, cpu , st ,
710
711
prev_state ));
@@ -721,7 +722,6 @@ static void cpuhp_create(unsigned int cpu)
721
722
722
723
init_completion (& st -> done_up );
723
724
init_completion (& st -> done_down );
724
- st -> cpu = cpu ;
725
725
}
726
726
727
727
static int cpuhp_should_run (unsigned int cpu )
@@ -875,7 +875,7 @@ static int cpuhp_kick_ap_work(unsigned int cpu)
875
875
cpuhp_lock_release (true);
876
876
877
877
trace_cpuhp_enter (cpu , st -> target , prev_state , cpuhp_kick_ap_work );
878
- ret = cpuhp_kick_ap (st , st -> target );
878
+ ret = cpuhp_kick_ap (cpu , st , st -> target );
879
879
trace_cpuhp_exit (cpu , st -> state , prev_state , ret );
880
880
881
881
return ret ;
@@ -1107,7 +1107,7 @@ static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
1107
1107
ret , cpu , cpuhp_get_step (st -> state )-> name ,
1108
1108
st -> state );
1109
1109
1110
- cpuhp_reset_state (st , prev_state );
1110
+ cpuhp_reset_state (cpu , st , prev_state );
1111
1111
1112
1112
if (st -> state < prev_state )
1113
1113
WARN_ON (cpuhp_invoke_callback_range (true, cpu , st ,
@@ -1134,7 +1134,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
1134
1134
1135
1135
cpuhp_tasks_frozen = tasks_frozen ;
1136
1136
1137
- prev_state = cpuhp_set_state (st , target );
1137
+ prev_state = cpuhp_set_state (cpu , st , target );
1138
1138
/*
1139
1139
* If the current CPU state is in the range of the AP hotplug thread,
1140
1140
* then we need to kick the thread.
@@ -1165,7 +1165,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
1165
1165
ret = cpuhp_down_callbacks (cpu , st , target );
1166
1166
if (ret && st -> state < prev_state ) {
1167
1167
if (st -> state == CPUHP_TEARDOWN_CPU ) {
1168
- cpuhp_reset_state (st , prev_state );
1168
+ cpuhp_reset_state (cpu , st , prev_state );
1169
1169
__cpuhp_kick_ap (st );
1170
1170
} else {
1171
1171
WARN (1 , "DEAD callback error for CPU%d" , cpu );
@@ -1352,7 +1352,7 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen, enum cpuhp_state target)
1352
1352
1353
1353
cpuhp_tasks_frozen = tasks_frozen ;
1354
1354
1355
- cpuhp_set_state (st , target );
1355
+ cpuhp_set_state (cpu , st , target );
1356
1356
/*
1357
1357
* If the current CPU state is in the range of the AP hotplug thread,
1358
1358
* then we need to kick the thread once more.
0 commit comments