From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::142; helo=mail-lf1-x142.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 C139B2110718B for ; Thu, 30 Aug 2018 09:51:46 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id e23-v6so7730873lfc.13 for ; Thu, 30 Aug 2018 09:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=X9TfyMDUNRJy/tOUMHa3qnY06CXkTxHI1FrO5twfs48=; b=AzZim5kJBkJZtsDtDlkEeRK7vgcbTAks4BrlB9cJEDi2HB2lFzf/fhPqatKaZgvTaX 2Enjf3RiHbva1T6/Yc8l2gwCo/KkE45NbeAq/vRK2BwCEDHR+o20cAcIuLDYlrRDQ5VF pSMAjpEkuZ7CMUbNZrVfwd7VO+B7Iw2VasdRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=X9TfyMDUNRJy/tOUMHa3qnY06CXkTxHI1FrO5twfs48=; b=kEA5RAORnYX3Qzx75UiU29WEv2LRtDmFsku9nXhaMMFmTvdULzxLQnq86C2jEQTSuO JLbuAhz0mOcerdgZyzUmVl8eu6CES88GOrKgQNpfMxjH1pd+UsqLcpXJDM6PR86Ldqi9 yKXkhmKY55EN8GpODou7WkGg53fWwbxjtY4dMGdCRPuklK3l2POpAsoWzdeDE7Z6p52L VnMxo+52KijUL83o3TdlSDzyHod1LZ9fHqP47CMI05qxN5AP5URVLGzHOIIHRqp9R4ah a/Nf3WrVcejbmLzG9+RuOIQ/mutbNvj2K3K3ILHy8n+lvzqz822rkcr8gdjT9E8usw1r BXWA== X-Gm-Message-State: APzg51C3C6zPSqY5rMRdVOIaNY4lB0+Y8TyU6uViW1ZzYiTvQmIsBxk+ RpDcTxyGHi8k36LXFzBBshdqzoLD1zQ8o0DvoT8pew== X-Google-Smtp-Source: ANB0VdbvFr1zvdlxFjvqPjJniJ+V/aFCuvhh+iyaZafJeQiM8MmvS0jVEHcf42R1az33oHazF/fsXB1vGksiRmKzMUg= X-Received: by 2002:a19:5a17:: with SMTP id o23-v6mr1858718lfb.51.1535647904368; Thu, 30 Aug 2018 09:51:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:384e:0:0:0:0:0 with HTTP; Thu, 30 Aug 2018 09:51:43 -0700 (PDT) In-Reply-To: <20180823160743.45638-11-ming.huang@linaro.org> References: <20180823160743.45638-1-ming.huang@linaro.org> <20180823160743.45638-11-ming.huang@linaro.org> From: Leif Lindholm Date: Thu, 30 Aug 2018 17:51:43 +0100 Message-ID: To: Ming Huang Cc: Linaro UEFI , "edk2-devel@lists.01.org" , Graeme Gregory , Ard Biesheuvel , "Kinney, Michael D" , Laszlo Ersek , Guoheyi , wanghuiqiang , Ming Huang , Jason Zhang , Daode Huang , John Garry , "xinliang.liu" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [PATCH edk2-platforms v4 10/31] Silicon/Hisilicon/D06: Wait for all disk ready 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: Thu, 30 Aug 2018 16:51:47 -0000 Content-Type: text/plain; charset="UTF-8" On 23 August 2018 at 17:07, Ming Huang wrote: > > This patch is relative to D06 SasDxe driver. The SasDxe set a > variable to notice this libray. Here Wait for all disk ready > for 15S at most. > > D06: > For using straight-through hard disk backboard, some disk need > 15 seconds to ready. Actually, wait less 15 seconds here(minus > the time from end of SAS driver to here). > For using expander backboard, wait less 6 seconds here(minus > the time from end of SAS driver to here). > > D03/D05: > As Sas driver don't install PLATFORM_SAS_NOTIFY Protocol, D03/D05 > will skip waiting here. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ming Huang > --- > Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 4 +++ > Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c | 37 ++++++++++++++++++++ > 2 files changed, 41 insertions(+) > > diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > index 7a53befc44..415f8ee36e 100644 > --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > @@ -36,6 +36,7 @@ > [Packages] > MdeModulePkg/MdeModulePkg.dec > MdePkg/MdePkg.dec > + Silicon/Hisilicon/HisiliconNonOsi.dec > Silicon/Hisilicon/HisiPkg.dec > > [LibraryClasses] > @@ -49,6 +50,7 @@ > MemoryAllocationLib > PcdLib > PrintLib > + TimerLib > UefiBootManagerLib > UefiBootServicesTableLib > UefiLib > @@ -67,8 +69,10 @@ > [Guids] > gEfiEndOfDxeEventGroupGuid > gEfiTtyTermGuid > + gOemConfigGuid This patch still adds a dependency on this guid, but it is not introduced until 14/31, so it breaks the build at 10,11,12,13/31. Also, it is not required for this patch. So introduce it only with the code that first uses it. / Leif > > [Protocols] > gEfiGenericMemTestProtocolGuid > gEfiLoadedImageProtocolGuid > gEsrtManagementProtocolGuid > + gPlatformSasNotifyProtocolGuid > diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c > index aa6db929ca..77295d0111 100644 > --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -29,6 +30,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -554,6 +556,40 @@ PlatformBootManagerBeforeConsole ( > PlatformRegisterOptionsAndKeys (); > } > > +STATIC > +VOID > +WaitForDiskReady ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UINT32 Index; > + PLATFORM_SAS_NOTIFY *SasNotify; > + > + Status = gBS->LocateProtocol ( > + &gPlatformSasNotifyProtocolGuid, > + NULL, > + (VOID **)&SasNotify); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_INFO, "Locate SasPlatformNotify:%r\n", Status)); > + return; > + } > + > + // Wait for 30 seconds at most. > + for (Index = 0; Index < 30; Index++) { > + Status = gBS->CheckEvent (SasNotify->WaitDiskEvent); > + if (!EFI_ERROR (Status)) { > + DEBUG ((DEBUG_INFO, "WaitDiskEvent is signaled.\n")); > + EfiBootManagerConnectAll (); > + break; > + } > + DEBUG ((DEBUG_ERROR, "%a", Index == 0 ? "Wait for disk." : ".")); > + MicroSecondDelay (1000 * 1000); > + } > + > + return; > +} > + > /** > Do the platform specific action after the console is ready > Possible things that can be done in PlatformBootManagerAfterConsole: > @@ -583,6 +619,7 @@ PlatformBootManagerAfterConsole ( > // Connect the rest of the devices. > // > EfiBootManagerConnectAll (); > + WaitForDiskReady (); > > // > // Enumerate all possible boot options. > -- > 2.18.0 >