From 5ec97cea676bd45b151f94b73d486cee0f244213 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Fri, 26 Jul 2019 14:47:32 +0200 Subject: soc/*: mp_run_on_all_cpus: Remove configurable timeout Some timeouts given were too small when serial console is enabled due to its spinlock making code runtime worse with every AP present. In addition we usually don't know how long specific code runs and how long ago it was sent to the APs. Remove the timeout argument from mp_run_on_all_cpus and instead wait up to 1 second, to prevent possible crashing of secondary APs still processing the old job. Tested on Supermicro X11SSH-TF. Change-Id: I456be647b159f7a2ea7d94986a24424e56dcc8c4 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/34587 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Philipp Deppenwiese --- src/cpu/x86/mp_init.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 3658a5b698..1755a9dd4a 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -964,12 +964,13 @@ int mp_run_on_aps(void (*func)(void *), void *arg, int logical_cpu_num, return run_ap_work(&lcb, expire_us); } -int mp_run_on_all_cpus(void (*func)(void *), void *arg, long expire_us) +int mp_run_on_all_cpus(void (*func)(void *), void *arg) { /* Run on BSP first. */ func(arg); - return mp_run_on_aps(func, arg, MP_RUN_ON_ALL_CPUS, expire_us); + /* For up to 1 second for AP to finish previous work. */ + return mp_run_on_aps(func, arg, MP_RUN_ON_ALL_CPUS, 1000 * USECS_PER_MSEC); } int mp_park_aps(void) @@ -981,7 +982,7 @@ int mp_park_aps(void) stopwatch_init(&sw); ret = mp_run_on_aps(park_this_cpu, NULL, MP_RUN_ON_ALL_CPUS, - 250 * USECS_PER_MSEC); + 1000 * USECS_PER_MSEC); duration_msecs = stopwatch_duration_msecs(&sw); -- cgit v1.2.3