From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.6759.1589948730719907733 for ; Tue, 19 May 2020 21:25:30 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=04096403a8=walon.li@hpe.com) Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04K45NJe030443; Wed, 20 May 2020 04:25:30 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0a-002e3701.pphosted.com with ESMTP id 314qjja46s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 May 2020 04:25:30 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 9B11F60; Wed, 20 May 2020 04:25:29 +0000 (UTC) Received: from KIDKMZDU3U.asiapacific.hpqcorp.net (unknown [16.169.8.12]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id CA8BC50; Wed, 20 May 2020 04:25:27 +0000 (UTC) From: "Li, Walon" To: devel@edk2.groups.io Cc: walon.li@hpe.com, dandan.bi@intel.com, nickle.wang@hpe.com, abner.chang@hpe.com, sunnywang@hpe.com Subject: [PATCH] MdeModulePkg/SetupBrowserDxe: Do not reconnect driver with form-update Date: Wed, 20 May 2020 12:24:47 +0800 Message-Id: <20200520042447.1017-1-walon.li@hpe.com> X-Mailer: git-send-email 2.23.0.windows.1 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-19_11:2020-05-19,2020-05-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 adultscore=0 cotscore=-2147483648 phishscore=0 spamscore=0 clxscore=1011 mlxlogscore=898 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005200034 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2701 Recording to the spec, the reconnect is activated upon exiting of the formset or the browser. Exiting is by user but form-browser internal logic. That means the reconnection is only happened when user press ESC or _EXIT action to exit form. Driver callback may update HII form dynamically so form-browser needs to refresh its internal data. It's not exiting formset for user exactly and they didn't know what happened. So use a flag to record that and do not reconnect driver if updated by callback. Signed-off-by: Walon Li --- MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 2 ++ MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeMod= ulePkg/Universal/SetupBrowserDxe/Presentation.c index bafee4c612..7f85873730 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -19,6 +19,7 @@ LIST_ENTRY mRefreshEventList =3D INITIALIZE_LIST_= HEAD_VARIABLE (mRefreshEv UINT16 mCurFakeQestId;=0D FORM_DISPLAY_ENGINE_FORM gDisplayFormData;=0D BOOLEAN mFinishRetrieveCall =3D FALSE;=0D +BOOLEAN mDynamicFormUpdated =3D FALSE;=0D =0D /**=0D Check whether the ConfigAccess protocol is available.=0D @@ -1762,6 +1763,7 @@ FormUpdateNotify ( )=0D {=0D mHiiPackageListUpdated =3D TRUE;=0D + mDynamicFormUpdated =3D TRUE;=0D =0D return EFI_SUCCESS;=0D }=0D diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/= Universal/SetupBrowserDxe/Setup.c index 82067b541c..f936a4b8e8 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -68,6 +68,7 @@ extern EFI_GUID mCurrentFormSetGuid; extern EFI_HII_HANDLE mCurrentHiiHandle;=0D extern UINT16 mCurrentFormId;=0D extern FORM_DISPLAY_ENGINE_FORM gDisplayFormData;=0D +extern BOOLEAN mDynamicFormUpdated;=0D =0D /**=0D Create a menu with specified formset GUID and form ID, and add it as a c= hild=0D @@ -536,6 +537,7 @@ SendForm ( }=0D Selection->FormSet =3D FormSet;=0D mSystemLevelFormSet =3D FormSet;=0D + mDynamicFormUpdated =3D FALSE;=0D =0D //=0D // Display this formset=0D @@ -547,7 +549,11 @@ SendForm ( gCurrentSelection =3D NULL;=0D mSystemLevelFormSet =3D NULL;=0D =0D - if (gFlagReconnect || gCallbackReconnect) {=0D + //=0D + // If callback update form dynamically, it's not exiting of the form= set for user so system do not reconnect driver hanlde=0D + // this time.=0D + //=0D + if (!mDynamicFormUpdated && (gFlagReconnect || gCallbackReconnect)) = {=0D RetVal =3D ReconnectController (FormSet->DriverHandle);=0D if (!RetVal) {=0D PopupErrorMessage(BROWSER_RECONNECT_FAIL, NULL, NULL, NULL);=0D --=20 2.23.0.windows.1