From patchwork Wed Aug 10 13:14:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 9273013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2282A6022E for ; Wed, 10 Aug 2016 13:16:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1235828401 for ; Wed, 10 Aug 2016 13:16:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 060B528417; Wed, 10 Aug 2016 13:16:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6895C28401 for ; Wed, 10 Aug 2016 13:16:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXTLd-00053t-QL; Wed, 10 Aug 2016 13:15:05 +0000 Received: from down.free-electrons.com ([37.187.137.238] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXTLV-0004hK-QC for linux-arm-kernel@lists.infradead.org; Wed, 10 Aug 2016 13:15:01 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id A5CE0467; Wed, 10 Aug 2016 15:14:36 +0200 (CEST) Received: from localhost (81-67-231-93.rev.numericable.fr [81.67.231.93]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7512C367; Wed, 10 Aug 2016 15:14:36 +0200 (CEST) From: Gregory CLEMENT To: Daniel Lezcano , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH v2] clocksource/drivers/time-armada-370-xp: Fix the clock reference Date: Wed, 10 Aug 2016 15:14:27 +0200 Message-Id: <1470834867-25932-1-git-send-email-gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.8.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160810_061458_456172_90EA3A40 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Andrew Lunn , Romain Perier , Jason Cooper , Boris BREZILLON , Stefan Roese , Ezequiel Garcia , Gregory CLEMENT , Sebastian Careba , Maxime Ripard , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP While converting the init function to return an error, the wrong clock was get. This lead to wrong clock rate and slow down the kernel. For example, before the patch a typical boot was around 15s after it was 1 minute slower. Fixes: 12549e27c63c ("clocksource/drivers/time-armada-370-xp: Convert init function to return error") Signed-off-by: Gregory CLEMENT Tested-by: Stefan Roese --- Changelog: v1 -> v2 Move the of_clk_get_by_name out of the declaration as sugested by Thomas Petazzoni. drivers/clocksource/time-armada-370-xp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c index 719b478d136e..376ed13fe739 100644 --- a/drivers/clocksource/time-armada-370-xp.c +++ b/drivers/clocksource/time-armada-370-xp.c @@ -335,10 +335,10 @@ static int __init armada_370_xp_timer_common_init(struct device_node *np) static int __init armada_xp_timer_init(struct device_node *np) { - struct clk *clk = of_clk_get_by_name(np, "fixed"); + struct clk *clk; int ret; - clk = of_clk_get(np, 0); + clk = of_clk_get_by_name(np, "fixed"); if (IS_ERR(clk)) { pr_err("Failed to get clock"); return PTR_ERR(clk);