From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 99194210DA784 for ; Mon, 6 Aug 2018 03:29:04 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 03:29:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,452,1526367600"; d="scan'208";a="251641684" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by fmsmga005.fm.intel.com with ESMTP; 06 Aug 2018 03:29:03 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Michael D Kinney Date: Mon, 6 Aug 2018 18:28:59 +0800 Message-Id: <1533551340-66548-2-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1533551340-66548-1-git-send-email-star.zeng@intel.com> References: <1533551340-66548-1-git-send-email-star.zeng@intel.com> Subject: [PATCH 1/2] FmpDevicePkg FmpDxe: Need repopulate after SetImage is called X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 10:29:04 -0000 No need repopulate if SetImage is not called. But need repopulate after SetImage is called to update LastAttemptVersion and LastAttemptStatus Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- FmpDevicePkg/FmpDxe/FmpDxe.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c index eb3a9b0e32c2..3794ac5008f9 100644 --- a/FmpDevicePkg/FmpDxe/FmpDxe.c +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c @@ -906,9 +906,6 @@ SetTheImage ( UINT32 AllHeaderSize; UINT32 IncommingFwVersion; UINT32 LastAttemptStatus; - EFI_STATUS GetAttributesStatus; - UINT64 AttributesSupported; - UINT64 AttributesSetting; UINT32 Version; UINT32 LowestSupportedVersion; @@ -1121,18 +1118,6 @@ SetTheImage ( LastAttemptStatus = LAST_ATTEMPT_STATUS_SUCCESS; - // - // Set flag so the descriptor is repopulated - // This is only applied to devices that do not require reset - // - GetAttributesStatus = FmpDeviceGetAttributes (&AttributesSupported, &AttributesSetting); - if (!EFI_ERROR (GetAttributesStatus)) { - if (((AttributesSupported & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0) || - ((AttributesSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0)) { - mDescriptorPopulated = FALSE; - } - } - cleanup: mProgressFunc = NULL; mProgressSupported = FALSE; @@ -1145,6 +1130,12 @@ cleanup: Progress (100); } + // + // Need repopulate after SetImage is called to + // update LastAttemptVersion and LastAttemptStatus. + // + mDescriptorPopulated = FALSE; + return Status; } -- 2.7.0.windows.1