linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Prarit Bhargava <prarit@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] time, ntp: Do not update time_state in middle of leap
Date: Wed, 4 Feb 2015 17:30:05 +0100	[thread overview]
Message-ID: <20150204163005.GF26460@localhost> (raw)
In-Reply-To: <1423052928-21052-1-git-send-email-prarit@redhat.com>

Prarit Bhargava wrote:
> While this is highly unlikely to ever happen in the real world it is
> still something we should protect against, as breaking the state machine
> is obviously bad.

I'm not sure what exactly breaks here. If the PLL is disabled before
time_state is set to TIME_OOP, the insertion/deletion will be aborted.
If after that, adjtimex() will return with TIME_ERROR as expected, or
not?

>  static inline void process_adj_status(struct timex *txc, struct timespec64 *ts)
>  {
> -	if ((time_status & STA_PLL) && !(txc->status & STA_PLL)) {
> +	if ((time_status & STA_PLL) && !(txc->status & STA_PLL) &&
> +	    (time_state != TIME_OOP)) {
>  		time_state = TIME_OK;
>  		time_status = STA_UNSYNC;
>  		/* restart PPS frequency calibration */

Shouldn't be time_status reset and the PPS calibration restarted even
when state is TIME_OOP?

-- 
Miroslav Lichvar

  reply	other threads:[~2015-02-04 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 12:28 [PATCH] time, ntp: Do not update time_state in middle of leap second Prarit Bhargava
2015-02-04 16:30 ` Miroslav Lichvar [this message]
2015-02-05 13:20   ` [PATCH] time, ntp: Do not update time_state in middle of leap Prarit Bhargava
2015-02-06 10:38     ` Miroslav Lichvar
2015-02-06 10:50       ` Prarit Bhargava

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=20150204163005.GF26460@localhost \
    --to=mlichvar@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=tglx@linutronix.de \
    /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).