Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4439677rwl; Tue, 28 Mar 2023 07:05:32 -0700 (PDT) X-Google-Smtp-Source: AKy350b5DCml2spkCCru1ucOljjweusr9tDnmgkxwJs/5oPyh0NujIxj7yQ+bjPioQXOZ107ZBKz X-Received: by 2002:a17:903:2451:b0:1a1:add5:c355 with SMTP id l17-20020a170903245100b001a1add5c355mr19241733pls.5.1680012332109; Tue, 28 Mar 2023 07:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680012332; cv=none; d=google.com; s=arc-20160816; b=qru4vrLtMPimuYibJQRzcAtQIt3Av/fB4bug9NZ4idWo4wxPvbVHuNMdP8gGiwa2ZO tdPW2BC9RaKkVpw5hGtr8tpOjg/29PV9g51juS1jigRfQmKYYM8Xo195giCYs1T9LBLL m3nvPF09ebXId48ExbdZxjmq8ZWKXJEbBqrohyH4+zbm3oDYbP9UPp2y5u8OmEDPhbEy UAGnNroKOdgWFlQ2KL24iVU3X5lKRwJl4npykp3+S3ResPit2OY/lriC0XujBvDP1Vvz QYmkkIlZwMJCO2bR7XMALdFxu1uzJV4C2eshj/h2cHNGra43rae7Y2LxnXWoI1irj0ga fI6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UDwrjZu2TJbf2/di4KdAG6K8hSxHbD8Xr3Rj/xUQnPw=; b=fguf5BNZBEoK/MX2cmz1/e34lUcyWWKUJjoZJGXCq4D4bkkvsUR993Ert2j80fae91 SpbTMg4aE2auDZdqV4qK6moqiXXwAcnWYCoxIG6weIf7nDuzOXxS2RbvHitIuTjcQZbl CIUZn3g5cbnMAtuDOPHkSJx8py/hQlnN7RIIhLCykrRNB0pDDJqs8M+hskREJ7CCTasc ShlKN1+gCp/QSvDHrTxnyCFFwxCSftiwL+zAjBPeGsWTeQqDAPjQgiInf9CemI4r2YtW 00efxAQZAeYkimCHLmS2mrZUHFyXBSoM9moAJs9kH9c/w8W99/6SAlI5sZtAPiXC5L5p hljQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CUX0vueh; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a170902704800b001a2289cb4a9si8155346plt.204.2023.03.28.07.04.41; Tue, 28 Mar 2023 07:05:32 -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=@kernel.org header.s=k20201202 header.b=CUX0vueh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232558AbjC1OAx (ORCPT + 99 others); Tue, 28 Mar 2023 10:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233157AbjC1OAJ (ORCPT ); Tue, 28 Mar 2023 10:00:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1764419C; Tue, 28 Mar 2023 06:59:33 -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 ams.source.kernel.org (Postfix) with ESMTPS id A71B2B81D5B; Tue, 28 Mar 2023 13:59:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE48FC433EF; Tue, 28 Mar 2023 13:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680011970; bh=7d9PVKwq4fSFcNvrchiGI92QiSv0vEPNvjbEycB5mBI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CUX0vuehyo0rHtdD+gOFi+s52HGAY2qXbj78jn3dwm4EmGnvrvzhrQ8lin1DbEd4v +yfeIAuNlsaEcsPsuD9MzWYSbyweAsz5cea19C1d8SBQcud3U8+/Z2cj/pEnDqCHoi qHICtGDXvL+SnwWLnFAsVZxXBBXNtSKOLhyN4JFxY6tZq6lyS52NZqBAPPzsjDBM/e etSGcouGq/HOcUIta5yNewUizOm9HY9qwktE1Epotg9/bocS/sjZ+JZbIp27HHYg3k iMU5FCKm5kPzl58vy4jTJk8hhs/Hz+hBuHQ4toSW/+VKaWqqPKr9wfmmvqxKvxqqDj liS7yp0pYGiSQ== Date: Tue, 28 Mar 2023 14:59:24 +0100 From: Will Deacon To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , Daniel Lezcano , Thomas Gleixner , stable@vger.kernel.org, Yogesh Lal Subject: Re: [PATCH] clocksource/drivers/arm_arch_timer: Update sched_clock when non-boot CPUs need counter workaround Message-ID: <20230328135923.GB1333@willie-the-truck> References: <20230113111648.1977473-1-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113111648.1977473-1-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Hi Marc, On Fri, Jan 13, 2023 at 11:16:48AM +0000, Marc Zyngier wrote: > When booting on a CPU that has a countertum on the counter read, > we use the arch_counter_get_cnt{v,p}ct_stable() backend which > applies the workaround. > > However, we don't do the same thing when an affected CPU is > a secondary CPU, and we're stuck with the standard sched_clock() > backend that knows nothing about the workaround. > > Fix it by always indirecting sched_clock(), making arch_timer_read_counter > a function instead of a function pointer. In turn, we update the > pointer (now private to the driver code) when detecting a new > workaround. > > Cc: Mark Rutland > Cc: Will Deacon > Cc: Daniel Lezcano > Cc: Thomas Gleixner > Cc: stable@vger.kernel.org > Reported-by: Yogesh Lal > Signed-off-by: Marc Zyngier > Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters") > Link: https://lore.kernel.org/r/ca4679a0-7f29-65f4-54b9-c575248192f1@quicinc.com > --- > drivers/clocksource/arm_arch_timer.c | 56 +++++++++++++++++----------- > include/clocksource/arm_arch_timer.h | 2 +- > 2 files changed, 36 insertions(+), 22 deletions(-) I'm just going through the patch backlog and I think this thread ended with Mark's review. Do you intend to post an updated version? Cheers, Will