Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9270329pxu; Mon, 28 Dec 2020 10:59:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDchLumTvIg51S9dyswuKQ9qf17FtrZuNdg2Dhf1Z/kLhmVqDedV43b2o9o8gnkfmmItpN X-Received: by 2002:a17:906:1199:: with SMTP id n25mr41700627eja.293.1609181990688; Mon, 28 Dec 2020 10:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609181990; cv=none; d=google.com; s=arc-20160816; b=Mwx0bTo/WlTDTo7JohSyhTa5wuX25pu3FavKldyiwk9ePgkSKehq3FvP2QiIu7m8fS GLHTrRF8GPuqxp1F/6hW40Hsn3E8Nhty1MVGI8sVh1umV2aWzrg+n7eDMGfT0GFZA7w5 ce3hVs/J3XIp+I9WduyJeZrdnp5YIo32597VZJIVz1AR74jXCQ05kllga7YVPUW96SDI X8rAaqdk9LGuhArWrEVDxYoxUx974YJCsKq+aagMIZQC7finpKgI+KdOUrYo0Fs0Ma1y eNhO2tr3Lf4U+VNpX2adHsfvimvDl5kSFFVwgXe18eDsN9g45GIpQ3XB4+2rVTzQtU5H DmAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wI/MpJM8P2i+C7LjsWSSihkLYo1RPXFOTmWYSZcVn94=; b=cEkIeOk13uH6S9PpbUS9TvHu2RlPVEPgssvc1Q5xav0QHq8j8vXRKE/JEY/Q+qXrtP 1uxQEZfbRUc94qjL4CI/bsHq7JhBNI0CDLLO6QTaPY9emtuoYn8WWE09zM1QKwBYLxjh ULJdJlo+EczPTskIYAtpUM0uudyylwekGOeirTxDcGReIUOYkmt5rCk1g9fxbWJgYqla uNerhPwluiXS12LBTyfYaLqbJaEnTcODYNZg/ilgoBZwLhHk2nguJueq+kAcEWKXryKM AJPYNYcir2I3zizf5TPBafoKrs+UmFCAoCCd5Lmrv8rsruN5wlMylhTMW+WGKvM3Z6Au yl6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UUxEwOJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si9823590edd.53.2020.12.28.10.59.28; Mon, 28 Dec 2020 10:59:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UUxEwOJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405866AbgL1Ns1 (ORCPT + 99 others); Mon, 28 Dec 2020 08:48:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:49718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405846AbgL1NsW (ORCPT ); Mon, 28 Dec 2020 08:48:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A82C20715; Mon, 28 Dec 2020 13:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163261; bh=oB31TNYw/hziIM+G/DK8bjQfj64HSVpYJB/rqIP7RSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UUxEwOJBrHNgFkqyzdJko4QN6U2RyvortKd/RFNvrZVGlWViQrSKl73xsnp6+W480 dB1u94nmoELq+Yi+RZvEnt7jYZr84sAyk1UqV/u7YCwadCZXGKPhc6B8vXFf2MhhbR N2sMNBvqb/KQN7Ci91xS4dI6WPtAQ/kxJh6NAEhI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Keqian Zhu , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.4 225/453] clocksource/drivers/arm_arch_timer: Use stable count reader in erratum sne Date: Mon, 28 Dec 2020 13:47:41 +0100 Message-Id: <20201228124948.048116529@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keqian Zhu [ Upstream commit d8cc3905b8073c7cfbff94af889fa8dc71f21dd5 ] In commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters"), we separate stable and normal count reader to omit unnecessary overhead on systems that have no timer erratum. However, in erratum_set_next_event_tval_generic(), count reader becomes normal reader. This converts it to stable reader. Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters") Acked-by: Marc Zyngier Signed-off-by: Keqian Zhu Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20201204073126.6920-2-zhukeqian1@huawei.com Signed-off-by: Sasha Levin --- drivers/clocksource/arm_arch_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 4be83b4de2a0a..d2120fcf1f3f6 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -392,10 +392,10 @@ static void erratum_set_next_event_tval_generic(const int access, unsigned long ctrl &= ~ARCH_TIMER_CTRL_IT_MASK; if (access == ARCH_TIMER_PHYS_ACCESS) { - cval = evt + arch_counter_get_cntpct(); + cval = evt + arch_counter_get_cntpct_stable(); write_sysreg(cval, cntp_cval_el0); } else { - cval = evt + arch_counter_get_cntvct(); + cval = evt + arch_counter_get_cntvct_stable(); write_sysreg(cval, cntv_cval_el0); } -- 2.27.0