From patchwork Sat Sep 15 06:36:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 146765 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1497478ljw; Fri, 14 Sep 2018 23:37:09 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdar1V1zseuSFu33FYPfXZWRZ5gFf4t0QneapnbJQC80FepesqAnkLxj0u+VPsJe0NAJE+UT X-Received: by 2002:a62:198e:: with SMTP id 136-v6mr15926187pfz.103.1536993429236; Fri, 14 Sep 2018 23:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536993429; cv=none; d=google.com; s=arc-20160816; b=MQHhsc1cv3Bgh2jQIDQ25ta9yUnDiE7+3oQMtZJnUVpImaW6BeKh8aE0uTXpmvaV56 6oRjUJaFCiSLc0r0/tNeoCE4qq/yfz8sXe2qm8a4MIn7817jXBmy3jsPfGxw5eEAoiGJ YAXc0atd2JLih3OfnHJ6yfhF06g9WUdnFosFry3wD0m7QKdTJbIOTbRgqwJSizZbkvVl ZZyEZ/PU1UQIuwuZFnxM9Dfw8qj3JSdmw3n1vWkV6ueL8qnv9UJLrwizCyd9c7OUExCa rOR4nQk9c6qAS/7r5BNsWeXsfZxRE3ajWUuoyf5vDYoNBsr/knMR1pKQDQl2iOYlE8xu YU+Q== 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:cc :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=aDcg487Yjt3iBgYtuetnB7ilY4GiRIn/ePr61NLUPeffieyu+tKy7ffcGFs18O77rW e6M78yF/MR/XNJrzaDo508CzbVPHeUjPaq5Mw19PqCnTNLqiRbnyKaLcP/NwCMK1Yqee d2/pTEldeqrmUZDZdVUpbi2WHmdRzyMI+89ughWUuvV/eiu29UU9DOBjM4CNhuPU2CFy piYYv6QEVWribCr4tDRzEG/0QbVg0iR2Izp5uRWANdh5vmIjbDi5P+lqASSmznOrAW0t MR0LBAXYKgzT0nZxBdw3F1pYBEqANKnQYyfZf/U59L56tKbZQtKBI5GQ48NXKKY9bZzS I1eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZQ8NW7AR; 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 q12-v6si9617023pfc.349.2018.09.14.23.37.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 23:37:09 -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=ZQ8NW7AR; 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 D71CE21131DDF; Fri, 14 Sep 2018 23:37:08 -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::642; helo=mail-pl1-x642.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (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 9787D211300B1 for ; Fri, 14 Sep 2018 23:37:07 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id f6-v6so5148580plo.1 for ; Fri, 14 Sep 2018 23:37:07 -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=ZQ8NW7ARFdmvr4hIcDrmg7uIlJBVkqDu87Lidl9bqt9mCDFpCN31fdcFKdbnx8liT9 f45elIsKtki8txHhnQkww65GubH4/WTMjdcFZAfY7q0x20J8KWEgjXN+BT0mAfzlGBz4 txo3bVYEXPYV6u03EgvJdMNzmftL3NF/Ha9Nk= 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=bD3GZESmvzg39OV7yl54TsYFB6ein8X0dkWoPiiNRCY+V14/kTUlL6kOi4NJtVN3Gy 1cgHly0HP6YGiXa0VJMY3iLCOVD3kCddOTqdFseQDhJE7iNGPIGUIksEg4hFhmMScJX5 HlByIi/q95z3zVPp3ptf/4pKjYonemyRphNoUsQoivHpVtmxdIRVl+5+AcDJqLdcj2Ab s8e08/WbLs9Mxb4DTCKFzJZXcB4A/mr/Xn5uJU7XhD9kZaa8Rbm5b7DIOv/93JIJtm3P 3ffdHfOwcTux2jfyyTJFs1GEvFPApbtHmFt6jO9ByR8S6Fh1Uwy0GZBeI/bKYGI8GrSZ 4c1A== X-Gm-Message-State: APzg51DJky7jZKT1rsrWojtAVpC/vFUOGm2r2kvj/hB18oayveWSPHDw KN50V+avIVNs3LDiwg8Ep6HGwQ== X-Received: by 2002:a17:902:b81:: with SMTP id 1-v6mr15503918plr.319.1536993427263; Fri, 14 Sep 2018 23:37:07 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id r205-v6sm14794048pgr.11.2018.09.14.23.37.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Sep 2018 23:37:06 -0700 (PDT) From: Ming Huang To: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, star.zeng@intel.com, eric.dong@intel.com Date: Sat, 15 Sep 2018 14:36:56 +0800 Message-Id: <20180915063656.6250-2-ming.huang@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180915063656.6250-1-ming.huang@linaro.org> References: <20180915063656.6250-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: , 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 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; } }