From patchwork Sun Apr 16 20:27:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 9683175 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 EF13360138 for ; Sun, 16 Apr 2017 20:31:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBB3027B81 for ; Sun, 16 Apr 2017 20:31:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD93627D0C; Sun, 16 Apr 2017 20:31:29 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7099F27B81 for ; Sun, 16 Apr 2017 20:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=O74U3dcigk3NksBrf2/vgMoX3EDO2rGQ7MJUuk48S3o=; b=ssO4IUrH0EaEv+u+85eWKywExE +ILqh/gWHcCEjAcLiX1noN46hAijHI1VoiZZGkhztAeY9OiHiVmUrBlySDH8Rc0gLWzGXTDHNUDhq WL5uQsONdBZTvOgJFuhAvcLZ/zfc/scq7OrFPMdhrUqsNFuHrAdrpVdk7g7fH4qwl4dhdnQBXl0G/ RmbTKHCoXB6sIahuz0iO5sRL4dcUYVNdb43s9OKKnx5kjuogWC1u7prsrTf9MG3ihQV80KUD883hR uFbAXDfzOdXIvzqFMQLFsDiFm8sGLvpmo/5GdiSdwlRTST10iP2gqfbwfVKR7C5OLPnDMByrh4Rmd v2KkiGEA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1czqpU-0002Vl-Ar; Sun, 16 Apr 2017 20:31:28 +0000 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1czqmm-00067j-4a for linux-arm-kernel@lists.infradead.org; Sun, 16 Apr 2017 20:28:45 +0000 Received: by mail-wr0-x230.google.com with SMTP id z109so74468994wrb.1 for ; Sun, 16 Apr 2017 13:28:19 -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=/qx5BrMYQ0ThVt//34PfSsXQrPeNeUNQtdmmpHo87co=; b=hQM+E1GJNi8r3MWREJrFH8ejqigEN7lGwuRlfwAfQhbmKaG/0Ha7RIS4OvTViTgDID 9UxCopIlpRkkdWNVn+mBEkNbYoD366Tono43mG0GPbzPzpK+xINZj5LEszZjX2Cg5LuL 7jAnkAhQqGwrOq3P/WMB0njwVhPOSmRPlk/sA= 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=/qx5BrMYQ0ThVt//34PfSsXQrPeNeUNQtdmmpHo87co=; b=ccNfG34zimiWqN9Z/hv1jMfw1neyKOgjgFp4f2AyYff/l5LvyM8HgiTwuTy7AZNiR0 gsF1EsvD/2YkwvJQyzhKwTF1HnmvFFgqcX9Ut48l0yLA3LCPDKsSMzX+f1b/TojRsIvl di3KfSn5RCfz9KU9XTDs+9RdHnLLx7fxSPSozSc2pbUcC7Ls12G3QHZk/Y2I7rQT9rgg /5uvvLDM+6ybwPrSQPl19EKaqAjV+Z7I8ch7309agxGt4LpKWBfsb69RvgZ0p7QTldSM Tmtc/8izkh8CE/X24YNdhIQ9sGBPj5XzwNRkzR96fkACV7PR3tu9InWqLjw0+UlPfZXM xn3g== X-Gm-Message-State: AN3rC/507GFN77J00Q1VbrzTEB5jjzML5A5FuWLI9OC8IRLjwjXrZUrs ODCmc+n2WGzFSqYZ X-Received: by 10.223.138.178 with SMTP id y47mr16667944wry.22.1492374498259; Sun, 16 Apr 2017 13:28:18 -0700 (PDT) Received: from mai.lan ([2001:41d0:fe90:b800:20c0:6248:a385:db35]) by smtp.gmail.com with ESMTPSA id 81sm7732196wmj.9.2017.04.16.13.28.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Apr 2017 13:28:17 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 14/29] arm64: arch_timer: Save cntkctl_el1 as a per-cpu variable Date: Sun, 16 Apr 2017 22:27:04 +0200 Message-Id: <1492374441-23336-14-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492374441-23336-1-git-send-email-daniel.lezcano@linaro.org> References: <20170416202542.GV2078@mai> <1492374441-23336-1-git-send-email-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170416_132840_807507_ECDA22CE X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Mark Rutland , linux-kernel@vger.kernel.org, "moderated list:ARM ARCHITECTED TIMER DRIVER" 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 From: Marc Zyngier As we're about to allow per CPU cntkctl_el1 configuration, we cannot rely on the register value to be common when performing power management. Let's turn saved_cntkctl into a per-cpu variable. Acked-by: Thomas Gleixner Signed-off-by: Marc Zyngier --- drivers/clocksource/arm_arch_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 395f5d9..5c114da 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -839,14 +839,14 @@ static int arch_timer_dying_cpu(unsigned int cpu) } #ifdef CONFIG_CPU_PM -static unsigned int saved_cntkctl; +static DEFINE_PER_CPU(unsigned long, saved_cntkctl); static int arch_timer_cpu_pm_notify(struct notifier_block *self, unsigned long action, void *hcpu) { if (action == CPU_PM_ENTER) - saved_cntkctl = arch_timer_get_cntkctl(); + __this_cpu_write(saved_cntkctl, arch_timer_get_cntkctl()); else if (action == CPU_PM_ENTER_FAILED || action == CPU_PM_EXIT) - arch_timer_set_cntkctl(saved_cntkctl); + arch_timer_set_cntkctl(__this_cpu_read(saved_cntkctl)); return NOTIFY_OK; }