summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-08-24 21:37:14 +0800
committerJeff Fan <jeff.fan@intel.com>2016-08-25 16:12:32 +0800
commitc1192210604f51c8397864293b1bdc00c5242c58 (patch)
tree2e3bb72202ace128514200d7ad226f65c048a0c4 /UefiCpuPkg/Library
parent1219c85df42d5c9ed187565328e2f5cead5682ed (diff)
downloadedk2-platforms-c1192210604f51c8397864293b1bdc00c5242c58.tar.xz
UefiCpuPkg/MpInitLib: Move timeout delay to WakupAp()
After sending the 1st broadcast INIT-SIPI-SIPI, BSP will collect APs count after one specified timeout delay. However, WakupAp() will restore reset vector immediately after sending 1st broadcast INIT-SIPI-SIPI. Some processors may not complete executing reset vector code. This fix is to move MicroSecondDelay() from CollectProcessorCount() to the place that is after sending 1st broadcast INIT-SIPI-SIPI and before FreeResetVector() in WakupAp(). Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index fbe2e8b8c4..47a971bf97 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -513,10 +513,6 @@ CollectProcessorCount (
CpuMpData->InitFlag = ApInitConfig;
CpuMpData->X2ApicEnable = FALSE;
WakeUpAP (CpuMpData, TRUE, 0, NULL, NULL);
- //
- // Wait for AP task to complete and then exit.
- //
- MicroSecondDelay (PcdGet32(PcdCpuApInitTimeOutInMicroSeconds));
CpuMpData->InitFlag = ApInitDone;
ASSERT (CpuMpData->CpuCount <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
//
@@ -863,7 +859,12 @@ WakeUpAP (
//
SendInitSipiSipiAllExcludingSelf ((UINT32) ExchangeInfo->BufferStart);
}
- if (CpuMpData->InitFlag != ApInitConfig) {
+ if (CpuMpData->InitFlag == ApInitConfig) {
+ //
+ // Wait for all potential APs waken up in one specified period
+ //
+ MicroSecondDelay (PcdGet32(PcdCpuApInitTimeOutInMicroSeconds));
+ } else {
//
// Wait all APs waken up if this is not the 1st broadcast of SIPI
//