Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp313959qtb; Wed, 19 Oct 2022 02:38:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+Wo3+e8Xt6Qw00MWw1uQcqp6vdALqbTScfD9UYdajJU2vVOgdeq5LfUfHZ6j4iQLRNe9f X-Received: by 2002:a17:90b:23c5:b0:20b:1cb4:2ca9 with SMTP id md5-20020a17090b23c500b0020b1cb42ca9mr45133902pjb.139.1666172294526; Wed, 19 Oct 2022 02:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172294; cv=none; d=google.com; s=arc-20160816; b=eiWTPd1bzTN8pQC4slvRQcTxei2Exs0JXd5mPstMFI2T4T1hmVrfh4YVCsVl2k6Wce L274GSAm5Xmfr51+C/YfCMkKSaFKHUhIOqBV+gJGsWRLK3o3Vk1W/wJVdAxztdnv7uZs uYVcvX5nwxV3j4blbNWpHfaGPRCs5IVFQu6iifLJgMV/D9cYpfg121scohNaJ4VmXrDr mBABV1vvA8sbjZg9SVq4VFize52Lc/Kz0mpV5OAC5M1AEs44GfT+mHIS/Uf7GQ3Mui24 ULHHeBX42qVmeyJBSEZqVoKczjbutj8VvJCo9W/PTviuHdQX6iRQxkZfmEsTJAJasP07 cVSw== 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=BZKF+1UKxVg2bixsMw+juhPTNVYe2lU1afz31OQY59s=; b=jK7sigPCDEZvDYwPbf0b6/tkS/Q085u/RBnm6WKqXaQhhJ2j/zY70ktjy3glrklC4O eKSgcXW+C1UYEl6RKxNTTa092Sk/BR+ICZT3MgwGoVilvlFLZ3LJ3csJlbVQ5sApFD/v Tf9ZG/7Xt6pzLjm08MKQpHXnfOPa8SS+lFgqtk5k7qVrD2KholGLUmTQ7MxTP7P2KeO+ cRnC3zTKZgC0lyT6jTP3NB/yF9EFBYaZ1yKylBxmtz/Braqvobn0/Xm586uyPD3T4TEM u1oXPcH/3uvLWPBB9h/EDz+OXis2T+02qmLJVVMUaDAmfOE4yh1XX30M6Od0Gwi7j96y IL5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xjJO+cO7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j10-20020a170902da8a00b0017f97fe778dsi19896116plx.126.2022.10.19.02.37.53; Wed, 19 Oct 2022 02:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xjJO+cO7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233253AbiJSJXG (ORCPT + 99 others); Wed, 19 Oct 2022 05:23:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232882AbiJSJV7 (ORCPT ); Wed, 19 Oct 2022 05:21:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E32372B66; Wed, 19 Oct 2022 02:10:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 511C3617F1; Wed, 19 Oct 2022 09:07:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C4F7C433D7; Wed, 19 Oct 2022 09:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170467; bh=RGwrKnkrt+w/nHMKlIsALNrzbvtZrXpoRBaBl2bJTIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xjJO+cO7V57mrH7uRl65DC+/Grj18uQxhZuHe8En9ynIYR/06cSjgQWBPhS63aVo0 awlksJ1Tr23IOEfUsiWl6iGSvkmf0saegBWu/TaVzeR+4qxa2Tg5L4YgJrrjO1FAb6 kUVWVzm8kxQM8L0rEnByeb9JcT8xxYVjfZH2Q0aI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kunkun Jiang , Marc Zyngier , Oliver Upton , Daniel Lezcano , Sasha Levin Subject: [PATCH 6.0 639/862] clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921 Date: Wed, 19 Oct 2022 10:32:06 +0200 Message-Id: <20221019083318.160511306@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kunkun Jiang [ Upstream commit 6c3b62d93e195f78c1437c8fa7581e9b2f00886e ] The commit a38b71b0833e ("clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL") moves the programming of the timers from the countdown timer (TVAL) over to the comparator (CVAL). This makes it necessary to read the counter when programming next event. However, the workaround of Cortex-A73 erratum 858921 does not set the corresponding set_next_event_phys and set_next_event_virt. Add the appropriate hooks to apply the erratum mitigation when programming the next timer event. Fixes: a38b71b0833e ("clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL") Signed-off-by: Kunkun Jiang Acked-by: Marc Zyngier Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20220914061424.1260-1-jiangkunkun@huawei.com Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/clocksource/arm_arch_timer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 8122a1646925..a7ff77550e17 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -473,6 +473,8 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = { .desc = "ARM erratum 858921", .read_cntpct_el0 = arm64_858921_read_cntpct_el0, .read_cntvct_el0 = arm64_858921_read_cntvct_el0, + .set_next_event_phys = erratum_set_next_event_phys, + .set_next_event_virt = erratum_set_next_event_virt, }, #endif #ifdef CONFIG_SUN50I_ERRATUM_UNKNOWN1 -- 2.35.1