From patchwork Mon Jun 16 05:08:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 4356561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 162E4BEEAA for ; Mon, 16 Jun 2014 05:55:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4701B2026C for ; Mon, 16 Jun 2014 05:55:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59E012025A for ; Mon, 16 Jun 2014 05:55:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwPqh-0000tm-8P; Mon, 16 Jun 2014 05:52:55 +0000 Received: from mail-by2lp0238.outbound.protection.outlook.com ([207.46.163.238] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwPqd-0000rO-PC for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2014 05:52:52 +0000 Received: from DM2PR03CA005.namprd03.prod.outlook.com (10.141.52.153) by DM2PR03MB509.namprd03.prod.outlook.com (10.141.87.12) with Microsoft SMTP Server (TLS) id 15.0.954.9; Mon, 16 Jun 2014 05:52:28 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:198) by DM2PR03CA005.outlook.office365.com (2a01:111:e400:2414::25) with Microsoft SMTP Server (TLS) id 15.0.959.24 via Frontend Transport; Mon, 16 Jun 2014 05:52:28 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server (TLS) id 15.0.959.15 via Frontend Transport; Mon, 16 Jun 2014 05:52:27 +0000 Received: from rock.ap.freescale.net (rock.ap.freescale.net [10.193.20.106]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s5G5qJ2t016351; Sun, 15 Jun 2014 22:52:20 -0700 From: Xiubo Li To: , , Subject: [PATCHv2] clocksource: arch_arm_timer: Fix timecounter initialization Date: Mon, 16 Jun 2014 13:08:38 +0800 Message-ID: <1402895318-26217-1-git-send-email-Li.Xiubo@freescale.com> X-Mailer: git-send-email 1.8.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(104166001)(74662001)(92566001)(21056001)(104016001)(68736004)(44976005)(2201001)(84676001)(19580405001)(92726001)(26826002)(74502001)(87936001)(50466002)(19580395003)(86362001)(77982001)(64706001)(6806004)(93916002)(83322001)(89996001)(85852003)(62966002)(87286001)(50226001)(4396001)(76482001)(77156001)(80022001)(20776003)(81542001)(102836001)(79102001)(81342001)(83072002)(50986999)(31966008)(99396002)(36756003)(48376002)(85306003)(88136002)(47776003)(97736001)(46102001); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB509; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 0244637DEA Received-SPF: Fail (: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Li.Xiubo@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140615_225251_881489_56D8E9D5 X-CRM114-Status: UNSURE ( 7.11 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Xiubo Li , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The third parameter(u64 start_tstamp) of timecounter_init() should be the start time by ns, not a cycle counter. Here just set it to zero. Cc: Stephen Boyd Signed-off-by: Xiubo Li --- drivers/clocksource/arm_arch_timer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 5163ec1..b29a810 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -426,19 +426,16 @@ struct timecounter *arch_timer_get_timecounter(void) static void __init arch_counter_register(unsigned type) { - u64 start_count; - /* Register the CP15 based counter if we have one */ if (type & ARCH_CP15_TIMER) arch_timer_read_counter = arch_counter_get_cntvct; else arch_timer_read_counter = arch_counter_get_cntvct_mem; - start_count = arch_timer_read_counter(); clocksource_register_hz(&clocksource_counter, arch_timer_rate); cyclecounter.mult = clocksource_counter.mult; cyclecounter.shift = clocksource_counter.shift; - timecounter_init(&timecounter, &cyclecounter, start_count); + timecounter_init(&timecounter, &cyclecounter, 0); /* 56 bits minimum, so we assume worst case rollover */ sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate);