Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp167760pxu; Thu, 3 Dec 2020 23:37:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwH4+mEV2O4smw/znB+Gyslb6ClJ/+1+iEPlCELqIJNFYbcRPlrf7I+OyxnnGVfoW+SRcBy X-Received: by 2002:a05:6402:2070:: with SMTP id bd16mr6055378edb.107.1607067438566; Thu, 03 Dec 2020 23:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607067438; cv=none; d=google.com; s=arc-20160816; b=zeWpj1XzN7rgauTwL3uEcfvSDa7wWpq6BQx8n2zDprbnEtHIuMZaRHNvi5f5LGlfZw UltndDnwn7YZY4ieWMxYl9wU6hT7zWlZC5xjkrFrKDrBzrfnTyt+/k/dGsGDQoz2bSdl GKqLsBK+FDM2O1rHCkKsWQaGcUlKCCMcUJNkW1bot4O8tKdnSc0fm42nctkz1URmqR/v KyyhqgyeZUcuLzVagdQUzVKXfrTOqlgvNM5XzBwcYR5775eXy8CWPOUEKMn8vkR6BQ35 DVxGvpSDymW4s5Ecpiaf5XNCbP1oj7v6dMaqHRILBW7H6kIFHtLfRrEtgnF9AsgSuYxy ZYlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=71AKfcAzEOGArrcZV9dC16zg7tCfBCJwu/go/uWts60=; b=MG5fei+BovKgmcROBLx+D1sr2+bciIHQOptpvKOwuRI64gTGTDKVCM4149VQ4N257f 8tRIZFBGUAjtTlWjrP/FOMB+o3d4e6bxsKyGXfrc9mMDqzXK+gcmjfpJv5hCwUQ0Ul3y 0Oop+JoGQCFQ+L/0FFnTcSJRjuPP4u6X9XEL+JUA+wTZnJqTuLlsxTWZo2d8zCtlmSDv Hy7A5qlQ187AKYdxx0WKAFGvDnxMwcKxG724AqlU7a+tnh+AVdZFv75mPc5cgoHPIkes lNwdxR8w7sQB6WPk/alhOcpnl1vLj8iThCocwRL5ZPrDMFxQmrEiS70b1hTJQyDX6Xie rWAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si3015411edi.490.2020.12.03.23.36.55; Thu, 03 Dec 2020 23:37:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728669AbgLDHdF (ORCPT + 99 others); Fri, 4 Dec 2020 02:33:05 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9009 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbgLDHdE (ORCPT ); Fri, 4 Dec 2020 02:33:04 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CnPXm0T1wzhXvB; Fri, 4 Dec 2020 15:31:52 +0800 (CST) Received: from DESKTOP-5IS4806.china.huawei.com (10.174.187.37) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Fri, 4 Dec 2020 15:32:13 +0800 From: Keqian Zhu To: , , , CC: Marc Zyngier , Daniel Lezcano , Thomas Gleixner , Catalin Marinas , Will Deacon , James Morse , Suzuki K Poulose , "Sean Christopherson" , Julien Thierry , Mark Brown , "Andrew Morton" , Alexios Zavras , , Keqian Zhu Subject: [PATCH v3 1/2] clocksource: arm_arch_timer: Use stable count reader in erratum sne Date: Fri, 4 Dec 2020 15:31:25 +0800 Message-ID: <20201204073126.6920-2-zhukeqian1@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20201204073126.6920-1-zhukeqian1@huawei.com> References: <20201204073126.6920-1-zhukeqian1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.37] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 6c3e84180146..777d38cb39b0 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -396,10 +396,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.23.0