From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7613DCD3422 for ; Mon, 18 Sep 2023 11:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241384AbjIRLLy (ORCPT ); Mon, 18 Sep 2023 07:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241474AbjIRLL3 (ORCPT ); Mon, 18 Sep 2023 07:11:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4204D120 for ; Mon, 18 Sep 2023 04:11:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D73AFC433CA; Mon, 18 Sep 2023 11:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695035476; bh=5hQycVA7KMCN6afk7MZOTflIs9jB3IHBfyU/PBD3Vw0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cc5MVugx0gvApBnA/scg/hfHFLuLp3xtqfYxYW+4kY+za3Qasgre07vYRUajVKRBW +2UYLsLykm4ailOjA7eH9aPoZmmc6qqh96JKeDRm6n4vYhvDI1zELSEoPYLxgURk03 uSidZ2g24EokoYpS6jy0/Se21EAvOha9OA3Sv9xo44aqHVpxW7xvhdveF8UYIN4EMm 8bLLrqj5G7pegks4yanq1yn1VR3WKeTBsLNTct81OdGitOKi8wi4NT/BwPeFNut1mF JTNrtb7mSgUaLVPmODwGXCI/QgBg10uP1vaz4KfutCKNpOHJz05278c5Xv6FeNxutE WhlG4UQxceUPw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qiC9q-00Dw73-IM; Mon, 18 Sep 2023 12:11:14 +0100 Date: Mon, 18 Sep 2023 12:11:14 +0100 Message-ID: <864jjrenxp.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: Re: [PATCH] clocksource/drivers/arm_arch_timer: Initialize evtstrm after finalizing cpucaps In-Reply-To: <20230907133410.3817800-1-mark.rutland@arm.com> References: <20230907133410.3817800-1-mark.rutland@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 07 Sep 2023 14:34:10 +0100, Mark Rutland wrote: > > We attempt to initialize each CPU's arch_timer event stream in > arch_timer_evtstrm_enable(), which we call from the > arch_timer_starting_cpu() cpu hotplug callback which is registered early > in boot. As this is registered before we initialize the system cpucaps, > the test for ARM64_HAS_ECV will always be false for CPUs present at boot > time, and will only be taken into account for CPUs onlined late > (including those which are hotplugged out and in again). > > Due to this, CPUs present and boot time may not use the intended divider > and scale factor to generate the event stream, and may differ from other > CPUs. > > Correct this by only initializing the event stream after cpucaps have been > finalized, registering a separate CPU hotplug callback for the event stream > configuration. Since the caps must be finalized by this point, use > spus_have_final_cap() to verify this. > > Signed-off-by: Mark Rutland > Cc: Daniel Lezcano > Cc: Marc Zyngier > Cc: Thomas Gleixner Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.