Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3927804rwi; Sat, 22 Oct 2022 02:21:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM484byKhJOG8tz5GlRWkQFT7H7+ftY+B7eTEt6J5QCK7N1JT5woGaOvuZSBUQWgDVen21o+ X-Received: by 2002:a17:902:b597:b0:182:8547:ae57 with SMTP id a23-20020a170902b59700b001828547ae57mr23736914pls.92.1666430519277; Sat, 22 Oct 2022 02:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430519; cv=none; d=google.com; s=arc-20160816; b=IkmaHz6NzSq9Z/3ZtWa17/KvljueHagWSWeXneoJy6x/Pqkq0MD5A5JPvH432c7AsB CQlslDDegwkAOkNv3p8qh2oDE0A39Rdsw+XD62TyZgI/JdGlbmeA60ISE7J6Qa0Wr07c IzHX1ZjHJPZc1u66Kwh3ig3vg93638iArO8EUygRjo/oUTrMwvb4fzbPd9xwFJ1j0BMZ w0W1D0JVsDdGe/UlfqLKxzZIV+2kZPQuXyuBM3tehwg9eH6vL2k++ujuiJ86wKUhXbC1 7zQcizXOCxrWAO/IInxlhQ5aaLRWRk/Gqiva23nfl8TxwMeM+uhZELneBURQgNab7DGF xhFw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a63d14d000000b00439e032756fsi25022639pgj.65.2022.10.22.02.21.47; Sat, 22 Oct 2022 02:21:59 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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