From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 18D1181EE4 for ; Tue, 15 Nov 2016 02:04:27 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 15 Nov 2016 02:04:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,494,1473145200"; d="scan'208";a="191573622" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 15 Nov 2016 02:04:30 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jie Lin Date: Tue, 15 Nov 2016 18:04:24 +0800 Message-Id: <20161115100425.299856-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20161115100425.299856-1-ruiyu.ni@intel.com> References: <20161115100425.299856-1-ruiyu.ni@intel.com> Subject: [PATCH 2/3] MdeModulePkg/BdsDxe: Fix bug to run non-first PlatformRecovery#### X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2016 10:04:27 -0000 The implementation doesn't check the LoadOptions[Index].Status but only depends on the Status returned from EfiBootManagerProcessLoadOption(), which results only the first PlatformRecovery#### runs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jie Lin --- MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index 72adc51..48e5351 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -443,17 +443,25 @@ ProcessLoadOptions ( LoadOptionType = LoadOptions[Index].OptionType; } ASSERT (LoadOptionType == LoadOptions[Index].OptionType); + ASSERT (LoadOptionType != LoadOptionTypeBoot); Status = EfiBootManagerProcessLoadOption (&LoadOptions[Index]); + // + // Status indicates whether the load option is loaded and executed + // LoadOptions[Index].Status is what the load option returns + // if (!EFI_ERROR (Status)) { - if (LoadOptionType == LoadOptionTypePlatformRecovery) { - // - // Stop processing if any entry is successful - // + // + // Stop processing if any PlatformRecovery#### returns success. + // + if ((LoadOptions[Index].Status == EFI_SUCCESS) && + (LoadOptionType == LoadOptionTypePlatformRecovery)) { break; } - if ((LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) { + + if (!EFI_ERROR (LoadOptions[Index].Status) && + (LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) { ReconnectAll = TRUE; } } -- 2.9.0.windows.1