diff options
author | Jonathan Zhang <jonzhang@fb.com> | 2020-01-16 11:11:09 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-02-04 16:13:57 +0000 |
commit | 6ec322ec7c27005d64a907076188b09a7cf09aa7 (patch) | |
tree | b9d77d235833e097c71ab0b01e15198e9c516c89 | |
parent | 3d2e18ad50d6dd0e93af1bb6efad20b4faede3b3 (diff) |
cpu/x86: Make MP init timeout configurable
The current MP init timeout is hardcoded as 1s. To support
platform with many cpus, the timeout needs to be adjusted.
The number of cpus is calculated as:
number of sockets * number of cores per socket *
number of threads per core
How long the timeout should be set to, is heuristic.
It needs to be set long enough to ensure reboot stability,
but not unreasonable so that real failures can be detected
soon enough, especially for smaller systems.
This patch sets timeout to be minimum as 1 second, while each
cpu adds 0.1 second.
Signed-off-by: Jonathan Zhang <jonzhang@fb.com>
Signed-off-by: Reddy Chagam <anjaneya.chagam@intel.com>
Change-Id: Ibc079fc6aa8641d4ac8d8e726899b6c8d055052e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38546
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
-rw-r--r-- | src/cpu/x86/mp_init.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 45776f8186..b093be7003 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -13,6 +13,7 @@ */ #include <console/console.h> +#include <stddef.h> #include <stdint.h> #include <string.h> #include <rmodule.h> @@ -518,11 +519,12 @@ static int bsp_do_flight_plan(struct mp_params *mp_params) int i; int ret = 0; /* - * Set time-out to wait for APs to a huge value (=1 second) since it - * could take a longer time for APs to check-in as the number of APs - * increases (contention for resources like UART also increases). + * Set time out for flight plan to a huge minimum value (>=1 second). + * CPUs with many APs may take longer if there is contention for + * resources such as UART, so scale the time out up by increments of + * 100ms if needed. */ - const int timeout_us = 1000000; + const int timeout_us = MAX(1000000, 100000 * mp_params->num_cpus); const int step_us = 100; int num_aps = mp_params->num_cpus - 1; struct stopwatch sw; |