public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Ming Huang <huangming23@huawei.com>
Cc: devel@edk2.groups.io, ard.biesheuvel@linaro.org,
	lidongzhan@huawei.com, songdongkuang@huawei.com,
	wanghuiqiang@huawei.com, qiuliangen@huawei.com
Subject: Re: [RFC edk2-platforms v1 1/3] Silicon/Hisilicon: Change updating dsdt in ready to boot event
Date: Tue, 26 May 2020 18:40:01 +0100	[thread overview]
Message-ID: <20200526174001.GN1923@vanye> (raw)
In-Reply-To: <1590072184-16219-2-git-send-email-huangming23@huawei.com>

Please call your patches PATCH. RFC is when a potential solution
is put up for discussion, not for changing platform code.

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.

The commit message should explain *why* it is better.

> 
> Signed-off-by: Ming Huang <huangming23@huawei.com>
> ---
>  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
>  
> -  Copyright (c) 2014, Applied Micro Curcuit Corporation. All rights reserved.<BR>
> -  Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
> -  Copyright (c) 2015, Linaro Limited. All rights reserved.<BR>
> +  Copyright (c) 2014 - 2020, Applied Micro Curcuit Corporation. All rights reserved.<BR>
> +  Copyright (c) 2015 - 2020, Hisilicon Limited. All rights reserved.<BR>
> +  Copyright (c) 2015 - 2020, Linaro Limited. All rights reserved.<BR>

Only the Hisilicon copyright should be updated (or a Huawei one added,
given that this is the address used for submitting).

/
    Leif

>    SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>  **/
> @@ -23,6 +23,38 @@
>  #include <IndustryStandard/AcpiAml.h>
>  #include "EthMac.h"
>  
> +EFI_EVENT       mUpdateAcpiDsdtTableEvent;
> +
> +VOID
> +EFIAPI
> +UpdateAcpiDsdt (
> +  IN EFI_EVENT         Event,
> +  IN VOID              *Context
> +  )
> +{
> +  EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;
> +  EFI_STATUS              Status;
> +
> +  Status = gBS->LocateProtocol (
> +                  &gEfiAcpiTableProtocolGuid,
> +                  NULL,
> +                  (VOID**)&AcpiTableProtocol
> +                  );
> +
> +  if (EFI_ERROR (Status)) {
> +    DEBUG ((DEBUG_ERROR, " Unable to locate ACPI table protocol\n"));
> +    return;
> +  }
> +
> +  Status = EthMacInit ();
> +  if (EFI_ERROR (Status)) {
> +    DEBUG ((DEBUG_ERROR, " UpdateAcpiDsdtTable Failed, Status = %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 = 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;
>  }
> -- 
> 2.8.1
> 

  reply	other threads:[~2020-05-26 17:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 14:43 [RFC edk2-platforms v1 0/3] Improve D0x Ming Huang
2020-05-21 14:43 ` [RFC edk2-platforms v1 1/3] Silicon/Hisilicon: Change updating dsdt in ready to boot event Ming Huang
2020-05-26 17:40   ` Leif Lindholm [this message]
2020-05-27 11:38     ` Ming Huang
2020-05-21 14:43 ` [RFC edk2-platforms v1 2/3] Silicon/Hisilicon/Acpi: Add update sas address feature Ming Huang
2020-05-26 18:49   ` Leif Lindholm
2020-05-27 14:21     ` Ming Huang
2020-05-21 14:43 ` [RFC edk2-platforms v1 3/3] Silicon/Hisilicon: Rename EthMac files Ming Huang
2020-05-26 18:50   ` Leif Lindholm
2020-05-27 14:22     ` Ming Huang
2020-05-26 18:09 ` [RFC edk2-platforms v1 0/3] Improve D0x Leif Lindholm
2020-05-27 14:31   ` Ming Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200526174001.GN1923@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox