From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from huawei.com (huawei.com [45.249.212.190]) by mx.groups.io with SMTP id smtpd.web11.4141.1590579518713310700 for ; Wed, 27 May 2020 04:38:39 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.190, mailfrom: huangming23@huawei.com) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 603E546645D9D1863205; Wed, 27 May 2020 19:38:35 +0800 (CST) Received: from [127.0.0.1] (10.78.51.60) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 27 May 2020 19:38:25 +0800 Subject: Re: [RFC edk2-platforms v1 1/3] Silicon/Hisilicon: Change updating dsdt in ready to boot event To: Leif Lindholm CC: , , , , , References: <1590072184-16219-1-git-send-email-huangming23@huawei.com> <1590072184-16219-2-git-send-email-huangming23@huawei.com> <20200526174001.GN1923@vanye> From: Ming Huang Message-ID: Date: Wed, 27 May 2020 19:38:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20200526174001.GN1923@vanye> X-Originating-IP: [10.78.51.60] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: quoted-printable =D4=DA 2020/5/27 1:40, Leif Lindholm =D0=B4=B5=C0: > Please call your patches PATCH. RFC is when a potential solution > is put up for discussion, not for changing platform code. Modify it in v2. >=20 > On Thu, May 21, 2020 at 22:43:02 +0800, Ming Huang wrote: >> The better time for updating dsdt is in ready to boot event, >> so change the updating time. >=20 > The commit message should explain *why* it is better. Modify it in v2. >=20 >> >> Signed-off-by: Ming Huang >> --- >> Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatform.c | 60 +++++++= +++++++++++-- >> 1 file changed, 56 insertions(+), 4 deletions(-) >> >> diff --git a/Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatform.c = b/Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatform.c >> index b888cb1..1ab55bc 100644 >> --- a/Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatform.c >> +++ b/Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatform.c >> @@ -1,8 +1,8 @@ >> /** @file >> =20 >> - Copyright (c) 2014, Applied Micro Curcuit Corporation. All rights r= eserved.
>> - Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>> - Copyright (c) 2015, Linaro Limited. All rights reserved.
>> + Copyright (c) 2014 - 2020, Applied Micro Curcuit Corporation. All r= ights reserved.
>> + Copyright (c) 2015 - 2020, Hisilicon Limited. All rights reserved.<= BR> >> + Copyright (c) 2015 - 2020, Linaro Limited. All rights reserved.
>=20 > Only the Hisilicon copyright should be updated (or a Huawei one added, > given that this is the address used for submitting). Ok, just modify Hisilicon copyright in v2. Thanks, Ming >=20 > / > Leif >=20 >> SPDX-License-Identifier: BSD-2-Clause-Patent >> =20 >> **/ >> @@ -23,6 +23,38 @@ >> #include >> #include "EthMac.h" >> =20 >> +EFI_EVENT mUpdateAcpiDsdtTableEvent; >> + >> +VOID >> +EFIAPI >> +UpdateAcpiDsdt ( >> + IN EFI_EVENT Event, >> + IN VOID *Context >> + ) >> +{ >> + EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; >> + EFI_STATUS Status; >> + >> + Status =3D gBS->LocateProtocol ( >> + &gEfiAcpiTableProtocolGuid, >> + NULL, >> + (VOID**)&AcpiTableProtocol >> + ); >> + >> + if (EFI_ERROR (Status)) { >> + DEBUG ((DEBUG_ERROR, " Unable to locate ACPI table protocol\n")); >> + return; >> + } >> + >> + Status =3D EthMacInit (); >> + if (EFI_ERROR (Status)) { >> + DEBUG ((DEBUG_ERROR, " UpdateAcpiDsdtTable Failed, Status =3D %r\= n", Status)); >> + } >> + >> + gBS->CloseEvent (Event); >> + return; >> +} >> + >> EFI_STATUS >> EFIAPI >> AcpiPlatformEntryPoint ( >> @@ -30,5 +62,25 @@ AcpiPlatformEntryPoint ( >> IN EFI_SYSTEM_TABLE *SystemTable >> ) >> { >> - return EthMacInit(); >> + EFI_STATUS Status; >> + >> + // >> + // Register notify function >> + // >> + Status =3D gBS->CreateEventEx ( >> + EVT_NOTIFY_SIGNAL, >> + TPL_CALLBACK, >> + UpdateAcpiDsdt, >> + NULL, >> + &gEfiEventReadyToBootGuid, >> + &mUpdateAcpiDsdtTableEvent >> + ); >> + >> + if (EFI_ERROR (Status)) { >> + DEBUG ((DEBUG_ERROR, "Create ReadyToBoot event for UpdateAcpiDsdt= failed.\n")); >> + } else { >> + DEBUG ((DEBUG_INFO, "Create ReadyToBoot event for UpdateAcpiDsdt = success.\n")); >> + } >> + >> + return Status; >> } >> --=20 >> 2.8.1 >> >=20 > . >=20