public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime
@ 2021-05-24  3:54 Marcin Wojtas
  2021-05-24  6:25 ` Sunny Wang
  2021-06-02  7:41 ` Ard Biesheuvel
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Wojtas @ 2021-05-24  3:54 UTC (permalink / raw)
  To: devel
  Cc: michael.d.kinney, leif, ardb+tianocore, Samer.El-Haj-Mahmoud,
	sunny.Wang, gjb, upstream, Marcin Wojtas

GetWakeupTime should return full time information, including
the daylight/timezone. Make use of the existing non-volatile
variables for that purpose. Moreover add an error checking
of possibly invalid parameters.
This partially fixes FWTS and SCT Set/GetWakeupTime tests on
Marvell platforms.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
index e59036badc..85650a6ede 100644
--- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
@@ -143,6 +143,17 @@ GetWakeupTime (
   OUT EFI_TIME    *Time
   )
 {
+  if (Time == NULL || Enabled == NULL || Pending == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Set these first so the RealTimeClockLib implementation
+  // can override them based on its own settings.
+  //
+  Time->TimeZone = mTimeSettings.TimeZone;
+  Time->Daylight = mTimeSettings.Daylight;
+
   return LibGetWakeupTime (Enabled, Pending, Time);
 }
 
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime
  2021-05-24  3:54 [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime Marcin Wojtas
@ 2021-05-24  6:25 ` Sunny Wang
  2021-06-02  7:41 ` Ard Biesheuvel
  1 sibling, 0 replies; 3+ messages in thread
From: Sunny Wang @ 2021-05-24  6:25 UTC (permalink / raw)
  To: Marcin Wojtas, devel@edk2.groups.io
  Cc: michael.d.kinney@intel.com, leif@nuviainc.com,
	ardb+tianocore@kernel.org, Samer El-Haj-Mahmoud, gjb@semihalf.com,
	upstream@semihalf.com, Sunny Wang

Looks good to me. Good catch!
Reviewed-by: Sunny Wang <sunny.wang@arm.com>

By the way, just FYI, I still run into the same problem (line-ending problem) with Windows Outlook and EDK2 email archive https://edk2.groups.io/g/devel/topic/patch/83043513?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,83043513. Moreover, Gmail works well, so I used it to review this patch.

Best Regards,
Sunny Wang

-----Original Message-----
From: Marcin Wojtas <mw@semihalf.com>
Sent: Monday, May 24, 2021 11:55 AM
To: devel@edk2.groups.io
Cc: michael.d.kinney@intel.com; leif@nuviainc.com; ardb+tianocore@kernel.org; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Sunny Wang <Sunny.Wang@arm.com>; gjb@semihalf.com; upstream@semihalf.com; Marcin Wojtas <mw@semihalf.com>
Subject: [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime

GetWakeupTime should return full time information, including the daylight/timezone. Make use of the existing non-volatile variables for that purpose. Moreover add an error checking of possibly invalid parameters.
This partially fixes FWTS and SCT Set/GetWakeupTime tests on Marvell platforms.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
index e59036badc..85650a6ede 100644
--- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
@@ -143,6 +143,17 @@ GetWakeupTime (
   OUT EFI_TIME    *Time   ) {+  if (Time == NULL || Enabled == NULL || Pending == NULL) {+    return EFI_INVALID_PARAMETER;+  }++  //+  // Set these first so the RealTimeClockLib implementation+  // can override them based on its own settings.+  //+  Time->TimeZone = mTimeSettings.TimeZone;+  Time->Daylight = mTimeSettings.Daylight;+   return LibGetWakeupTime (Enabled, Pending, Time); } --
2.29.0

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime
  2021-05-24  3:54 [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime Marcin Wojtas
  2021-05-24  6:25 ` Sunny Wang
@ 2021-06-02  7:41 ` Ard Biesheuvel
  1 sibling, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2021-06-02  7:41 UTC (permalink / raw)
  To: Marcin Wojtas
  Cc: edk2-devel-groups-io, Michael Kinney, Leif Lindholm,
	Ard Biesheuvel, Samer El-Haj-Mahmoud, Sunny Wang,
	Grzegorz Bernacki, upstream

On Mon, 24 May 2021 at 05:55, Marcin Wojtas <mw@semihalf.com> wrote:
>
> GetWakeupTime should return full time information, including
> the daylight/timezone. Make use of the existing non-volatile
> variables for that purpose. Moreover add an error checking
> of possibly invalid parameters.
> This partially fixes FWTS and SCT Set/GetWakeupTime tests on
> Marvell platforms.
>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Merged as #1682

Thanks,

> ---
>  EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> index e59036badc..85650a6ede 100644
> --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> @@ -143,6 +143,17 @@ GetWakeupTime (
>    OUT EFI_TIME    *Time
>    )
>  {
> +  if (Time == NULL || Enabled == NULL || Pending == NULL) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  //
> +  // Set these first so the RealTimeClockLib implementation
> +  // can override them based on its own settings.
> +  //
> +  Time->TimeZone = mTimeSettings.TimeZone;
> +  Time->Daylight = mTimeSettings.Daylight;
> +
>    return LibGetWakeupTime (Enabled, Pending, Time);
>  }
>
> --
> 2.29.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-02  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24  3:54 [PATCH] EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime Marcin Wojtas
2021-05-24  6:25 ` Sunny Wang
2021-06-02  7:41 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox