HV: Remove dead loop in stop_cpus
This patch removes dead loop in stop_cpus because timeout never occurs. If target cpu received a NMI and panic, it has called cpu_dead and stop_cpus success. If target cpu is running, an IPI will be delivered to it and then call cpu_dead. Tracked-On: #2991 Signed-off-by: Kaige Fu <kaige.fu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
91c1408197
commit
7ccb44afda
|
@ -345,44 +345,24 @@ void wait_pcpus_offline(uint64_t mask)
|
||||||
|
|
||||||
void stop_cpus(void)
|
void stop_cpus(void)
|
||||||
{
|
{
|
||||||
uint16_t pcpu_id, expected_up;
|
uint16_t pcpu_id;
|
||||||
uint32_t timeout;
|
uint64_t mask = 0UL;
|
||||||
|
|
||||||
for (pcpu_id = 0U; pcpu_id < phys_cpu_num; pcpu_id++) {
|
for (pcpu_id = 0U; pcpu_id < phys_cpu_num; pcpu_id++) {
|
||||||
if (get_cpu_id() == pcpu_id) { /* avoid offline itself */
|
if (get_cpu_id() == pcpu_id) { /* avoid offline itself */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bitmap_set_nolock(pcpu_id, &mask);
|
||||||
make_pcpu_offline(pcpu_id);
|
make_pcpu_offline(pcpu_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
expected_up = 1U;
|
/**
|
||||||
timeout = CPU_DOWN_TIMEOUT * 1000U;
|
* Timeout never occurs here:
|
||||||
while ((atomic_load16(&up_count) != expected_up) && (timeout != 0U)) {
|
* If target cpu received a NMI and panic, it has called cpu_dead and make_pcpu_offline success.
|
||||||
/* Delay 10us */
|
* If target cpu is running, an IPI will be delivered to it and then call cpu_dead.
|
||||||
udelay(10U);
|
*/
|
||||||
|
wait_pcpus_offline(mask);
|
||||||
/* Decrement timeout value */
|
|
||||||
timeout -= 10U;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (atomic_load16(&up_count) != expected_up) {
|
|
||||||
pr_fatal("Can't make all APs offline");
|
|
||||||
|
|
||||||
/* if partial APs is down, it's not easy to recover
|
|
||||||
* per our current implementation (need make up dead
|
|
||||||
* APs one by one), just print error mesage and dead
|
|
||||||
* loop here.
|
|
||||||
*
|
|
||||||
* FIXME:
|
|
||||||
* We need to refine here to handle the AP offline
|
|
||||||
* failure for release/debug version. Ideally, we should
|
|
||||||
* define how to handle general unrecoverable error and
|
|
||||||
* follow it here.
|
|
||||||
*/
|
|
||||||
do {
|
|
||||||
} while (1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_do_idle(void)
|
void cpu_do_idle(void)
|
||||||
|
|
Loading…
Reference in New Issue