summaryrefslogtreecommitdiff
path: root/src/cpu/x86
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2018-04-11 18:45:57 +0530
committerAaron Durbin <adurbin@chromium.org>2018-05-03 14:56:16 +0000
commit838f296d059962196bb50db4b009d1d890cae0be (patch)
tree82ae2464612595bae4b3fc6fe4370ec6ad24228f /src/cpu/x86
parente93634caa0ac8bd9286cf0eeb36ea960d738de2e (diff)
downloadcoreboot-838f296d059962196bb50db4b009d1d890cae0be.tar.xz
cpu/x86: Add infinite timeout support into run_ap_work() function
There might be certain requirement in user function where user might not want to pass any timeout value, in those cases run_ap_work() should consider infinity as timeout and perform all APs initialization as per specification. Set expire_us <= 0 to specify an infinite timeout. BRANCH=none BUG=b:74436746 TEST=run_ap_work() is running successfully with 0 expire_us. Change-Id: Iacd67768c8a120f6a01baaa6817468f6b9a3b764 Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/25622 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/x86')
-rw-r--r--src/cpu/x86/mp_init.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index f99abaf245..585a54b86d 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -907,7 +907,9 @@ static int run_ap_work(mp_callback_t func, long expire_us)
mfence();
/* Wait for all the APs to signal back that call has been accepted. */
- stopwatch_init_usecs_expire(&sw, expire_us);
+ if (expire_us > 0)
+ stopwatch_init_usecs_expire(&sw, expire_us);
+
do {
cpus_accepted = 0;
@@ -920,7 +922,7 @@ static int run_ap_work(mp_callback_t func, long expire_us)
if (cpus_accepted == global_num_aps)
return 0;
- } while (!stopwatch_expired(&sw));
+ } while (expire_us <= 0 || !stopwatch_expired(&sw));
printk(BIOS_ERR, "AP call expired. %d/%d CPUs accepted.\n",
cpus_accepted, global_num_aps);