From patchwork Wed Jun 14 12:39:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 105496 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp271340qgd; Wed, 14 Jun 2017 05:40:56 -0700 (PDT) X-Received: by 10.84.238.136 with SMTP id v8mr462691plk.249.1497444056791; Wed, 14 Jun 2017 05:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497444056; cv=none; d=google.com; s=arc-20160816; b=pekGlvzs+af3H7jRrA1bL7Uowgsu3GGFE0eu0BwkYC/lKIHDx+23JM+zwAI/D2o+IO azZ7VHCOV3uyD6hkMuurCslBRShlHvhvgA9TdRTDd4PiW7DBxWIHligmAD3UsTQwSczW GmhqCVI0/TaI1foRlduKaff4vPWLXjRPGXiF4t9VUSih8eWVcqt2/913/W/qcBOOqCR8 tXITnX15OejOh/oD60cFMnHZ8ttZfsxjmlQkaxhnQmCRjrszA3mgNDL3Go5NYsc9SWzx M5fvMDLG51o3ESFKnr4Z9Kz7rBXKsgEyjb0Nz1s7sr/j/YzGq1rBbI7ctHk4m8h36LKn qNpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zmNRh7A8FVH3OZ1Rp2cBdJzAZ8cqDyrGmqjyhCmwtyo=; b=H3VaFocjkS9z9NRxhOyiANhEIUi+FwaRhPR5Z7cr0mIk8Oz0imoStY782m77XCzQZ8 tbCBYedWOTKgNF/3x8z38T248hrQaQaqSf+Ui/JqRg4Q6n6i9vHlv1gnbsK1NVVaz9Wh mYgT2XM5hO/e7z1gJppjsfktntzJhZ+fVO2pwZNW2LVPkmsBbupcahT9qHGOpvUmrepS lSEhd2bLhGFjllwvQZnTnvwZliti+lBGllM5lV7PnWiL7U3Lk1lsZhgrgeED284RF9rl U7XlVnrVfzOmtswoDc4cY2BYMBIQb4vaVZ33+KAuS2nLAD9cEK1VeqQo3CMZCo7/jp2i CRhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=P9arqJ1A; 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 y14si421657pgq.414.2017.06.14.05.40.56; Wed, 14 Jun 2017 05:40:56 -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 header.b=P9arqJ1A; 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 S1752376AbdFNMky (ORCPT + 25 others); Wed, 14 Jun 2017 08:40:54 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:36051 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbdFNMkx (ORCPT ); Wed, 14 Jun 2017 08:40:53 -0400 Received: by mail-wr0-f170.google.com with SMTP id 36so66261901wry.3 for ; Wed, 14 Jun 2017 05:40:52 -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:in-reply-to:references; bh=zmNRh7A8FVH3OZ1Rp2cBdJzAZ8cqDyrGmqjyhCmwtyo=; b=P9arqJ1Ap9nF5meEzzfhjpaKTbxK1/C48obxwbfHdiyaT7AYIJrNkUhcyOAYC7v7id D5CzLrH11iFy8vOwXix4VgsX33riNUYvhhPX+mJhfHAZOq9NG+Xh0r1HXzXpCD1SMBCw D2ksi2fKIiSzWvTvPbeTBlr2xO7HiZDfcGIFY= 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:in-reply-to :references; bh=zmNRh7A8FVH3OZ1Rp2cBdJzAZ8cqDyrGmqjyhCmwtyo=; b=rVarmxkChG0Zw/lJ+PCHgoSQGtXOBIMwzZcHkd9OFI4piInopFHaJ1sddQb+IA3Vjt ieuwavKFQpSlIVfx55ne7eGgVa83XW/+cUR3NWtAKqKd+1K8PPZDcoVEuGfqOQ6ohhbt qa3M9u8+AOR4Jr+E++NB+8v/+ZT4lPjoiTDSI/phGgGnicS8etPSdiJBAZZP//0/xF8I PkS9PX4BTTTjiAbmG59SAY2nO5oHirw360Z1JirKFMvOUQLLQWnt2VSOnwWGXS2Euh6N txut6OxAI84wVEZmMw27KlJa3xfnqpDk3DQcSJJRkFHkwoTT2YadPaDFYvlaaktHILoR 0ZLw== X-Gm-Message-State: AKS2vOyFcx7cFxEQjw4Iqhbv/q7bT3h7Fl04qhqeAhjMAAtkoJ2qzggl eMvXWNC0oSpzldnf X-Received: by 10.28.147.202 with SMTP id v193mr959021wmd.37.1497444051629; Wed, 14 Jun 2017 05:40:51 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:19a:b336:54d7:46e9]) by smtp.gmail.com with ESMTPSA id 80sm1457015wmg.17.2017.06.14.05.40.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jun 2017 05:40:51 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Linus Walleij , Jonas Jensen Subject: [PATCH 02/23] clocksource/drivers/fttmr010: Fix the clock handling Date: Wed, 14 Jun 2017 14:39:23 +0200 Message-Id: <1497443984-12371-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497443984-12371-1-git-send-email-daniel.lezcano@linaro.org> References: <20170614123800.GH2261@mai> <1497443984-12371-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij 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 Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-fttmr010.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index b4a6f1e..58ce017 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);