From patchwork Tue Jul 17 18:05:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john stultz X-Patchwork-Id: 10070 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B06C423E2F for ; Tue, 17 Jul 2012 18:12:09 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6A13EA1864F for ; Tue, 17 Jul 2012 18:12:09 +0000 (UTC) Received: by ggnf1 with SMTP id f1so764235ggn.11 for ; Tue, 17 Jul 2012 11:12:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-ibm-iss-spamdetectors :x-ibm-iss-detailinfo:x-gm-message-state; bh=HKQGshEMvPGzFJ72iIpP5ZJVtussdcgjGqV15haQz64=; b=ObWfxc1OoCdKFTeAKJlM8MxLiItQBr/3ysDH9L/h1mtOeA3ytH4ucawIWjPTZqFTxw b6Ns0BMnBOt7C6/9MuX8aH3w2m0trrUAk9YG6Vm3qXlXXJ33FE81cMgNUAT6ZQa8d/YI vTxNBld3c2Xl8pgjB0mYc7zy/SdARBUV6Ex6byBHKxZOREP2ukJEWizo+ionkubatp3N 2skP1PwNKHL+bBiQhMKNj/PamL3bJDohQrD7Vye+yqyxKY72BznjaJ7E87NjY586XKCR UvgqrrtKyYsBoMz8oDIGjWbH8t0Wf7GNxwTHokXDRN8oPS2xXNgoErbtWeI8FL5JWCem q3kQ== Received: by 10.50.57.167 with SMTP id j7mr2190278igq.53.1342548728316; Tue, 17 Jul 2012 11:12:08 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.241.2 with SMTP id lc2csp23006ibb; Tue, 17 Jul 2012 11:12:07 -0700 (PDT) Received: by 10.60.29.38 with SMTP id g6mr4688356oeh.45.1342548727509; Tue, 17 Jul 2012 11:12:07 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com. [32.97.110.152]) by mx.google.com with ESMTPS id r4si19062462obz.177.2012.07.17.11.12.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 11:12:07 -0700 (PDT) Received-SPF: pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.152 as permitted sender) client-ip=32.97.110.152; Authentication-Results: mx.google.com; spf=pass (google.com: domain of johnstul@us.ibm.com designates 32.97.110.152 as permitted sender) smtp.mail=johnstul@us.ibm.com Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 12:12:05 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Jul 2012 12:06:53 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id D2827C40010; Tue, 17 Jul 2012 18:06:46 +0000 (WET) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6HI6Fah166566; Tue, 17 Jul 2012 12:06:17 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6HI67Ae019385; Tue, 17 Jul 2012 12:06:09 -0600 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6HI60xi018372; Tue, 17 Jul 2012 12:06:05 -0600 From: John Stultz To: stable@vger.kernel.org Cc: Thomas Gleixner , Eric Dumazet , Richard Cochran , Prarit Bhargava , Linux Kernel , John Stultz Subject: [PATCH 04/11] 2.6.35.x: time: Move common updates to a function Date: Tue, 17 Jul 2012 14:05:35 -0400 Message-Id: <1342548342-19683-5-git-send-email-johnstul@us.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342548342-19683-1-git-send-email-johnstul@us.ibm.com> References: <1342548342-19683-1-git-send-email-johnstul@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12071718-1780-0000-0000-0000077CE650 X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000287; HX=3.00000193; KW=3.00000007; PH=3.00000001; SC=3.00000004; SDB=6.00157447; UDB=6.00035515; UTC=2012-07-17 18:12:04 X-Gm-Message-State: ALoCoQmdM+QFTTi/LF+n2jjdV47drA0TjEm0V4dY18MxR0u08kqC35HmEdpC0vzxqesylSCHml8P From: Thomas Gleixner This is a backport of cc06268c6a87db156af2daed6e96a936b955cc82 While not a bugfix itself, it allows following fixes to backport in a more straightforward manner. CC: Thomas Gleixner CC: Eric Dumazet CC: Richard Cochran Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Linux Kernel Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5960728..5fbcb9a 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -166,6 +166,18 @@ static struct timespec total_sleep_time; */ struct timespec raw_time; +/* must hold write on xtime_lock */ +static void timekeeping_update(bool clearntp) +{ + if (clearntp) { + timekeeper.ntp_error = 0; + ntp_clear(); + } + update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); +} + + + /* flag for if timekeeping is suspended */ int __read_mostly timekeeping_suspended; @@ -322,10 +334,7 @@ int do_settimeofday(struct timespec *tv) xtime = *tv; - timekeeper.ntp_error = 0; - ntp_clear(); - - update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); + timekeeping_update(true); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -863,8 +872,7 @@ void update_wall_time(void) wall_to_monotonic.tv_sec -= leap; } - /* check to see if there is a new clocksource to use */ - update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult); + timekeeping_update(false); } /**