From patchwork Thu May 18 20:16:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 100122 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp6153qge; Thu, 18 May 2017 13:17:51 -0700 (PDT) X-Received: by 10.99.113.74 with SMTP id b10mr6369200pgn.139.1495138671661; Thu, 18 May 2017 13:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495138671; cv=none; d=google.com; s=arc-20160816; b=zKsxwDEuMb3DqMmOVMTVFo6KNE8Fs/u6buL0gjDvIxh3FlnM0WF3UmC5yuCChIA+/d ouh9IV5PdLH0POOM+lwiRZltg+snD9jn0J511XsOOMZ24wLA4+FbYEgTqIcpSWa8NAq9 SlG1mjnpkiB5SMdg+qke/lvPef1X9YGmhOeX/Bc96rvlVlgiomczu4P+rbuERSGHGeqg w06JFbzrtawgN+asnvH6TV1btonp3BAQNLolXUTZE0gnei0CXE2E5twhRw3bJIKRSeMa PQNxquhwRwdacUAry69//pn+NXzBsfsl68Fva9yn6iGziZAt7qqiKOSlWXyVWLEvuVNJ 61sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ehq7rWO0XTA3iuh05UU4aHNgyKmpUa4g2qWj34R1iMk=; b=RahQOn1PfmLbYdT2P2ERLWDOZpBwuo+zqHjyzJB4sQF1cV50vdR8I7qQATMNAyrXPh YHCLmmYEDk5KOftScOneQ06/RWcRMMBZRta/MQuA/vdQD0gY/O7+eUDwu25A24p7jSH6 ENS7u1g17UcleNg740adFoGYbAXjKAY7qvBznZp0nn80oPuL1Mw3XGOuL0bfMhlUc91R jDeoQ0CuMlAhkAnqGVDTrAoKDMqFr5LBMx4cLTrjcHWtj1TSgXd5MpIJUpIjDsJLU2ml Q6rmf24kfGK7fo8ekYfA1QCxUKXvfNPQZmrynHjkRlNka+INhY9iEEsCpCNxPZ7FlLV+ u+Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si6059160pfd.332.2017.05.18.13.17.51; Thu, 18 May 2017 13:17:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755749AbdERUR2 (ORCPT + 25 others); Thu, 18 May 2017 16:17:28 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:35134 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753069AbdERURZ (ORCPT ); Thu, 18 May 2017 16:17:25 -0400 Received: by mail-wr0-f170.google.com with SMTP id z52so3069186wrc.2 for ; Thu, 18 May 2017 13:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ehq7rWO0XTA3iuh05UU4aHNgyKmpUa4g2qWj34R1iMk=; b=FLlQGsIP/+vZ+R0KHzuWd4JwaBpyyP1v4E9t2xH/gKVrbFTm6jQUgOf7ZDjw2vQRTg aHPhzY2NNUKWFo+MqhC/4O9usI0WH0gGH1l8Ol4P5aVabU0TUla/au8+8TZn6p9VQYZW CcnrAPXT66jvfsJlJA9zuV/tG+j9K0qChhsqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ehq7rWO0XTA3iuh05UU4aHNgyKmpUa4g2qWj34R1iMk=; b=gmtSCrjQpsF/vsW50JdIeyJBppLaTDjq7uoSH45HMMyNAiV9n7VeSQeP92L6TnOKDz giXR1YNKMSHVa+OJwUJhrz4Bmk0wN+O7XD2xjXdpIxuxnQm8SN3uTCiv5cIi2+qBZUO+ eSUnEQe9Ku7rvuPWjxViZ+H4OBvBIB+aP/OmJHO9zXdnvN2goi1FZmvfA5C0FsWWrhwE t+T/l+I4rmGtVx8hv7VxkoIqb8a19daKu/nsMkX+qjIhVKEq1UZgnEXmlzRa1uG0dL8D 5R1buAQSskFkJzNGOR5kaL1qBo+dZNgLdGerJi/PtQCpEc79SBmbQ3k/nTqgfCovviCg Xf/g== X-Gm-Message-State: AODbwcDueeZbNhYKWQRFQzj6/ECGzmLBM692aH3B34gfsq3qfYf5Ef4j IH7SfESFfRuBfST9 X-Received: by 10.46.32.169 with SMTP id g41mr707335lji.65.1495138638815; Thu, 18 May 2017 13:17:18 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-787571d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.117.120]) by smtp.gmail.com with ESMTPSA id y1sm1103615lja.24.2017.05.18.13.17.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 13:17:17 -0700 (PDT) From: Linus Walleij To: Daniel Lezcano , Thomas Gleixner , Joel Stanley , Jonas Jensen Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , linux-kernel@vger.kernel.org, Linus Walleij Subject: [PATCH 1/8 v2] clocksource/drivers/fttmr010: Fix the clock handling Date: Thu, 18 May 2017 22:16:58 +0200 Message-Id: <20170518201705.28790-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to also prepare and enable the clock we are using to get the right reference count and avoid it being shut off. Tested-by: Jonas Jensen Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Added Jonas' Tested-by, no functional changes. --- drivers/clocksource/timer-fttmr010.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.9.3 diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index b4a6f1e4bc54..58ce017e4a65 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -238,12 +238,18 @@ static int __init fttmr010_timer_of_init(struct device_node *np) * and using EXTCLK is not supported in the driver. */ struct clk *clk; + int ret; clk = of_clk_get_by_name(np, "PCLK"); if (IS_ERR(clk)) { - pr_err("could not get PCLK"); + pr_err("could not get PCLK\n"); return PTR_ERR(clk); } + ret = clk_prepare_enable(clk); + if (ret) { + pr_err("failed to enable PCLK\n"); + return ret; + } tick_rate = clk_get_rate(clk); return fttmr010_timer_common_init(np);