public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Li, Walon" <walon.li@hpe.com>
To: devel@edk2.groups.io
Cc: walon.li@hpe.com, nickle.wang@hpe.com, gaoliming@byosoft.com.cn
Subject: [PATCH] MdeModulePkg/SetupBrowserDxe:Follow spec'd way to reconnect driver
Date: Fri, 24 Jun 2022 14:07:47 +0800	[thread overview]
Message-ID: <20220624060747.1800-1-walon.li@hpe.com> (raw)

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3952

In UEFI spec, it defines reconnect timing that will be activated upon
exiting of the formset or the browser. However, we did't use this kind
of way to check reconnect conditioncode. Code only blocks reconnect if
page is updated dynamically. That's not matched spec'd way. We should
check current formset whether is exiting, then reconnect driver.

Signed-off-by: Walon Li <walon.li@hpe.com>
---
 MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 4 +---
 MdeModulePkg/Universal/SetupBrowserDxe/Setup.c        | 9 +++------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 9587b08d6d..babef21497 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -2,7 +2,7 @@
 Utility functions for UI presentation.
 
 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+(C) Copyright 2015 - 2022 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -21,7 +21,6 @@ LIST_ENTRY                mRefreshEventList  = INITIALIZE_LIST_HEAD_VARIABLE (mR
 UINT16                    mCurFakeQestId;
 FORM_DISPLAY_ENGINE_FORM  gDisplayFormData;
 BOOLEAN                   mFinishRetrieveCall = FALSE;
-BOOLEAN                   mDynamicFormUpdated = FALSE;
 
 /**
   Check whether the ConfigAccess protocol is available.
@@ -1791,7 +1790,6 @@ FormUpdateNotify (
   )
 {
   mHiiPackageListUpdated = TRUE;
-  mDynamicFormUpdated    = TRUE;
 
   return EFI_SUCCESS;
 }
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index fe0d46d93f..5158baf5bd 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -2,7 +2,7 @@
 Entry and initialization module for the browser.
 
 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+(C) Copyright 2020 - 2022 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -68,7 +68,6 @@ extern EFI_GUID                  mCurrentFormSetGuid;
 extern EFI_HII_HANDLE            mCurrentHiiHandle;
 extern UINT16                    mCurrentFormId;
 extern FORM_DISPLAY_ENGINE_FORM  gDisplayFormData;
-extern BOOLEAN                   mDynamicFormUpdated;
 
 /**
   Create a menu with specified formset GUID and form ID, and add it as a child
@@ -539,7 +538,6 @@ SendForm (
 
       Selection->FormSet  = FormSet;
       mSystemLevelFormSet = FormSet;
-      mDynamicFormUpdated = FALSE;
 
       //
       // Display this formset
@@ -552,10 +550,9 @@ SendForm (
       mSystemLevelFormSet = NULL;
 
       //
-      // If callback update form dynamically, it's not exiting of the formset for user so system do not reconnect driver hanlde
-      // this time.
+      // Check incoming formset whether is same with previous. If yes, that means action is not exiting of formset so do not reconnect controller.
       //
-      if (!mDynamicFormUpdated && (gFlagReconnect || gCallbackReconnect)) {
+      if ((gFlagReconnect || gCallbackReconnect) && !CompareGuid (&FormSet->Guid, &Selection->FormSetGuid)) {
         RetVal = ReconnectController (FormSet->DriverHandle);
         if (!RetVal) {
           PopupErrorMessage (BROWSER_RECONNECT_FAIL, NULL, NULL, NULL);
-- 
2.23.0.windows.1


             reply	other threads:[~2022-06-24  6:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24  6:07 Li, Walon [this message]
2022-07-18  1:14 ` [PATCH] MdeModulePkg/SetupBrowserDxe:Follow spec'd way to reconnect driver Li, Walon
2022-07-19  1:34   ` 回复: " gaoliming
2022-08-22  6:22     ` Li, Walon
2022-08-23  1:56       ` 回复: [edk2-devel] " gaoliming
2022-08-23  2:01         ` Li, Walon

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=20220624060747.1800-1-walon.li@hpe.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