Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755776AbbBDQaG (ORCPT ); Wed, 4 Feb 2015 11:30:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49837 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753617AbbBDQaE (ORCPT ); Wed, 4 Feb 2015 11:30:04 -0500 Date: Wed, 4 Feb 2015 17:30:05 +0100 From: Miroslav Lichvar To: Prarit Bhargava Cc: John Stultz , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH] time, ntp: Do not update time_state in middle of leap Message-ID: <20150204163005.GF26460@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423052928-21052-1-git-send-email-prarit@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 29 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/