All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 4/6] x86/time: introduce probing logic for the wallclock
Date: Mon, 9 Sep 2024 13:02:50 +0200	[thread overview]
Message-ID: <Zt7V2mKWlETVLKVZ@macbook.local> (raw)
In-Reply-To: <af5ce242-1ec9-4ccc-a531-2252b2d8c90d@suse.com>

On Thu, Sep 05, 2024 at 05:58:47PM +0200, Jan Beulich wrote:
> On 04.09.2024 17:31, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/time.c
> > +++ b/xen/arch/x86/time.c
> > @@ -1291,14 +1291,23 @@ static bool __get_cmos_time(struct rtc_time *rtc)
> >      return t1 <= SECONDS(1) && t2 < MILLISECS(3);
> >  }
> >  
> > -static bool cmos_probe(struct rtc_time *rtc_p, bool cmos_rtc_probe)
> > +static bool __initdata cmos_rtc_probe;
> > +boolean_param("cmos-rtc-probe", cmos_rtc_probe);
> > +
> > +static bool __init cmos_probe(void)
> 
> I'm sorry for not paying attention to this earlier, but "cmos" alone
> is misleading here and perhaps even more so for cmos_read(). These
> aren't about the CMOS (storage) but the CMOS RTC. May I suggest
> cmos_rtc_{probe,read}() instead?

I've assumed that those living in time.c would be clear enough it's
the CMOS RTC, but I'm fine with renaming to cmos_rtc_{probe,read}().

> 
> >  {
> >      unsigned int seconds = 60;
> >  
> > +    if ( !(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) )
> > +        return true;
> > +
> > +    if ( !cmos_rtc_probe )
> > +        return false;
> 
> With this I think ...
> 
> >      for ( ; ; )
> >      {
> > -        bool success = __get_cmos_time(rtc_p);
> > -        struct rtc_time rtc = *rtc_p;
> > +        struct rtc_time rtc;
> > +        bool success = __get_cmos_time(&rtc);
> >  
> >          if ( likely(!cmos_rtc_probe) )
> >              return true;
> 
> ... this ends up being dead code.

Indeed, I've missed to remove that one when moving the check outside
of the for loop.

Thanks, Roger.


  reply	other threads:[~2024-09-09 11:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 15:31 [PATCH v4 0/6] x86/time: improvements to wallclock logic Roger Pau Monne
2024-09-04 15:31 ` [PATCH v4 1/6] x86/time: introduce helper to fetch Xen wallclock when running as a guest Roger Pau Monne
2024-09-05 15:45   ` Jan Beulich
2024-09-09 10:23     ` Roger Pau Monné
2024-09-04 15:31 ` [PATCH v4 2/6] x86/time: move CMOS edge detection into read helper Roger Pau Monne
2024-09-05 15:46   ` Jan Beulich
2024-09-04 15:31 ` [PATCH v4 3/6] x86/time: split CMOS read and probe logic into function Roger Pau Monne
2024-09-05 15:49   ` Jan Beulich
2024-09-04 15:31 ` [PATCH v4 4/6] x86/time: introduce probing logic for the wallclock Roger Pau Monne
2024-09-05 15:58   ` Jan Beulich
2024-09-09 11:02     ` Roger Pau Monné [this message]
2024-09-04 15:31 ` [PATCH v4 5/6] x86/time: introduce command line option to select wallclock Roger Pau Monne
2024-09-04 15:31 ` [PATCH v4 6/6] x86/time: prefer CMOS over EFI_GET_TIME Roger Pau Monne

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-all 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=Zt7V2mKWlETVLKVZ@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=jbeulich@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.