Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7361429rwn; Tue, 13 Sep 2022 19:28:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR48vkSdHw2jv02zcZQgqOhDUltOPQTGT8lgCTkIvazy0X+G5/F6MGeq9ZfovaMRerKvY0Hd X-Received: by 2002:a17:906:216:b0:711:f623:8bb0 with SMTP id 22-20020a170906021600b00711f6238bb0mr24657483ejd.174.1663122505745; Tue, 13 Sep 2022 19:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663122505; cv=none; d=google.com; s=arc-20160816; b=OFYyDdlq7t7eip7WbgedvqvH51BskSON8zreZ1mJfpyNaHrcNAfQ3iMChhyrpU7yjI G5jZGH2Lijxie8PFDbJ5lbK3aboNHKxVW7dUVbsdAWO7KOrC7fEVSJAutGdh5NxBFE7x 006s/DG/T/Uc2sn7Ssny20R4ZZigUc0ktA4NrftEJ7lP7Wlf740U3mUMXK52rkGPqwOo fvw5sQhehgEd/SUOX54GuD0uedRg5mRKFK0ZSpMWBL2ivhE7G+MGceqRHwIx+VWIEhSa bNjdweKLENTFna8lx0SL8qohXOTKvyRvXsdG5GYL69EcDXHHmROokDDmqo88Qcd+dJKn Gr+A== 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=D0nq2tYcx1NLDh+JSYg3i2g7TA5o7a/wGfGFb0Xiq6HyuRH8M0ZE6W9BpwwMkRrTia 9eK6BMQa74y9ISQYaScOHJLjbwGAvvoh5Rg/bWMT/j2207qEt6kqh+T1tetbiN7lpAQq 4HmuSFnF8eHKm/mSg4hg6N4TVVTV+gDbkdqMnWkcuXTH1fZ5/4sdZJAGyA7TS9XkkqZr 12L5t6v6tiLVnjm7uqjG9JKiXNDoeyqsADBLySCf4KHNiUDpmxO58/cHzUOQPy1iOG+s Zb1NnAqp6hSThKOU9mxhRt9cUbNZGNm6IMHoUYq7cphGp/WZbb3KI5rdhNpXaRpJhTFl iCzw== 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 ht17-20020a170907609100b0073dd6da172csi10322436ejc.446.2022.09.13.19.27.59; Tue, 13 Sep 2022 19:28:25 -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 S229722AbiINCWC (ORCPT + 99 others); Tue, 13 Sep 2022 22:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiINCWB (ORCPT ); Tue, 13 Sep 2022 22:22:01 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E23DA5D12E for ; Tue, 13 Sep 2022 19:21:56 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MS3sF6sfqzmVGc; Wed, 14 Sep 2022 10:18:09 +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 10:21:54 +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 10:21:53 +0800 From: Kunkun Jiang To: Mark Rutland , Marc Zyngier , "Daniel Lezcano" , Thomas Gleixner , Oliver Upton CC: , , Kunkun Jiang , , Subject: [PATCH v2] clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 85821 Date: Wed, 14 Sep 2022 10:21:22 +0800 Message-ID: <20220914022122.1175-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: dggems703-chm.china.huawei.com (10.3.19.180) 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