From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932337AbcIBT3g (ORCPT ); Fri, 2 Sep 2016 15:29:36 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54982 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932188AbcIBT3f (ORCPT ); Fri, 2 Sep 2016 15:29:35 -0400 Date: Fri, 2 Sep 2016 21:26:51 +0200 (CEST) From: Thomas Gleixner To: "Rafael J. Wysocki" cc: Chen Yu , x86@kernel.org, John Stultz , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org, Xunlei Pang , "3.17+" , Zhang Rui , linux-pm@vger.kernel.org Subject: Re: [PATCH][RFC v5] timekeeping: Ignore the bogus sleep time if pm_trace is enabled In-Reply-To: <4130556.MNmyvLDyHH@vostro.rjw.lan> Message-ID: References: <1472402439-1146-1-git-send-email-yu.c.chen@intel.com> <4130556.MNmyvLDyHH@vostro.rjw.lan> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Aug 2016, Rafael J. Wysocki wrote: > On Monday, August 29, 2016 12:40:39 AM Chen Yu wrote: > > + > > + /* > > + * Make rtc-based persistent clock unusable > > + * if pm_trace is enabled, only take effect > > + * for timekeeping_suspend/resume. > > + */ > > + if (pm_trace_is_enabled() && > > + x86_platform.get_wallclock == mach_get_cmos_time) { > > + ts->tv_sec = 0; > > + ts->tv_nsec = 0; > > + } > > I'm not sure about this. Looks hackish. Indeed. Can't you just keep track that pm_trace fiddled with the cmos clock and then discard the value either in the core or in mach_get_cmos_time() Thanks, tglx