From patchwork Mon May 14 08:55:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 912759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Lks8eZND"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40kvhs5ftcz9s02 for ; Mon, 14 May 2018 18:57:17 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355AbeENI5Q (ORCPT ); Mon, 14 May 2018 04:57:16 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:39070 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228AbeENI5C (ORCPT ); Mon, 14 May 2018 04:57:02 -0400 Received: by mail-pf0-f196.google.com with SMTP id a22-v6so5687381pfn.6 for ; Mon, 14 May 2018 01:57:01 -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 :in-reply-to:references; bh=JFxtoPTIwMJxvyCd3hwanD0Gfpl/C9hHnauJqDpF+Pw=; b=Lks8eZNDMEB04VY1cgjqD8YoqccCAmFjMOqPkW1zAd2mXWkwu27GQv6G32ypyhwkaq 3oRVaG+qqCvTwYYd4hCr18OYCi5GQdGIhjWUI16FJAH2OIUfIbSv6Y2TsM0CTOGXgypp Rm+R1wJ81VVr9raelCz1VsGcLoHMbA6InPpE0= 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:in-reply-to:references; bh=JFxtoPTIwMJxvyCd3hwanD0Gfpl/C9hHnauJqDpF+Pw=; b=cnqFBBuzbsUeIlBN/4KXNfygNACRvmfAJPJ2r9JqFN4SkdFh2yOmYeAEtw2LeMJtfj jIT1iewTp/Q4Z2OFM27c1yXrFl7ZXhSn4i9PTY52OobPBfcWXx/DkIMelWI6hI/UjAG6 aoh6iLwtYWCfyGUQOsYE2pgzE9AfZpGHZMf1JS+RETU1p/DqGlvEsGjJfrJNrE1WkyLp FsqPK5PZq5O2v9RN0ZNVHi58Et1JN84+Chi9BrmVMrbDBD2BeQk9p2T2POQaYB8AK9hs 41lPZQJbJB2mCFmRAkBb+1bpb7A3UN8le6fY7D8p8yXeKNGXmdYch3p9k+vM0WDe1RoY GV4A== X-Gm-Message-State: ALKqPwf/+tyv8IkanUT/wjZ0iTXqi2fVScjIJ0ikBRg4XIm+eA9FigKV kxH64r9vYY3k4rXTQAcHq/HmKvl+KeY= X-Google-Smtp-Source: AB8JxZqJqrkpqUjChhz+cXXKxmxgAaOH1itX8BY6d+zuE+pHfRQUCNQWxrJ6eLWAz63O4iru9mMMTA== X-Received: by 2002:a62:c6d9:: with SMTP id x86-v6mr9545154pfk.192.1526288221409; Mon, 14 May 2018 01:57:01 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id x71-v6sm23308158pfe.47.2018.05.14.01.56.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 May 2018 01:57:00 -0700 (PDT) From: Baolin Wang To: tglx@linutronix.de, john.stultz@linaro.org, daniel.lezcano@linaro.org, arnd@arndb.de, tony@atomide.com, aaro.koskinen@iki.fi, linux@armlinux.org.uk, mark.rutland@arm.com, marc.zyngier@arm.com Cc: baolin.wang@linaro.org, broonie@kernel.org, paulmck@linux.vnet.ibm.com, mlichvar@redhat.com, rdunlap@infradead.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, pombredanne@nexb.com, thierry.reding@gmail.com, jonathanh@nvidia.com, heiko@sntech.de, linus.walleij@linaro.org, viresh.kumar@linaro.org, mingo@kernel.org, hpa@zytor.com, peterz@infradead.org, douly.fnst@cn.fujitsu.com, len.brown@intel.com, rajvi.jingar@intel.com, alexandre.belloni@bootlin.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [RFC PATCH 06/10] clocksource: arm_arch_timer: Register the persistent clock Date: Mon, 14 May 2018 16:55:32 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Register the persistent clock to compensate the suspend time for OS time, if the ARM counter clocksource will not be stopped in suspend state. Signed-off-by: Baolin Wang --- drivers/clocksource/Kconfig | 1 + drivers/clocksource/arm_arch_timer.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index d7dddcc..884719c 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -308,6 +308,7 @@ config ARC_TIMERS_64BIT config ARM_ARCH_TIMER bool + select PERSISTENT_CLOCK select TIMER_OF if OF select TIMER_ACPI if ACPI diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 57cb2f0..671be63 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -32,6 +32,7 @@ #include #include +#include #undef pr_fmt #define pr_fmt(fmt) "arch_timer: " fmt @@ -950,6 +951,15 @@ static void __init arch_counter_register(unsigned type) /* 56 bits minimum, so we assume worst case rollover */ sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate); + + /* + * Register the persistent clock if the clocksource will not be stopped + * in suspend state. + */ + if (!arch_counter_suspend_stop) + persistent_clock_init_and_register(arch_timer_read_counter, + CLOCKSOURCE_MASK(56), + arch_timer_rate, 0); } static void arch_timer_stop(struct clock_event_device *clk)