From patchwork Sat Sep 15 06:33:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 146763 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1494921ljw; Fri, 14 Sep 2018 23:33:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZYz8p+aUoFPea5+oNoCpn5iBPobFKLFz6BtqEO0+uYl1yMWhoYLHN3uwm1P2+AYgRB2iJx X-Received: by 2002:a17:902:a507:: with SMTP id s7-v6mr14974470plq.303.1536993208619; Fri, 14 Sep 2018 23:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536993208; cv=none; d=google.com; s=arc-20160816; b=WJjt5i5i22XtuSZJhlttSteTTFYbRFCpXpEcdYQk9Uaphb17ip6J7OP1yvs8mb4Hnz rPnD8ms9KL8GPgv4ybTaopH3ISYbapPi2xdtUUZyctDUvmf8hNQnhqx7WKYUrm6f9kto X8B7q4dIviE8Jv1ER3MFBZ4tpVk0okqzcbxYCt7zn1oz8umprinG1484doyelx5LLySl 0tsdj2femTnmMxxJVYGfsSE31I999Ivf+Ln5t6LG1t6qOe9tbAAgF4fVGAzKW84+2ZTK VMlSL8OHvLzzMk9BNhjItTaY+nQ9xvMJl5bORb8I3NJXl9o4fxsx/xnyqB2oVeQPN8GO lg3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=PgO5PJ4XirKKTmRGkaw1E2ta7ZeeEIqah87/0uUbd0c=; b=VIVY1q3n2kOnfxAJdoTQ+vfvYOcVgYN0hvsBZ+SNxp7e78JYc1MfTmgKbCKsi1hind KCcfeTqkJrbJkp88ZhJ1lbKNLH35KohL7zo2sCAl7i0tyOacm9biFBb6tlBP9ks0I2fd OPpX47XIvyrOdc24lEp5K02K3QXr5l65STXMf/AJrLikYAQF+ent0DbD7rQgj6GIV8cY j/PwdIiQ2mOSq1XLY+kknJ/kEHD3HSNaCyG9u7tv2K1sNome+haX+hXyKgOrY1qw2NL4 e0xyjbkiG9N6kLzWbqrzUHcyDsnIGUEUYdmeD6ueeFU+ROm6xkTKmYWuvpPHxlFIoL1o B+ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=exOApaHK; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id a61-v6si9336435plc.80.2018.09.14.23.33.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 23:33:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=exOApaHK; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 34B4A21131DD6; Fri, 14 Sep 2018 23:33:28 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (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 902ED21131DCC for ; Fri, 14 Sep 2018 23:33:26 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id d19-v6so5368006pgv.1 for ; Fri, 14 Sep 2018 23:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LFF+ZnYx7vWTim+EuZaBADqgvsHYw5EcUW3yhahmd4A=; b=exOApaHKU7z0E96Jgjww4qV7mt7kqGFgDB+3WatrkYk9ntMRB/GicKf+JHLwpf9xAh AWvQupUx1wDS8lYAMe3frZ6Ycy83QJaIayuno0/ccVt3qsZthKp63kV5cTDRXCZmmIn4 VPYu1K9e9UkgbRi7ukvrCc0+dbdO/r5oxB40U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LFF+ZnYx7vWTim+EuZaBADqgvsHYw5EcUW3yhahmd4A=; b=Hbt+hC9HR5ghemJchA2YU0OQX/ymMDR9DtcAYu5c4w/QcbGMSGKQAqeqDXdRXXJOTQ xHsjzT+erBdE/wWNjb9dOxpMXSNaNbODPb+NW4TY+tXARZ9H9ozXkY0UpJb+mywYGYlu KvYwfIuRnMV7tsybyhYvz1uY64ZEH45kaItDuqf5O5TeLOHI6FprUTcdg8j5M4uXFo/t JSH5hGZCbtTXs6/1VA8AbunvwjcE0F023Icw7vBEdP+Q8f+WJJ1+dzQ4JqZqIo9BJpjA 4Gr+g7CPdWPukvhKblcsXsFvP6zRsBDjFr1ddtykuVut8BJspDSIJSeuO4gc6Vpn6iK7 aGPA== X-Gm-Message-State: APzg51AJ7xFB7r8cIjWsmk5MDQrqx+5/KUEuEXR4l/AHuLEwNBRwOUp/ OkxseNz/iq+izxU/srhHTLuqVn+V44I= X-Received: by 2002:a62:c008:: with SMTP id x8-v6mr15820188pff.149.1536993206131; Fri, 14 Sep 2018 23:33:26 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t2-v6sm17001821pfj.7.2018.09.14.23.33.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Sep 2018 23:33:25 -0700 (PDT) From: Ming Huang To: huangming23@huawei.com, edk2-devel@lists.01.org Date: Sat, 15 Sep 2018 14:33:18 +0800 Message-Id: <20180915063318.4854-2-ming.huang@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180915063318.4854-1-ming.huang@linaro.org> References: <20180915063318.4854-1-ming.huang@linaro.org> Subject: [edk2] [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: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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. 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(-) -- 2.18.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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; } }