[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150204163005.GF26460@localhost>
Date: Wed, 4 Feb 2015 17:30:05 +0100
From: Miroslav Lichvar <mlichvar@...hat.com>
To: Prarit Bhargava <prarit@...hat.com>
Cc: John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] time, ntp: Do not update time_state in middle of leap
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists