From patchwork Sat Oct 22 07:26:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106381wrr; Sat, 22 Oct 2022 01:37:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7vad6mfZgzMgQQj78qmPTbBVa0yP/6fIpE7fiWDN+cyueEGIkpM9sXAJFLegtvxhZ8Da+7 X-Received: by 2002:a17:907:84a:b0:733:735:2b1a with SMTP id ww10-20020a170907084a00b0073307352b1amr19169204ejb.290.1666427862530; Sat, 22 Oct 2022 01:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427862; cv=none; d=google.com; s=arc-20160816; b=rtPHlCHzwqhnpNQbLbli6d1+86CpLMeqI0xdz3TG6pJaDz/hG9Md9OI3JdKcMIEKqt 15dSmCvX1gQKE9nRcR0762K3ARKOHCdlFc/m+FGn0Vwm03/4vC8MZ0UvdMlLtDdTfF4O bAK2926DfBoEY1xn5Rf1D+o07cr829J2RJVkGC9DZb5FAZPVorKUHXgJUQ95or/lNoMS eBvbTxGuj+stJXzTF363kClddkPCktFleGKhopjcJQIYlYkHYDmgTwsi6kYlN1QbydUa Mrudp9KtC6fzYAzw8bEhleJad+FXW7MiKAdAyGcBiVmO89aa7eLv4nwRuTQpYk7iDkbG dm4Q== 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=ecwaafe2kQNX9GefLIGxUyw0N6hBMGVSw1Ulamhn4IHKg6Rgk7vlkk0+rNOL1fP07r 3HXPP/CH4YVuV7WWBMl+rE931F2XRDhLeflCYfgq1dh0JSZAISBHVz6d37TUvZN8GBR4 V9HHimowKFEVNfzQlGgoXFgrcZvTYtA22nNMd5ofczd09R5azmWt7p/GZGHpSy7ux9a1 bY3W9SssvCsLu6IChTQ/OBOyp/mG/c3FVDgUU+eMUndUbOIzHLPMXOf5XB9HAvcUCqj4 DWQ2JQR2xWHnyV8Rqn7QVJrrCs+QV1sYbPjXhiMpOoIemVU24KkFTK2dY5mW4kjNmP/o xVVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZwoKLnoY; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a50ea81000000b00456cc6e1017si19275232edo.109.2022.10.22.01.37.15; Sat, 22 Oct 2022 01:37:42 -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=ZwoKLnoY; 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 S233961AbiJVIc5 (ORCPT + 99 others); Sat, 22 Oct 2022 04:32:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234103AbiJVI3k (ORCPT ); Sat, 22 Oct 2022 04:29:40 -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 A767C2E25DC; Sat, 22 Oct 2022 01:01:54 -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 4803A60B40; Sat, 22 Oct 2022 08:00:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 559D9C433B5; Sat, 22 Oct 2022 08:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425623; bh=RGwrKnkrt+w/nHMKlIsALNrzbvtZrXpoRBaBl2bJTIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwoKLnoYp5xCRU926pElRHTgXtJ2Ipod7aQjrWii25/4Do7pme19fLXkGI08aoU8S JCHxTF9JztvQyDu9snDrpJSLsoYmkzgGL0d6+nSGckS3FmeAzqewRCbpRvrDJhWDHz 6D3lEvDvHRXmudS+XTuWRyqZBxUZfOVYpN5Pfy70= 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 5.19 521/717] clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921 Date: Sat, 22 Oct 2022 09:26:40 +0200 Message-Id: <20221022072521.341170227@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376262232107318?= X-GMAIL-MSGID: =?utf-8?q?1747376262232107318?= 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