public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Masahisa Kojima <masahisa.kojima@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel@lists.01.org, Leif Lindholm <leif.lindholm@linaro.org>,
	 Yoshitoyo Osaki <osaki.yoshitoyo@socionext.com>
Subject: Re: [PATCH] Silicon/NXP/Pcf8563RealTimeClockLib: add rtc device initialization
Date: Tue, 19 Jun 2018 10:09:33 +0900	[thread overview]
Message-ID: <CADQ0-X-gSjn61bvYG5GnqpSCCt9=U8FejXR+MC1W_zJ9JFjkzA@mail.gmail.com> (raw)
In-Reply-To: <CADQ0-X9Sp3=juN-2bGUQYDwod4rwovX3dCpJ8EzafkEK2WatuA@mail.gmail.com>

Hi Ard,

This issue can be divided into following two issues.

1) Assertion occurs during boot time in DEBUG build, it depends on
    the uninitialized RTC device state(~70%)
2) SetTime() fails if GetTime() fails

For issue 1), we should update pcf8563 driver, ignore retrieved data
and return error when the VL bit is 1.

For issue 2), it is better to update shell command as your comment.
But situation is a little complicated.
UEFI shell command can only set DATE or TIME separately.
To set DATE, current procedure is like following.
 1) GetTime(retrieve both DATE and TIME)
 2) update only DATE
 3) Write back to RTC both DATE and TIME
So, current uefi shell can not set DATE/TIME without GetTime().
One possible solution is adding new command to set both DATE and TIME.
But it will change user experience and I'm not sure it is acceptable.
What do you think?

Regards,
Masahisa
On Tue, 19 Jun 2018 at 08:56, Masahisa Kojima
<masahisa.kojima@linaro.org> wrote:
>
> On Tue, 19 Jun 2018 at 00:51, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> >
> > On 18 June 2018 at 16:29, Masahisa Kojima <masahisa.kojima@linaro.org> wrote:
> > > Hi Ard,
> > >
> > > Thank you for comment.
> > >
> > >> Wouldn't it be better to return EFI_DEVICE_ERROR in this case?
> > >
> > > It is first option I come up with to fix this issue.
> > > But edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c::CheckAndSetTime()
> > > performs GetTime()->update with user specified time->SetTime(),
> > > If GetTime() failes, SetTime() never called and user can not set time.
> > >  # It really depends on the RTC device, we failed to set time in 70% devices.
> > >
> > > Another place to perform this dummy time/date setting is inside of
> > > LibRtcInitialize().
> > > Current error occurs in setting time, and I prefer to add this process
> > > in GetTime().
> > >
> >
> > I think we should fix the shell command instead. Setting the time
> > should be possible even if getting the time file, precisely for
> > situations like this one.
>
> OK, I agree with you.


  reply	other threads:[~2018-06-19  1:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 12:31 [PATCH] Silicon/NXP/Pcf8563RealTimeClockLib: add rtc device initialization masahisa.kojima
2018-06-18 13:03 ` Ard Biesheuvel
2018-06-18 14:29   ` Masahisa Kojima
2018-06-18 15:51     ` Ard Biesheuvel
2018-06-18 23:56       ` Masahisa Kojima
2018-06-19  1:09         ` Masahisa Kojima [this message]
2018-06-19  8:02           ` Ard Biesheuvel
2018-06-20  1:54             ` Masahisa Kojima

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='CADQ0-X-gSjn61bvYG5GnqpSCCt9=U8FejXR+MC1W_zJ9JFjkzA@mail.gmail.com' \
    --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