Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9399998pxu; Mon, 28 Dec 2020 15:14:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4Gy8xGPDe3jZQ/zr5Z61UvixR9aUOmOxtutqrdpHPWQlEcIhE/o1gZYwFFOuRxJZc9dx0 X-Received: by 2002:a50:fc83:: with SMTP id f3mr44561844edq.219.1609197286487; Mon, 28 Dec 2020 15:14:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609197286; cv=none; d=google.com; s=arc-20160816; b=ZX0HKSAxYeoHU19BZMRp3FaD5yCMy3kOZwJSOtfWEo8+PZWs15wmrr5uMNJ6NO4ZCJ eOVAX/XVsaRVfVzWXexaBmCRWs4H4mrK45wpBa/Ehn+Fb0tYiIX3UEaTxoJHsx9kKhOt E7ZEDr1KjZs1sju9YpURPWV4VK+ZTN+hZk73UmUL6+BS5m5ynhl23Lvavl9QKiG6kpuj VwsV0i+yUS1AzNj81NYc/yvB51qGvh0FMNiLDROrnL9/dkjf1f1Dr6SEfKH6b4aNiz79 QdBaY2SrIb/E3iN3gvp9kx4ohubKJxUgw8t0QDgIbwZIx06DUrW4MBXSM1JTbrmnO6tB rShg== 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=2cuLip1ayXdxP+IJVBvRcKXtZI80VwZ9UOCSe0ZEIAQ=; b=ZvEPSK/c5RmVeZzazWDfsYZLKchwwxv75JQ0jLEfevK1hFrKosujRr1lY81RMMxe9V UCg7D0uxlz5pSVQ46JWzJ0d/IAFiCrAmgriDvu37/UnMQfUDaaNfITmqbZ7xTIZXpORA bkXV9SPRkfa+vbIT9OLvBe8kr/LkcR1SxVTkMJn59fijTV5YZ3lsXR2RC6yOaOmaFBKp HGW0tVUBndBvtxlTiSDkemG6ETLPhVvJ5U76ExO7ZAN1DdEgBp8aJphiF6dgbVTKyTno vo0AFT1mXNQz/+1rk0bCPpng9NyiJeJcnZ4gVMXbtTHgyIDGmeVxE+MHhhEH5QzN7Ctd pAJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="YoUv/9xY"; 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 go32si18687261ejc.64.2020.12.28.15.14.24; Mon, 28 Dec 2020 15:14:46 -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="YoUv/9xY"; 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 S2440510AbgL1OOv (ORCPT + 99 others); Mon, 28 Dec 2020 09:14:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:49752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440504AbgL1OOs (ORCPT ); Mon, 28 Dec 2020 09:14:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9240822B2A; Mon, 28 Dec 2020 14:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164848; bh=PYpj4NAq1T+tbXVF/iIBpjeM9zAFCXUk4gMTuhLjReU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YoUv/9xYCO1Etgs5yMP+jZp9PuuUceNzy37tcLcp+1ScIy79Dtj+zgupon1XGnfe1 ldkQKDbiXB6EZH60qPfCy8IiO0IV6YMMCW1sRGLAt7wNiJ/wG3vEqfG41wAadTwhFC Ha+QuTzIAQyho/xumgjYXTGlUK8sg0RAh/4PKhcI= 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.10 321/717] clocksource/drivers/arm_arch_timer: Use stable count reader in erratum sne Date: Mon, 28 Dec 2020 13:45:19 +0100 Message-Id: <20201228125036.406151752@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 6c3e841801461..777d38cb39b09 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.27.0