I will help push this patch.
> -----Original Message----- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Li, > Gary (HPS SW) > Sent: Friday, June 03, 2016 3:45 PM > To: Ni, Ruiyu <ruiyu...@intel.com> > Cc: edk2-devel@lists.01.org > Subject: Re: [edk2] [PATCH v2] MdeModulePkg:Prevent the > BmRepairAllControllers routine in an infinite loop > > Hi Ray, > > Thanks for your review. > Could you please commit this change? > > Regards, > > Gary Li > Platform SW Engineering > Servers > Office: +886 (2) 8722 9977 > > > -----Original Message----- > From: Ni, Ruiyu [mailto:ruiyu...@intel.com] > Sent: Friday, June 03, 2016 3:29 PM > To: Li, Gary (HPS SW) <gar...@hpe.com> > Cc: edk2-devel@lists.01.org; El-Haj-Mahmoud, Samer <samer.el-haj- > mahm...@hpe.com> > Subject: Re: [PATCH v2] MdeModulePkg:Prevent the BmRepairAllControllers > routine in an infinite loop > > I am ok for the code logic. > Reviewed-by: ruiyu...@intel.com > > Thanks, > Ray > > > 在 2016年6月3日,下午3:23,Gary Li <gar...@hpe.com> 写道: > > > > Prevent the BmRepairAllControllers routine in an infinite loop > > > > Contributed-under: TianoCore Contribution Agreement 1.0 > > > > Signed-off-by: Gary Li <gar...@hpe.com> > > --- > > MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c | 11 > +++++++++-- > > .../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 3 ++- > > MdeModulePkg/MdeModulePkg.dec | 5 +++++ > > MdeModulePkg/MdeModulePkg.uni | 4 ++++ > > 4 files changed, 20 insertions(+), 3 deletions(-) > > > > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c > > b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c > > index bffbeda..1e68cbc 100644 > > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c > > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c > > @@ -1,8 +1,9 @@ > > /** @file > > Library functions which relates with driver health. > > > > -(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> > > Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR> > > +(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> > > +(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> > > This program and the accompanying materials are licensed and made > > available under the terms and conditions of the BSD License which > > accompanies this distribution. The full text of the license may be > > found at @@ -439,6 +440,8 @@ BmRepairAllControllers ( > > BOOLEAN RebootRequired; > > EFI_HII_HANDLE *HiiHandles; > > EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2; > > + UINT32 MaxRepairCount; > > + UINT32 RepairCount; > > > > // > > // Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver > health check. > > @@ -450,6 +453,9 @@ BmRepairAllControllers ( > > Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, > (VOID **) &FormBrowser2); > > ASSERT_EFI_ERROR (Status); > > > > + MaxRepairCount = PcdGet32 (PcdMaxRepairCount); RepairCount = 0; > > + > > do { > > RepairRequired = FALSE; > > ConfigurationRequired = FALSE; > > @@ -512,7 +518,8 @@ BmRepairAllControllers ( > > } > > > > EfiBootManagerFreeDriverHealthInfo (DriverHealthInfo, Count); > > - } while (RepairRequired || ConfigurationRequired); > > + RepairCount++; > > + } while ((RepairRequired || ConfigurationRequired) && > > + ((MaxRepairCount == 0) || (RepairCount < MaxRepairCount))); > > > > RebootRequired = FALSE; > > ReconnectRequired = FALSE; > > diff --git > > a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > > b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > > index 9d62d3d..078f272 100644 > > --- > a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > > +++ > b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > > @@ -6,6 +6,7 @@ > > # manipulation, driver health checking and etc. > > # > > # Copyright (c) 2007 - 2016, Intel Corporation. All rights > > reserved.<BR> > > +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> > > # This program and the accompanying materials # are licensed and > > made available under the terms and conditions of the BSD License # > > which accompanies this distribution. The full text of the license may > > be found at @@ -117,4 +118,4 @@ > > gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable > ## SOMETIMES_CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile > ## CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm > ## SOMETIMES_CONSUMES > > - > > + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount > ## CONSUMES > > diff --git a/MdeModulePkg/MdeModulePkg.dec > > b/MdeModulePkg/MdeModulePkg.dec index a133824..27efb37 100644 > > --- a/MdeModulePkg/MdeModulePkg.dec > > +++ b/MdeModulePkg/MdeModulePkg.dec > > @@ -1105,6 +1105,11 @@ > > # @Prompt Exposed ACPI table versions. > > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x3E|UI > NT32 > > |0x0001004c > > > > + ## This PCD defines the MAX repair count. > > + # The default value is 0 that means infinite. > > + # @Prompt MAX repair count > > + > > + > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount|0x00|UINT32|0x0 > 0010 > > + 076 > > + > > [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > > ## This PCD defines the Console output row. The default value is 25 > according to UEFI spec. > > # This PCD could be set to 0 then console output would be at max column > and max row. > > diff --git a/MdeModulePkg/MdeModulePkg.uni > > b/MdeModulePkg/MdeModulePkg.uni index 346f735..f529dce 100644 > > --- a/MdeModulePkg/MdeModulePkg.uni > > +++ b/MdeModulePkg/MdeModulePkg.uni > > @@ -978,3 +978,7 @@ > > #string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcPciHostControllerMmi > oBase_PROMPT #language en-US "Mmio base address of pci-based > SD/MMC host controller" > > > > #string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSdMmcPciHostControllerMmi > oBase_HELP #language en-US "This PCD specifies the PCI-based SD/MMC > host controller mmio base address. Define the mmio base address of the pci- > based SD/MMC host controller. If there are multiple SD/MMC host > controllers, their mmio base addresses are calculated one by one from this > base address.<BR>" > > + > > +#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMaxRepairCount_PROMPT > #language en-US "MAX repair count" > > + > > +#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMaxRepairCount_HELP > #language en-US "This PCD defines the MAX repair count. The default value > is 0 that means infinite.<BR>" > > -- > > 2.7.2.windows.1 > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel