linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: Avoid giving out RTC dates below EPOCH
Date: Mon, 02 Nov 2009 16:13:52 +1100	[thread overview]
Message-ID: <1257138832.7907.33.camel@pasglop> (raw)
In-Reply-To: <1257138663.7907.32.camel@pasglop>

On Mon, 2009-11-02 at 16:11 +1100, Benjamin Herrenschmidt wrote:
> Doing so causes xtime to be negative which crashes the timekeeping
> code in funny ways when doing suspend/resume
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---

> +void read_persistent_clock(struct timespec *ts)
> +{
> +	__read_persistent_clock(&ts);

Should read

+	__read_persistent_clock(ts);

Forgot a quilt ref ;-)

Cheers,
Ben.

> +	/* Sanitize it in case real time clock is set below EPOCH */
> +	if (ts->tv_sec < 0) {
> +		ts->tv_sec = 0;
> +		ts->tv_nsec = 0;
> +	}
> +		
> +}
> +
>  /* clocksource code */
>  static cycle_t rtc_read(struct clocksource *cs)
>  {
> 
> 
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

      reply	other threads:[~2009-11-02  5:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  5:11 [PATCH] powerpc: Avoid giving out RTC dates below EPOCH Benjamin Herrenschmidt
2009-11-02  5:13 ` Benjamin Herrenschmidt [this message]

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=1257138832.7907.33.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).