Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38546 )
Change subject: cpu/x86: Make MP init timeout configurable ......................................................................
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 --- M src/cpu/x86/mp_init.c 1 file changed, 6 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 45776f8..b093be7 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 @@ 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;