Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7550469rwn; Tue, 13 Sep 2022 23:57:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR6lR8Ch0cg5agLeSjEDsf8CZQQO/tOl6Szj2h7cLSo7o6+kqjnFWzsrKnNDEeU9EgV+YyVz X-Received: by 2002:a05:6402:254b:b0:451:2b1d:d82c with SMTP id l11-20020a056402254b00b004512b1dd82cmr19182164edb.343.1663138630355; Tue, 13 Sep 2022 23:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663138630; cv=none; d=google.com; s=arc-20160816; b=1KtPBw1gSe78D+0ODZvMFTgtT38QGL3K5a7sRSfCE+HL5RBIVYWVzs55yWGOMypNEN lj3mFEtLpZAer9+yL+st32iOrby7D/FLohBr2JA7bcvovmqH5y0n1rU3gc6QVreBhNJ1 5cXzSyd7vbbSIja5H63mhrs+KHgkUENtK8ix80zGXPUVLcKdc9C9P40UuEjTqr2TKM8Y bT3wxGyWlwBBgkx0g3ucqf+WFM/YZ7U/B05cjjdOou/CNPst2UhH7uDMLV+aL8+NLRTt 4knIHAzn2KpVexlnX4H0egxug6bWnO9m7L7MkEYls0RjVGKqqbh0uVIKif29ESn3Ki8i /GZg== 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 :message-id:date:subject:cc:to:from; bh=6vVjY+7ht4dbk/+nALmcGD6htQr/pJhAHW7xTv99+OI=; b=eoZwWStj3K2LVQFKFgGfeJqum6yqBx1j+ABmFxGXgQ6OxH2kCjrVO/TolKkC/h1XrE zTKPPcWsDWdWQku65NBNJezmnmk92xgFAikSvs5fGyXW7CHdgw3TZgNY+wnbI15s1ytO ZjhmL0tJoaH88dAWB9MKTQEeuv8OvlMmIvUgnIpMDjKna009NZH/I20d48h3BqHagfVS ZpHltedOKmoqS3c3lg5WCizKHyfHRlrYQZ00I/D2sMjgZVzOFkgH4MOExdyuUnw9RYpE SEkeSMHjUmQNKaIoZidsQzeQP7oR26rdB59348XqrVI01Dluq7HB/noLUdQrlrifWwKM NXlw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a170906794500b00779237a422dsi13632505ejo.198.2022.09.13.23.56.44; Tue, 13 Sep 2022 23:57:10 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiINGPC (ORCPT + 99 others); Wed, 14 Sep 2022 02:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiINGO6 (ORCPT ); Wed, 14 Sep 2022 02:14:58 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75AB912AB7 for ; Tue, 13 Sep 2022 23:14:55 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MS9140PQ3zNmBd; Wed, 14 Sep 2022 14:10:16 +0800 (CST) Received: from kwepemm600007.china.huawei.com (7.193.23.208) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 14 Sep 2022 14:14:51 +0800 Received: from DESKTOP-6NKE0BC.china.huawei.com (10.174.185.210) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 14 Sep 2022 14:14:50 +0800 From: Kunkun Jiang To: Mark Rutland , Marc Zyngier , "Daniel Lezcano" , Thomas Gleixner , Oliver Upton CC: , , Kunkun Jiang , , Subject: [PATCH v3] clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921 Date: Wed, 14 Sep 2022 14:14:24 +0800 Message-ID: <20220914061424.1260-1-jiangkunkun@huawei.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.185.210] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600007.china.huawei.com (7.193.23.208) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 --- 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 9ab8221ee3c6..ff935efb6a88 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.27.0