From nobody Sat Feb 7 15:10:16 2026 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5601366DC3 for ; Thu, 20 Nov 2025 18:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664177; cv=none; b=Uqhp6Buu5V4ZWO1msXGlBFdnI1Q+JEW8rUS5kAFw6Il4SOUDbOWRkDtcH0/C3bOwvS2MFZoPlGWiTLsof62bFUoaQyRSiWT/6NNvI0Rh3hutKsiK385eKsalvsvQNfQYHEs+PJ/Mh1KRfp/zhU/Im8mnZIQF3kD2jYGHQ4IwSVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664177; c=relaxed/simple; bh=lKVdCN8JBdUVNmi+2+CNjUNO8qd/FNjKg98yTe+QFgc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=H/Jq0FLbWrz0cmHp14C4BjxtlS/nrzzudOh626wgXJmohwZB1SM3hu+CiH2oCbRDuz08tk4dp1RVGyZVMkf5DKwF7Ck0V3pgARwt7KkB2Qq4xlReO4RVZWoOxXImZQLKmQmvx4GRIOaEWjCMN/5M9Og3gbcnBG1uzWbkbccMQbg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--willmcvicker.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jgI34uVA; arc=none smtp.client-ip=209.85.214.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--willmcvicker.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jgI34uVA" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-297f48e81b8so17973735ad.0 for ; Thu, 20 Nov 2025 10:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763664174; x=1764268974; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=dwVcqjt/+P6tfyy9WazYLCo3sTdT6XbgNKzwRFFAj5A=; b=jgI34uVAxK4bTbrmD+0qXcTJ/fXpyWGo7UKCZql977k+7eFF1VU7P+iVAo7qegwCsz TG9sIsXIomU+evG5RbS+YezC8ukf9lxJoUXoDTc+dBkie2FPhNTG0AufUaKK5DPyz57k CJDANrDPOdHSdgi4nMJ/guKH0Mg/lnszbF2UqOL2jylH3QmhrgjnLoehZ2AMp1L5aK/b UI4Gd4GO5Ziri9l2riipa/V4fp7mzD86m5P0+D06F6xxxaeNR/uEKTVpI4Q4eVx4Ukk/ fLRg5+rJUyt8faym24BgnY6FYMt7/kKiwrhLPg+NjjjY0NC9WW3Iw/KrSGMIIf0WFSgh CgRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763664174; x=1764268974; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dwVcqjt/+P6tfyy9WazYLCo3sTdT6XbgNKzwRFFAj5A=; b=mEadlh+fHmbl1melVSGiw7sZRNGjIJaPn45jOMVcN80sio0zuooeLRyU93z0Oakocz Lv16762ORuwczMHHHxKqSfZqBuolvtmkNUwny1lY3IADW3QiaGk8C6KuMQT7YPMInINp zLclXZcwkSF+u8KvdKeWCVXg6X5MZlmzb5F0OZZMT4SsrFFt2+PbInKffeWEa9mqhiwm +gl9TnMnKiyiTZ9I06+dx9hzh4oQ+gF9S5c83EOOv255YoM/vxTszRfCq59PT0ZfTCHh rduoTuDJOXp9Z5xi4HhvSAR/NRuAvN2LyD3fNP+/3zx4ztp+gUbpejLmOaKLljNNwH5a d/Cw== X-Forwarded-Encrypted: i=1; AJvYcCXpItiDHTBc6/i0eWpdzUn/kP2USfznT0alIfUwt0WSTgUO+8i9FCB/h801t0kFUWqTHMNTJtZBHNvsd94=@vger.kernel.org X-Gm-Message-State: AOJu0YzJOkEvTBcydj5dlpsjA6SwRGh2LnM+++FHp4Q19UDzTTj1T2B8 jSip2yW8iHsfwh4h3gNc2+XoRby32fsXaYzpMymRL8CsRnz/bHltH5DkAf1GCg0GeMzhPcvxhOU UewPs3zMWJ5ZnCfuBHi80QHAfGdYXcQ== X-Google-Smtp-Source: AGHT+IFTNfvZtT0WzL5Nc+FAu6fv6lCFS2ToKvk1FK8qn2vpItsaemU3AQtQmy9D0GKcQaDz7XzVGZor3xk+RWh+byo= X-Received: from pgav4.prod.google.com ([2002:a05:6a02:2dc4:b0:bac:a20:5efc]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f54c:b0:297:df99:6bd4 with SMTP id d9443c01a7336-29b5e38c0f2mr46481795ad.18.1763664173790; Thu, 20 Nov 2025 10:42:53 -0800 (PST) Date: Thu, 20 Nov 2025 18:42:30 +0000 In-Reply-To: <20251120184242.1625820-1-willmcvicker@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251120184242.1625820-1-willmcvicker@google.com> X-Mailer: git-send-email 2.52.0.rc2.455.g230fcf2819-goog Message-ID: <20251120184242.1625820-3-willmcvicker@google.com> Subject: [PATCH v6 2/6] clocksource/drivers/exynos_mct: Don't register as a sched_clock on arm64 From: Will McVicker To: Russell King , Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar Cc: Will McVicker , Donghoon Yu , Hosung Kim , Rob Herring , John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , Marek Szyprowski , linux-samsung-soc@vger.kernel.org, kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Donghoon Yu The MCT register is unfortunately very slow to access, but importantly does not halt in the c2 idle state. So for ARM64, we can improve performance by not registering the MCT for sched_clock, allowing the system to use the faster ARM architected timer for sched_clock instead. The MCT is still registered as a clocksource, and a clockevent in order to be a wakeup source for the arch_timer to exit the "c2" idle state. Since ARM32 SoCs don't have an architected timer, the MCT must continue to be used for sched_clock. Detailed discussion on this topic can be found at [1]. [1] https://lore.kernel.org/linux-samsung-soc/1400188079-21832-1-git-send-e= mail-chirantan@chromium.org/ [Original commit from https://android.googlesource.com/kernel/gs/+/630817f7= 080e92c5e0216095ff52f6eb8dd00727 Signed-off-by: Donghoon Yu Signed-off-by: Youngmin Nam Signed-off-by: Daniel Lezcano Acked-by: John Stultz Tested-by: Youngmin Nam # AOSP -> Linux port Reviewed-by: Youngmin Nam # AOSP -> Linux port Signed-off-by: Will McVicker --- drivers/clocksource/exynos_mct.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_= mct.c index da09f467a6bb..96361d5dc57d 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -219,12 +219,18 @@ static struct clocksource mct_frc =3D { .resume =3D exynos4_frc_resume, }; =20 +/* + * Since ARM devices do not have an architected timer, they need to contin= ue + * using the MCT as the main clocksource for timekeeping, sched_clock, and= the + * delay timer. For AARCH64 SoCs, the architected timer is the preferred + * clocksource due to it's superior performance. + */ +#if defined(CONFIG_ARM) static u64 notrace exynos4_read_sched_clock(void) { return exynos4_read_count_32(); } =20 -#if defined(CONFIG_ARM) static struct delay_timer exynos4_delay_timer; =20 static cycles_t exynos4_read_current_timer(void) @@ -250,12 +256,13 @@ static int __init exynos4_clocksource_init(bool frc_s= hared) exynos4_delay_timer.read_current_timer =3D &exynos4_read_current_timer; exynos4_delay_timer.freq =3D clk_rate; register_current_timer_delay(&exynos4_delay_timer); + + sched_clock_register(exynos4_read_sched_clock, 32, clk_rate); #endif =20 if (clocksource_register_hz(&mct_frc, clk_rate)) panic("%s: can't register clocksource\n", mct_frc.name); =20 - sched_clock_register(exynos4_read_sched_clock, 32, clk_rate); =20 return 0; } --=20 2.52.0.rc2.455.g230fcf2819-goog