From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 94FE821B02822 for ; Tue, 18 Sep 2018 19:10:50 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id j8-v6so1910922pff.6 for ; Tue, 18 Sep 2018 19:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=twgwmzHFQquWpdWxOjLUsWbxBubGAxTwM++d1h9jUMk=; b=gjce1O+wM0+Fxqltfzf0X9EWI4hM2K9cIqtiICBWeTQLuGZZUtdWclj3u9g70SuKnj dn1sKmLYRChuN2LPi/qebsOQbru5SmRrXaA2Fxdpfdnlq9g0hf+ZM1078bFowkzICm2K pvUxSpwZ0gbhLg1qPRXy76bKzsNwUEHlp0l8Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=twgwmzHFQquWpdWxOjLUsWbxBubGAxTwM++d1h9jUMk=; b=rgxf57pgy3s81qJzSmkUkaUelXpBKpR9LGgkaLWyYbNf1cjMUAI9hevkbD8pLHIwOS KZbOKX17jtDv+s8WHE3fP7P1tlqaRM+htCn+DO7X0lDjzWH7RVBaFdo9QznABwoBG5D4 W/dLc9oaMQSykRAZmjvQfkPExEWGpXYgKzQW87RNJLA2eP+JpTO/guZIROTPSBXqVYe0 C3dxtHDm/RoP5R7BalwYCAihoOXgZycZsa52hGtR+rdtiDpGifXZ38B5qvXbkCT54jlU +pVa/uKtkzEkWyNx7zTWkDiF2qOw/ADzurV82yUyVBNbe+Fgpg7KfpbRLzecRIpHq94k 0RzQ== X-Gm-Message-State: APzg51DfJBGCqJfdADwf4x7AkPVs3Ksy/XCaYPGFtZeY9IG0uAMTmiLx ghH0lMDVmmBBMa2y6eOjUiwWhw== X-Google-Smtp-Source: ANB0Vdah0uQfIFSzJ1k7qRclyYMtHodPeWiGFa13CkTpGxM3ptuU6ZjrNARKWx+zi40rMQBdgwjtOQ== X-Received: by 2002:a62:6104:: with SMTP id v4-v6mr33916536pfb.122.1537323049863; Tue, 18 Sep 2018 19:10:49 -0700 (PDT) Received: from [10.91.0.226] ([64.64.108.249]) by smtp.gmail.com with ESMTPSA id i26-v6sm23270864pfo.107.2018.09.18.19.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 19:10:49 -0700 (PDT) To: "Ni, Ruiyu" , linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, star.zeng@intel.com, eric.dong@intel.com Cc: huangming23@huawei.com, zhangjinsong2@huawei.com, liming.gao@intel.com, michael.d.kinney@intel.com, waip23@126.com, wanghuiqiang@huawei.com, huangdaode@hisilicon.com References: <20180915063656.6250-1-ming.huang@linaro.org> <20180915063656.6250-2-ming.huang@linaro.org> From: Ming Huang Message-ID: <3e849deb-9410-e59c-cd48-72d9f0f4188f@linaro.org> Date: Wed, 19 Sep 2018 10:10:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: [RFC MdeModulePkg/UefiBootManagerLib v1 1/1] MdeModulePkg/UefiBootManagerLib: Fix raid card repair fail issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 02:10:50 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 9/18/2018 5:40 PM, Ni, Ruiyu wrote: > On 9/15/2018 2:36 PM, Ming Huang wrote: >> When some type raid cards is not healthy, such as Broadcom 3108/3508 >> raid card, board will enter endless loop in BmRepairAllControllers() >> and can't show configuration formset which need to repair raid card. >> >> DriverHealthManagerDxe is added to platform dsc/fdf, driver health >> manager menu can show drivers which are not healthy, but raid card >> can not be repaired by the menus under Device Manager. This modification >> of BmRepairAllControllers() can show configuration formset for repair >> when booting an option. > > I developed that driver and the driver health related code in BDS library. But I a bit forgot the details. > > Can you explain why the driver health manager driver cannot handle such case? For Device Manager: When DriverHealthManagerDxe is added, I find a not healthy case of 3108/3508 raid caid that can not repair by DeviceManager menu: 1 enter the "AVAGO MegaRAID Driver Health Protocal Utility" menu, 2 show a form "Press any key to continue, or 'C' to load the configuration utility" 3 Press 'C', then no more form be show. This is not enouth to repair the card. The card is not healthy after reset board. For repair card, the "AVAGO MegaRAID Configuration Utility" should be show to user to change some items, then card can be repaired after reset board. For BmRepairAllControllers(): When card is no healthy and boot an option, BmRepairAllControllers() is invoked, then show the "Driver Health Manager" menu, but Esc can not exit from this menu, and repair form can not be show, nothing can do here except reset the board. Thanks, Ming > > > >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ming Huang >> --- >>   MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf |  2 + >>   MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c       | 48 +++++++++++++++++++- >>   2 files changed, 49 insertions(+), 1 deletion(-) >> >> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf >> index 228b91033695..b9f96c763ff6 100644 >> --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf >> +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf >> @@ -89,6 +89,8 @@ [Guids] >>     gEfiDiskInfoIdeInterfaceGuid                  ## SOMETIMES_CONSUMES ## GUID >>     gEfiDiskInfoScsiInterfaceGuid                 ## SOMETIMES_CONSUMES ## GUID >>     gEfiDiskInfoSdMmcInterfaceGuid                ## SOMETIMES_CONSUMES ## GUID >> +  gEfiHiiDriverHealthFormsetGuid >> +  gEfiHiiPlatformSetupFormsetGuid >>     [Protocols] >>     gEfiPciRootBridgeIoProtocolGuid               ## CONSUMES >> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c >> index ecd01bbb81e3..fd47651ec937 100644 >> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c >> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c >> @@ -421,6 +421,47 @@ EfiBootManagerFreeDriverHealthInfo ( >>     return gBS->FreePool (DriverHealthInfo); >>   } >>   +STATIC >> +VOID >> +ShowConfigureForm ( >> +  EFI_FORM_BROWSER2_PROTOCOL          *FormBrowser2, >> +  EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *DriverHealthInfo >> +  ) >> +{ >> +  EFI_STATUS                          Status; >> +  EFI_HII_HANDLE                      FormHiiHandle; >> +  EFI_DRIVER_HEALTH_STATUS            HealthStatus; >> + >> +  if (DriverHealthInfo != NULL) { >> +    Status = DriverHealthInfo->DriverHealth->GetHealthStatus ( >> +                                               DriverHealthInfo->DriverHealth, >> +                                               DriverHealthInfo->ControllerHandle, >> +                                               DriverHealthInfo->ChildHandle, >> +                                               &HealthStatus, >> +                                               NULL, >> +                                               &FormHiiHandle >> +                                               ); >> +    if (!EFI_ERROR (Status) && >> +        (HealthStatus == EfiDriverHealthStatusConfigurationRequired) && >> +        (FormHiiHandle != NULL)) { >> +      Status = FormBrowser2->SendForm ( >> +                               FormBrowser2, >> +                               &FormHiiHandle, >> +                               1, >> +                               &gEfiHiiPlatformSetupFormsetGuid, >> +                               0, >> +                               NULL, >> +                               NULL >> +                               ); >> +      if (EFI_ERROR (Status)) { >> +        Print (L"Show configurae menu:%r\n", Status); >> +      } >> +    } >> +  } >> + >> +  return; >> +} >> + >>   /** >>     Repair all the controllers according to the Driver Health status queried. >>   @@ -434,6 +475,7 @@ BmRepairAllControllers ( >>   { >>     EFI_STATUS                          Status; >>     EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *DriverHealthInfo; >> +  EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO *InfoConfigurationRequired; >>     EFI_DRIVER_HEALTH_STATUS            HealthStatus; >>     UINTN                               Count; >>     UINTN                               Index; >> @@ -462,6 +504,7 @@ BmRepairAllControllers ( >>     do { >>       RepairRequired        = FALSE; >>       ConfigurationRequired = FALSE; >> +    InfoConfigurationRequired = NULL; >>         // >>       // Deal with Repair Required >> @@ -470,6 +513,7 @@ BmRepairAllControllers ( >>       for (Index = 0; Index < Count; Index++) { >>         if (DriverHealthInfo[Index].HealthStatus == EfiDriverHealthStatusConfigurationRequired) { >>           ConfigurationRequired = TRUE; >> +        InfoConfigurationRequired = &DriverHealthInfo[Index]; >>         } >>           if (DriverHealthInfo[Index].HealthStatus == EfiDriverHealthStatusRepairRequired) { >> @@ -494,6 +538,7 @@ BmRepairAllControllers ( >>                                                              ); >>             if (!EFI_ERROR (Status) && (HealthStatus == EfiDriverHealthStatusConfigurationRequired)) { >>               ConfigurationRequired = TRUE; >> +            InfoConfigurationRequired = &DriverHealthInfo[Index]; >>             } >>           } >>         } >> @@ -507,12 +552,13 @@ BmRepairAllControllers ( >>                                      FormBrowser2, >>                                      &HiiHandles[Index], >>                                      1, >> -                                   PcdGetPtr (PcdDriverHealthConfigureForm), >> +                                   &gEfiHiiDriverHealthFormsetGuid, >>                                      0, >>                                      NULL, >>                                      NULL >>                                      ); >>             if (!EFI_ERROR (Status)) { >> +            ShowConfigureForm (FormBrowser2, InfoConfigurationRequired); >>               break; >>             } >>           } >> > >