public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga•com>
To: Tony Breeds <tony@bakeyournoodle•com>
Cc: ppcdev <linuxppc-dev@ozlabs•org>
Subject: Re: [RFC/PATCH] Implement {read,update}_persistent_clock. v2
Date: Tue, 11 Sep 2007 09:34:13 -0500	[thread overview]
Message-ID: <4d781cd1a4751e20098cae29aa4d2b60@bga.com> (raw)
In-Reply-To: <20070911081746.GF9814@bakeyournoodle.com>

On Tue Sep 11 18:17:46 EST 2007, Tony Breeds wrote:
> +unsigned long read_persistent_clock(void)
>  {
>         struct rtc_time tm;
> +       static int first = 1;
> +
> +       if (first) {
> +               first = 0;
> +               if (ppc_md.time_init)
> +                       timezone_offset = ppc_md.time_init();
> +       }
>
> -       if (ppc_md.get_boot_time)
> -               return ppc_md.get_boot_time();
> +       /* get_boot_time() isn't guaranteed to be safe to call late */
> +       /* FIXME: is the a better check available here? */
> +       if (system_state != SYSTEM_RUNNING && ppc_md.get_boot_time)
> +               return ppc_md.get_boot_time() -timezone_offset;
>         if (!ppc_md.get_rtc_time)
>                 return 0;
>         ppc_md.get_rtc_time(&tm);
>

Previously we called ppc_md.get_boot_time at most once.  How about 
moving the check for it into the if (first) block?

Have you tested with a platform that doesn't implement get_rtc_time?

milton

  reply	other threads:[~2007-09-11 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11  7:49 [RFC/PATCH] Implement {read,update}_persistent_clock Tony Breeds
2007-09-11  8:17 ` [RFC/PATCH] Implement {read,update}_persistent_clock. v2 Tony Breeds
2007-09-11 14:34   ` Milton Miller [this message]
2007-09-12  4:56     ` Tony Breeds
2007-09-11  8:28 ` [RFC/PATCH] Implement {read,update}_persistent_clock Gabriel Paubert

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=4d781cd1a4751e20098cae29aa4d2b60@bga.com \
    --to=miltonm@bga$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=tony@bakeyournoodle$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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