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: 97468 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1086903qgf; Sun, 16 Apr 2017 13:28:42 -0700 (PDT) X-Received: by 10.99.55.75 with SMTP id g11mr8444323pgn.224.1492374522909; Sun, 16 Apr 2017 13:28:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si8937302ple.25.2017.04.16.13.28.42; Sun, 16 Apr 2017 13:28:42 -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 S1756970AbdDPU23 (ORCPT + 15 others); Sun, 16 Apr 2017 16:28:29 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:33427 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756919AbdDPU2Y (ORCPT ); Sun, 16 Apr 2017 16:28:24 -0400 Received: by mail-wr0-f174.google.com with SMTP id l28so74359495wre.0 for ; Sun, 16 Apr 2017 13:28: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: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=s/8WDddcryuwaynrZJF6RzX2m0P+q9hSY+NX94/PN8ubIBwtg4h5pBkPq4OuAaQN2p FMjC0WXCzuorWYBqc5w4jL6kgzC+jwfxthhxXdCklc6/2SQ7gFCWSHpQ1QDNvYPNT0dG Ef5Zza56bkDGsMY/KqKydrK1UuI67t3CdvfBBv9Y0m7KInv895g4Q9aPdPaZGeaw0w4q l8P4+Pql8gvuFPXPToJA9vX111dLUe1i1BwDcog9FpS5gAWMT9SYP5goEZ3qtyka7ei7 UYpKZ/+MUlSUjbv/Qclx34dKGhcaIqySd0BfE8GYk4yMMMD2lPi8nlRpNqQ9Yk6Y+ZK5 NIow== X-Gm-Message-State: AN3rC/7GgfxvdejuqBwgfzLaDhnIfHmG4/QaaAYe+LCUSJbqjPu/F5Kq pUhCEu+HK4FB//sn 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 Cc: linux-kernel@vger.kernel.org, Marc Zyngier , Mark Rutland , linux-arm-kernel@lists.infradead.org (moderated list:ARM ARCHITECTED TIMER DRIVER) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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; }