From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Jie Lin <jie.lin@intel.com>
Subject: [PATCH 2/3] MdeModulePkg/BdsDxe: Fix bug to run non-first PlatformRecovery####
Date: Tue, 15 Nov 2016 18:04:24 +0800 [thread overview]
Message-ID: <20161115100425.299856-3-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20161115100425.299856-1-ruiyu.ni@intel.com>
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 <ruiyu.ni@intel.com>
Cc: Jie Lin <jie.lin@intel.com>
---
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
next prev parent reply other threads:[~2016-11-15 10:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 10:04 [PATCH 0/3] Fix 2 bugs relating to PlatformRecovery Ruiyu Ni
2016-11-15 10:04 ` [PATCH 1/3] MdeModulePkg/UefiBootManagerLib: Refine the debug message Ruiyu Ni
2016-11-16 9:03 ` Wang, Sunny (HPS SW)
2016-11-15 10:04 ` Ruiyu Ni [this message]
2016-11-16 9:05 ` [PATCH 2/3] MdeModulePkg/BdsDxe: Fix bug to run non-first PlatformRecovery#### Wang, Sunny (HPS SW)
2016-11-15 10:04 ` [PATCH 3/3] MdeModulePkg/BdsDxe: Avoid overwriting PlatformRecovery#### Ruiyu Ni
2016-11-16 9:08 ` Wang, Sunny (HPS SW)
2016-11-16 10:16 ` Ni, Ruiyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161115100425.299856-3-ruiyu.ni@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox