From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: michael.d.kinney@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Tue, 16 Apr 2019 09:11:10 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2019 09:11:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,358,1549958400"; d="scan'208";a="316470527" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga005.jf.intel.com with ESMTP; 16 Apr 2019 09:11:08 -0700 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 16 Apr 2019 09:11:07 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.24]) by ORSMSX161.amr.corp.intel.com ([169.254.4.34]) with mapi id 14.03.0415.000; Tue, 16 Apr 2019 09:11:08 -0700 From: "Michael D Kinney" To: "Jin, Eric" , "devel@edk2.groups.io" , "Kinney, Michael D" Subject: Re: [Staging/Bug_1525_FmpDevicePkg_MultipleControllers][PATCH] MdeModulePkg/EsrtFmpDxe: Correct the LastAttemptVersion algorithm in ESRT entry Thread-Topic: [Staging/Bug_1525_FmpDevicePkg_MultipleControllers][PATCH] MdeModulePkg/EsrtFmpDxe: Correct the LastAttemptVersion algorithm in ESRT entry Thread-Index: AQHU9ADP2yjmAfUKFUKZ3/nR2j2jw6Y+9e2g Date: Tue, 16 Apr 2019 16:11:07 +0000 Message-ID: References: <20190416030158.27096-1-eric.jin@intel.com> In-Reply-To: <20190416030158.27096-1-eric.jin@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael D Kinney > -----Original Message----- > From: Jin, Eric > Sent: Monday, April 15, 2019 8:02 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D > Subject: > [Staging/Bug_1525_FmpDevicePkg_MultipleControllers][PAT > CH] MdeModulePkg/EsrtFmpDxe: Correct the > LastAttemptVersion algorithm in ESRT entry >=20 > Fix the 1nd issue mentioned in > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1525 >=20 > Update the ESRT entry with the last attempt status and > last attempt > version from the first FMP instance whose last attempt > status is not > SUCCESS. If all FMP instances are SUCCESS, then set > last attempt version > to the smallest value from all FMP instances >=20 > CC: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Jin > --- > MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 14 > ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) >=20 > diff --git > a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > index bd92d1da40..848bd44e9d 100644 > --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > @@ -196,20 +196,22 @@ CreateEsrtEntry ( > // VERSION 3 supports last attempt values > // > if (FmpVersion >=3D 3) { > - Entry->LastAttemptVersion =3D > - MIN ( > - FmpImageInfoBuf->LastAttemptVersion, > - Entry->LastAttemptVersion > - ); > // > // Update the ESRT entry with the last attempt > status and last attempt > // version from the first FMP instance whose > last attempt status is not > - // SUCCESS. > + // SUCCESS. If all FMP instances are SUCCESS, > then set version to the > + // smallest value from all FMP instances. > // > if (Entry->LastAttemptStatus =3D=3D > LAST_ATTEMPT_STATUS_SUCCESS) { > if (FmpImageInfoBuf->LastAttemptStatus !=3D > LAST_ATTEMPT_STATUS_SUCCESS) { > Entry->LastAttemptStatus =3D > FmpImageInfoBuf->LastAttemptStatus; > Entry->LastAttemptVersion =3D > FmpImageInfoBuf->LastAttemptVersion; > + } else { > + Entry->LastAttemptVersion =3D > + MIN ( > + FmpImageInfoBuf->LastAttemptVersion, > + Entry->LastAttemptVersion > + ); > } > } > } > -- > 2.20.1.windows.1