From nobody Tue Dec 2 02:04:30 2025 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 13C31368DE6 for ; Thu, 20 Nov 2025 18:42:52 +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=1763664176; cv=none; b=jaMb3+wWNDkUYvpJEzeo1R9ZM4aqHI5WDqFgA5rDZIQOjM+8/NDBlIt9PbAtg8VD2moxqbKTQXkIAAeJpSee7q9/INrfkfuUMOtLcwfX6L4IpxcY0tdVKYhO2TJQOhZnZ9DUlCqHt0QcpgBfs7YgfO7Jw6QR5xW4TvqMqyQjwaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664176; c=relaxed/simple; bh=bgfytSBH7LUphmvFmf8AM1B4JmY7ELo3wqgFaeraDm0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YLO7Lc47EcvK0pzcyjqXAx9ADqkk/9/kavexrM4XeysmA9g4bE6kyHvLcxVwNX8be+0CPd8+39pFvoUGaZBaSWG+Y9E7z4rlgiG0lYD8CDECsCwO3xPcNG5/7p8ysurkdpPsVCTNKArqOzFyWz5efLWqD41yeHoZsXR51R/UYNA= 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=NKu0FSj/; 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="NKu0FSj/" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2956cdcdc17so14744665ad.3 for ; Thu, 20 Nov 2025 10:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763664172; x=1764268972; 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=RExy28cj9QkD+uGmena181X3aoXaellaEJhmZl5Ril8=; b=NKu0FSj/f9+shzNZmwEV6WXrR8iwFagqxAgTLNbUYahe557IXrE4C35J9Gsxq3NpPO PuTakO+/hOWoJtnyjmRNzdsna3FCjuQWe+JZj+tYLSTtCiaFPstgOr7O7aA4+dR0gmMp w+op6+EsSI0C3TPYMmCACjERREKzNnDbG4djoRF0sD1iXDNshZdRfGxyWUxxrht7b+W4 dk+L1XGMkEYvH6VpGaqzm9UM/DaHt4r4PM+lIvZjrlmTvMkUhYm+0xA32xH5KynurxQM TQd0W1U5hUJEerLnpNnjEV5L+oJaUqc2U3+DL7L8EnR7TGuelwUrjWFdQYhS1lMAVOcO lz1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763664172; x=1764268972; 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=RExy28cj9QkD+uGmena181X3aoXaellaEJhmZl5Ril8=; b=l5dovgzuiBMTqbDwL33J+ool3QkQmsU8bPPcZvpsoRBqr5Yl9O7U+TVUir8LKC4TnJ wrVuhnw6NLGjVREVFH/LEZSpoDQfw4zPZ6XpK3o997jRHts5N25KLGNnuValxTIh224l JfqfMU/XsvMsJaXi+fq4JCkYYYEeuX4l4KduievB2WE5wSHi3ZGys1wafNirR5BgPJoA lpsW92qZKCCas5NEXVA7GCZ8fxIyiBE2lbsFpjxu+uujbzzEyP5gnOvRGzKs7P4IQ9fx GmxUCKJ6p09Zvqy206nICZeakvfxHaZVFlImtRJszg1UGcdYxXoSQq+h7kbLrwTFaSZ9 zV/Q== X-Forwarded-Encrypted: i=1; AJvYcCV8eVIdXteyYDJe5tOA/MhMpYCmrUSCCj8PKRtN6wt2GrE+wkNRCA+BxM/OPxmbfPiOolDETgJ+bjwGo/A=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4MWuu34peRRx5cPUwP7i3CgwhZVbIz7yCa7hY8RAcViJkMrtu PUM4J/uuVzmYZiM0c53iR47rutlem/AGxZqYpGGsVHbOB6cKi9zj0SR6KakZeOcVacSQF1K//R8 TYIOUJGjSdM3VXrlnC0I3itMuBnDzCQ== X-Google-Smtp-Source: AGHT+IFj4eYCHjnDTY78qqXAXzFjDOGfRWJ8FzD3bwljbRSaDt9DxqaN4Q0Zg0pQMA4iTkvLUZBi27kxn8VVOeQs6UU= X-Received: from plek19.prod.google.com ([2002:a17:903:4513:b0:268:c82:4230]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f607:b0:295:94e1:91da with SMTP id d9443c01a7336-29b5b0f8119mr52722365ad.33.1763664171869; Thu, 20 Nov 2025 10:42:51 -0800 (PST) Date: Thu, 20 Nov 2025 18:42:29 +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-2-willmcvicker@google.com> Subject: [PATCH v6 1/6] ARM: make register_current_timer_delay() accessible after init 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" The function register_current_timer_delay() is called from the exynos_mct clocksource driver at probe time. In the event that the exynos_mct driver is probed deferred or the platform manually unbinds and rebinds the driver we need this function available. So drop the __init tag. Signed-off-by: Will McVicker Tested-by: Marek Szyprowski --- arch/arm/lib/delay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index b7fe84f68bf1..acfb87143f21 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c @@ -62,7 +62,7 @@ static void __timer_udelay(unsigned long usecs) __timer_const_udelay(usecs * UDELAY_MULT); } =20 -void __init register_current_timer_delay(const struct delay_timer *timer) +void register_current_timer_delay(const struct delay_timer *timer) { u32 new_mult, new_shift; u64 res; --=20 2.52.0.rc2.455.g230fcf2819-goog From nobody Tue Dec 2 02:04:30 2025 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 Tested-by: Marek Szyprowski --- 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 From nobody Tue Dec 2 02:04:30 2025 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 DA3F9368DFF for ; Thu, 20 Nov 2025 18:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664179; cv=none; b=Gz65deQ1L5NI/1gtaqulwsjGFn4D/yygR0EMk3vw875yF2msIZ6cWnlEH0ek/AwaeIenaArfT6yvsdwQvzDpg5ouIOHOqFjQRr8Kiz46g7uKXTlXpNVs/YE/X5QmMGjZHS+AxPmOVbaIF+ZNrFWLbh5opT/o5G2JNhyQG80GLRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664179; c=relaxed/simple; bh=CQ2TWS8aptGYMzzphALGKplU6Ms1bM5/JLx4uRHaTJY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DO0DJ91fuQJmvBI6fd8f7EwjKWXvRHwr9+48Hosr7I+viB7eCDlQttrz8opujvSCwjXQ5EnpgU+cwWW5ZYmLXRKjnXMyWEjHRdS9ZwkxZdxpuoJAinmK4dElgUnmmd/UeMrl1GeOZrhWgkt3brbwIRlxrK5QpqDupolGmAZ23Xs= 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=UKN/uUnB; arc=none smtp.client-ip=209.85.216.73 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="UKN/uUnB" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-341aec498fdso1593667a91.2 for ; Thu, 20 Nov 2025 10:42:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763664176; x=1764268976; 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=HJIhZfmMqbO9mcnaTw+JwlxVWIorab3X8zBbkjMr7nk=; b=UKN/uUnBv+YKzBNhR5YGJV++6+94CovV03Voecj7DHZOJlmhoewRB34Ka9V9ndCAvH Mml/FzASmziEY1MldeaVExbOOiDyvZ5PH+MVmOdJeMWmJXFIPq7wlMlEzvlPzTGc0mzz KZ2XYJqSRchVY20+MiugC+SB1Mn2HyOsVdD/1DfKHYFDChmZRZG6X72DFkRSwuXTMKti /4pbBn9JUEKemQO29uAAbn130+D3yjctMsUN119zkHcXsdlEk65jxzwnNqUv4EvcRFid KfYPDm8HRlJbDtp2F1Qy1ZYOL2bFZrjR/uOWLnBO/P2QzI1DfqZNLgj8zdEp9B8eyr2U 4zVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763664176; x=1764268976; 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=HJIhZfmMqbO9mcnaTw+JwlxVWIorab3X8zBbkjMr7nk=; b=tEmzaRB0dRqZtXnHISqc6b7AKtYb8tVD802knubpIWZiNHM5S4EhBjr4x9WJnYx7Lo f+0ZFUr3fhYZ0+XfC4t9+/Bp2X1gazzJWmER5TGBZ1Db/Y24d7aIoURlEZ85dR9b6HlN YFPuDA5bmcxnBeIrzn/CurXRheOP6gExme/C7Ml/W6pmvZ499Wi2a7OqxeEXUyY0tGUI dA2hixWyrQ0ftScE7X83eHP3R3XP3prgiBMzMxli8fiB6kbfPUwtnvxCTmcTLUg/TagI yEw2AVX6kwKd4fq+FLVpCJqGGlTZGtkRbFjOfapl/Je1KGzTeid7H8f8+gyZohs+KlRF 7TVw== X-Forwarded-Encrypted: i=1; AJvYcCV1bAVy6bA7Bn+yDM4AtXeZhQfLUgPxI+99cJyEwRdrECvn/SC2coMIdAz4xXSLXiTuO1SeOPvasxUclpw=@vger.kernel.org X-Gm-Message-State: AOJu0YzP0oFNW97cuzojuNs4ort//jFJ0giSIAjg2q714fjSgVXHrAst iot3O08j6xo3XnLlxS3JWYM+llTK7dRWRz9uMKi1qIiwxUhSPjcvaEqmO4kTDnocdEGtljbyB1Q GeG1kXfMC+6WXdp1CLiMyKggYtYzO3A== X-Google-Smtp-Source: AGHT+IFl9fEZIqkiFghfs+vHISTz0rvAH1muHgcGsd/RNvOZgDkuVVLTz0XzwarjQHuZpL8REviNMoTiDtwcLfUWL4w= X-Received: from pjon18.prod.google.com ([2002:a17:90a:9292:b0:340:5073:f80f]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4a44:b0:32c:2cd:4d67 with SMTP id 98e67ed59e1d1-3472a8fb8bamr3465095a91.13.1763664175778; Thu, 20 Nov 2025 10:42:55 -0800 (PST) Date: Thu, 20 Nov 2025 18:42:31 +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-4-willmcvicker@google.com> Subject: [PATCH v6 3/6] clocksource/drivers/exynos_mct: Set percpu local timer interrupts for 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: Hosung Kim To allow the CPU to handle it's own clock events, we need to set the IRQF_PERCPU flag. This prevents the local timer interrupts from migrating to other CPUs. This is only supported on ARM64. Signed-off-by: Hosung Kim [Original commit from https://android.googlesource.com/kernel/gs/+/03267fad= 19f093bac979ca78309483e9eb3a8d16] Reviewed-by: Peter Griffin Reviewed-by: Youngmin Nam Tested-by: Youngmin Nam Suggested-by: Marek Szyprowski Link: https://lore.kernel.org/all/20250827102645.1964659-1-m.szyprowski@sam= sung.com/ Signed-off-by: Will McVicker Tested-by: Marek Szyprowski --- drivers/clocksource/exynos_mct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_= mct.c index 96361d5dc57d..1429b9d03a58 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -596,7 +596,9 @@ static int __init exynos4_timer_interrupts(struct devic= e_node *np, irq_set_status_flags(mct_irq, IRQ_NOAUTOEN); if (request_irq(mct_irq, exynos4_mct_tick_isr, - IRQF_TIMER | IRQF_NOBALANCING, + IRQF_TIMER | IRQF_NOBALANCING | + (IS_ENABLED(CONFIG_ARM64) ? + IRQF_PERCPU : 0), pcpu_mevt->name, pcpu_mevt)) { pr_err("exynos-mct: cannot register IRQ (cpu%d)\n", cpu); --=20 2.52.0.rc2.455.g230fcf2819-goog From nobody Tue Dec 2 02:04:30 2025 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 82BC8368DF7 for ; Thu, 20 Nov 2025 18:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664180; cv=none; b=IUne5BRd2BsmMkGm2+A9X51EW3Kb9DqnVi8KerIgjXGj2SODCn6RJnXMlh1JwDllwDlsEUqsSGll6IGFSkf89TEMbkio80Ncwj3vDa4gYGpZNfPfMoApg1HNIdYNiWOHZjjYXPnehcoPt8SvLPbRUlgyvum8IsnsxCPXVB19+UA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664180; c=relaxed/simple; bh=fizX/zpb55v6tWXmO2kY83jVuj1wy+fw9bIDltyNrM0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=nk6/5YLFofeQQ5ALb9YORfMRfCB6ynylK3a18IW3bS9MT0kpAb4xeHXE85Bza5Y1U7pIgbLBXfKH5ctMu2C9GN8gOotXO9zP1bDeAotoduS4//o30kffrmlemB+gDIBOrn7Z6l8f9w+Qm9/PMns1Q0XSMd2S2EacBidzKBlkH7s= 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=zIMB6cuY; arc=none smtp.client-ip=209.85.214.202 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="zIMB6cuY" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-297e5a18652so14509145ad.1 for ; Thu, 20 Nov 2025 10:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763664178; x=1764268978; 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=sQI/aMjga6zLBbmFacInf1FiaB4N/DGsz2v/Apbe6jw=; b=zIMB6cuYqoRI5SI1XNtRf4g6wAZ74yuG3/T7sPaJsTU5qnWC2H4DSImuVVlvOnYMGv rqKvWvvHQY/wd0ixOurLOQorNDFrnWqgAt5b3dfFZdRxmtKTRgwZZfy4HuxS+OIDZ/uL KdHs4aDiHuBa2TH5CRQnkiCVgdfapKQPhKikgG5YxGLZSQs1uTM4eLWtoD5C52Mtjfbu aRRtOgQB/H/W/byvwRAaubCJ4reHLIWdzSx6ENBOzRn++3J+kmJqvT16LhzyG7ciq9Rr G/6WaqZCXGabJuyoYd2K8cjIKz9VUa1AVCwR/qj6fLc3Sfv1/lEPpg+DL5larajGfaKh wBpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763664178; x=1764268978; 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=sQI/aMjga6zLBbmFacInf1FiaB4N/DGsz2v/Apbe6jw=; b=pWsQoeCSP47VdnV71f3pzXV4Skvst1aPq2oAcs+5P2IqS+wcxo+ZgsVjQMlU++yqsl gEHQLQTk0/vqfsi8Mx7CZwall/dRMOND6LQQSrnQaEtZpG5rlmIaHmewbv8nqmvmc6ye 5tVLmdfLxLZhOSJ+ZssCk6JGKKFn8ShUprIpH3kdxPyWpBu/WFirsHl4cysrwoF5dInB tD+KEobjpKkmsffPGEBa4S9hkKR6kw0CLvYT5fha8EtDaUxa2dRYkv7B97O3Ez+WGT16 gs5BC/Jdnd0ioXVRlWPSraw/zEGCI+r2XvTi0w+gbfOYXZjkzeGRVsLMpUZJW6R9XXrb gXVQ== X-Forwarded-Encrypted: i=1; AJvYcCUWF+5KizGGH10sX9bqkaVGP9ajedvNOIGOOrdbCZo4P4FeMQ/ghePt5TI164UR5DNgFEl0ORXg7AXcM6s=@vger.kernel.org X-Gm-Message-State: AOJu0YxXaXfg6iXoJTNlf9eUD+VJUraIQTfa1JI1GQpFPbhY6Q3cXkMW bpcsiA4uke0KENDZztJF5TkeS745FeatKYONww8KphBnxd4exU+KB5GXBnH/rEJjXPc2kJ+FUu6 TkITWIU/3yW7Am7ywH3/ZNqgU58hUVw== X-Google-Smtp-Source: AGHT+IHwJthRNw4pqfJjYDk4vSF8m6qYCdx11lKLy4Vbpkd9LUAmbdAJbP3S8s2Ivqdqp6aG9ef+u6sWKJHez1RSwqw= X-Received: from plkb6.prod.google.com ([2002:a17:903:fa6:b0:268:cfa:6a80]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2408:b0:295:fbc7:d282 with SMTP id d9443c01a7336-29b5b08a22dmr50358725ad.27.1763664177775; Thu, 20 Nov 2025 10:42:57 -0800 (PST) Date: Thu, 20 Nov 2025 18:42:32 +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-5-willmcvicker@google.com> Subject: [PATCH v6 4/6] clocksource/drivers/exynos_mct: Fix uninitialized irq name warning 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" The Exynos MCT driver doesn't set the clocksource name until the CPU hotplug state is setup which happens after the IRQs are requested. This results in an empty IRQ name which leads to the below warning at proc_create() time. When this happens, the userdata partition fails to mount and the device gets stuck in an endless loop printing the error: root '/dev/disk/by-partlabel/userdata' doesn't exist or does not contain = a /dev. To fix this, we just need to initialize the name before requesting the IRQs. Warning from Pixel 6 kernel log: [ T430] name len 0 [ T430] WARNING: CPU: 6 PID: 430 at fs/proc/generic.c:407 __proc_create+0x= 258/0x2b4 [ T430] Modules linked in: dwc3_exynos(E+) [ T430] ufs_exynos(E+) phy_exynos_ufs(E) [ T430] phy_exynos5_usbdrd(E) exynos_usi(E+) exynos_mct(E+) s3c2410_wdt(E) [ T430] arm_dsu_pmu(E) simplefb(E) [ T430] CPU: 6 UID: 0 PID: 430 Comm: (udev-worker) Tainted: ... 6.14.0-next-20250331-4k-00008-g59adf909e40e #1 ... [ T430] Tainted: [W]=3DWARN, [E]=3DUNSIGNED_MODULE [ T430] Hardware name: Raven (DT) [...] [ T430] Call trace: [ T430] __proc_create+0x258/0x2b4 (P) [ T430] proc_mkdir+0x40/0xa0 [ T430] register_handler_proc+0x118/0x140 [ T430] __setup_irq+0x460/0x6d0 [ T430] request_threaded_irq+0xcc/0x1b0 [ T430] mct_init_dt+0x244/0x604 [exynos_mct ...] [ T430] mct_init_spi+0x18/0x34 [exynos_mct ...] [ T430] exynos4_mct_probe+0x30/0x4c [exynos_mct ...] [ T430] platform_probe+0x6c/0xe4 [ T430] really_probe+0xf4/0x38c [...] [ T430] driver_register+0x6c/0x140 [ T430] __platform_driver_register+0x28/0x38 [ T430] exynos4_mct_driver_init+0x24/0xfe8 [exynos_mct ...] [ T430] do_one_initcall+0x84/0x3c0 [ T430] do_init_module+0x58/0x208 [ T430] load_module+0x1de0/0x2500 [ T430] init_module_from_file+0x8c/0xdc Reviewed-by: Peter Griffin Reviewed-by: Youngmin Nam Tested-by: Youngmin Nam Signed-off-by: Will McVicker Tested-by: Marek Szyprowski --- drivers/clocksource/exynos_mct.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_= mct.c index 1429b9d03a58..fece6bbc190e 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -465,8 +465,6 @@ static int exynos4_mct_starting_cpu(unsigned int cpu) per_cpu_ptr(&percpu_mct_tick, cpu); struct clock_event_device *evt =3D &mevt->evt; =20 - snprintf(mevt->name, sizeof(mevt->name), "mct_tick%d", cpu); - evt->name =3D mevt->name; evt->cpumask =3D cpumask_of(cpu); evt->set_next_event =3D exynos4_tick_set_next_event; @@ -567,6 +565,14 @@ static int __init exynos4_timer_interrupts(struct devi= ce_node *np, for (i =3D MCT_L0_IRQ; i < nr_irqs; i++) mct_irqs[i] =3D irq_of_parse_and_map(np, i); =20 + for_each_possible_cpu(cpu) { + struct mct_clock_event_device *mevt =3D + per_cpu_ptr(&percpu_mct_tick, cpu); + + snprintf(mevt->name, sizeof(mevt->name), "mct_tick%d", + cpu); + } + if (mct_int_type =3D=3D MCT_INT_PPI) { =20 err =3D request_percpu_irq(mct_irqs[MCT_L0_IRQ], --=20 2.52.0.rc2.455.g230fcf2819-goog From nobody Tue Dec 2 02:04:30 2025 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 C9B92369984 for ; Thu, 20 Nov 2025 18:43:00 +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=1763664182; cv=none; b=I6GCOcK9hhaqXXNIgNmZtNCGlU4nESgKdRk8qfLhL5hO/ZWlCZjWoBBZ37hLEFIQOtb8urZ6d668e0xoT3ldN+NXrQuoTaWNMjufUlrTydwfFl+8c2A25QPQz6m7CAPjdEse3pLHcmFkbofyDcxLfAui9Rlheg+An4k8msiGwOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664182; c=relaxed/simple; bh=Lgs6szvmIjWdxADOFBIkAezHEVnva2pxFGhSnDvsil8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=HmoeZPE2/KMCEZ9rwzuA+WvaJr+pTKomFA7C0jzcnApryPKWFV1Qunb00+kfTwIdFriLUMX0WS2FkQtU4ZwhegpT3LxIgoHVdEp8UauqTgly9Bgwaiw77PVNhJJO793Yk0ce1Xe/OpKO8qZGeC+IOPVoEt4TIuWmzgHcyZxenWA= 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=TA3YrxYJ; 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="TA3YrxYJ" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-295915934bfso20863285ad.0 for ; Thu, 20 Nov 2025 10:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763664180; x=1764268980; 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=7ZhynQ1C+Qi97UwkIs4tb4ijOuArkDPdVuCjShevDQ4=; b=TA3YrxYJ7L7wl5Lsh5PfVkWHeh42cOvbqU4b9vpkJX+ALM6WoC++Vl+KChSL9dm8Ne c0kv+b6Rh6AK0gAGa4FkM72bk/GOd1Ystzt4LmN4DSPltm1hqmrD94U+3uqaewfQoEj+ 4FXPfbwPkvlA4FPwOy/KuyNMX/iP0PP62zMd1aNeRnsO4nU4PBt3fdhb+pz/ADEkiLFf hy/ghJ2amZuHGpaz2EJKUiY5VDMJmeUuy7hEjJPgiHCH6pRq+QSRrLk0u9926Qb26eKL 693OPxXzWwF/KSaAHn8tS/irbkjPmU5Gcb+dt2gB5a5o33Vk088dPP43V0+Ydhs1DivG 1Qhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763664180; x=1764268980; 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=7ZhynQ1C+Qi97UwkIs4tb4ijOuArkDPdVuCjShevDQ4=; b=Ps/+TTYQaqLeFT+ANeDViOqvvWIdZRh7MS1lK6xy9lo6ZD02cps+U7z+HwU9zsO4R7 A18kagf8ZiLwyAOiqxaLfaReSrsizcGQa1BQHCzMFAwzWUJffpgBpFxoX+yX2bsjA3r7 clPG2w2/rI7GHSPeEvqwkhDbOszZM0nh9ugjo0c0vcN98FfeptKoiVMURZxzNhcfGLXP ug/CuhL8tvcyRU4pMpXFhtGX0yl5282salFiFN0Ped72/j9Los9jWDJqJcLknfLa6Ggr RK5f4na1UsndqJfsvw4Hse4nDD21xLCcNrz7JNQORNq9X9qR9h6416gVgbn8BjaWSATL Esdg== X-Forwarded-Encrypted: i=1; AJvYcCUgVgonyN/Ct8xRvQ1eB6k5BfQPi9AY7lvfB74fB6kLrW0j5WP6Kqe4YwOrmVTujwRckbzA8bfi4NjIgKs=@vger.kernel.org X-Gm-Message-State: AOJu0Ywcx4dUg431A75rKK8LwSAhWQBkMDAwBzd9uqKNx7ZivQYpgA4D bSUH86/USpf7BE7zkxqYURMBMqdSE+prVqM5FBUpRDFQ3lYiiIUM6xrAGLbAma1aBYXxbQMyyv4 nv5epOddLZ/RFrg197XgBXxfXLsUyOQ== X-Google-Smtp-Source: AGHT+IEt/Rnu04z2aH9Z9OLNbqRP/pUTKYo+u1/ArFiPePsuZbsDWIhlzIUZmUyy2hjC5k2QI/TnRwU+QRzQbAqqPns= X-Received: from plgu3.prod.google.com ([2002:a17:902:e803:b0:290:d4a1:13cb]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:1a44:b0:258:f033:3ff9 with SMTP id d9443c01a7336-29b5b0fe951mr55111265ad.48.1763664180062; Thu, 20 Nov 2025 10:43:00 -0800 (PST) Date: Thu, 20 Nov 2025 18:42:33 +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-6-willmcvicker@google.com> Subject: [PATCH v6 5/6] clocksource/drivers/exynos_mct: Add module support for 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 On Arm64 platforms the Exynos MCT driver can be built as a module. On boot (and even after boot) the arch_timer is used as the clocksource and tick timer. Once the MCT driver is loaded, it can be used as the wakeup source for the arch_timer. Signed-off-by: Donghoon Yu Signed-off-by: Youngmin Nam Signed-off-by: Daniel Lezcano [original commit from https://android.googlesource.com/kernel/gs/+/8a52a828= 8ec7d88ff78f0b37480dbb0e9c65bbfd] Reviewed-by: Youngmin Nam # AOSP -> Linux port Tested-by: Youngmin Nam # AOSP -> Linux port Signed-off-by: Will McVicker Tested-by: Marek Szyprowski --- drivers/clocksource/Kconfig | 3 +- drivers/clocksource/exynos_mct.c | 62 ++++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index ffcd23668763..9450cfaf982f 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -451,7 +451,8 @@ config ATMEL_TCB_CLKSRC Support for Timer Counter Blocks on Atmel SoCs. =20 config CLKSRC_EXYNOS_MCT - bool "Exynos multi core timer driver" if COMPILE_TEST + tristate "Exynos multi core timer driver" if ARM64 + default y if ARCH_EXYNOS || COMPILE_TEST depends on ARM || ARM64 depends on ARCH_ARTPEC || ARCH_EXYNOS || COMPILE_TEST help diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_= mct.c index fece6bbc190e..55ce1d0b648e 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -15,9 +15,11 @@ #include #include #include +#include #include #include #include +#include #include #include =20 @@ -217,6 +219,7 @@ static struct clocksource mct_frc =3D { .mask =3D CLOCKSOURCE_MASK(32), .flags =3D CLOCK_SOURCE_IS_CONTINUOUS, .resume =3D exynos4_frc_resume, + .owner =3D THIS_MODULE, }; =20 /* @@ -241,7 +244,7 @@ static cycles_t exynos4_read_current_timer(void) } #endif =20 -static int __init exynos4_clocksource_init(bool frc_shared) +static int exynos4_clocksource_init(bool frc_shared) { /* * When the frc is shared, the main processor should have already @@ -336,6 +339,7 @@ static struct clock_event_device mct_comp_device =3D { .set_state_oneshot =3D mct_set_state_shutdown, .set_state_oneshot_stopped =3D mct_set_state_shutdown, .tick_resume =3D mct_set_state_shutdown, + .owner =3D THIS_MODULE, }; =20 static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id) @@ -476,6 +480,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu) evt->features =3D CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERCPU; evt->rating =3D MCT_CLKEVENTS_RATING; + evt->owner =3D THIS_MODULE; =20 exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); =20 @@ -511,7 +516,7 @@ static int exynos4_mct_dying_cpu(unsigned int cpu) return 0; } =20 -static int __init exynos4_timer_resources(struct device_node *np) +static int exynos4_timer_resources(struct device_node *np) { struct clk *mct_clk, *tick_clk; =20 @@ -539,7 +544,7 @@ static int __init exynos4_timer_resources(struct device= _node *np) * @local_idx: array mapping CPU numbers to local timer indices * @nr_local: size of @local_idx array */ -static int __init exynos4_timer_interrupts(struct device_node *np, +static int exynos4_timer_interrupts(struct device_node *np, unsigned int int_type, const u32 *local_idx, size_t nr_local) @@ -653,7 +658,7 @@ static int __init exynos4_timer_interrupts(struct devic= e_node *np, return err; } =20 -static int __init mct_init_dt(struct device_node *np, unsigned int int_typ= e) +static int mct_init_dt(struct device_node *np, unsigned int int_type) { bool frc_shared =3D of_property_read_bool(np, "samsung,frc-shared"); u32 local_idx[MCT_NR_LOCAL] =3D {0}; @@ -701,15 +706,58 @@ static int __init mct_init_dt(struct device_node *np,= unsigned int int_type) return exynos4_clockevent_init(); } =20 - -static int __init mct_init_spi(struct device_node *np) +static int mct_init_spi(struct device_node *np) { return mct_init_dt(np, MCT_INT_SPI); } =20 -static int __init mct_init_ppi(struct device_node *np) +static int mct_init_ppi(struct device_node *np) { return mct_init_dt(np, MCT_INT_PPI); } + +#ifdef CONFIG_ARM +/* Note, legacy ARM 32-bit systems depend on the MCT as the only clocksour= ce + * which requires this driver to be initialized very early. We need to kee= p this + * special condition until we can transparently support modular and early = init + * timers. + */ TIMER_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init_spi); TIMER_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init_ppi); +#else +static int exynos4_mct_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + int (*mct_init)(struct device_node *np); + + mct_init =3D of_device_get_match_data(dev); + if (!mct_init) + return -EINVAL; + + return mct_init(dev->of_node); +} + +static const struct of_device_id exynos4_mct_match_table[] =3D { + { .compatible =3D "samsung,exynos4210-mct", .data =3D &mct_init_spi, }, + { .compatible =3D "samsung,exynos4412-mct", .data =3D &mct_init_ppi, }, + {} +}; +MODULE_DEVICE_TABLE(of, exynos4_mct_match_table); + +static struct platform_driver exynos4_mct_driver =3D { + .probe =3D exynos4_mct_probe, + .driver =3D { + .name =3D "exynos-mct", + .of_match_table =3D exynos4_mct_match_table, + }, +}; + +static __init int exynos_mct_init(void) +{ + return platform_driver_register(&exynos4_mct_driver); +} +module_init(exynos_mct_init); + +MODULE_DESCRIPTION("Exynos Multi Core Timer Driver"); +MODULE_LICENSE("GPL"); +#endif /* CONFIG_ARM */ --=20 2.52.0.rc2.455.g230fcf2819-goog From nobody Tue Dec 2 02:04:30 2025 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 D446E36C596 for ; Thu, 20 Nov 2025 18:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664184; cv=none; b=TlWJwodw2mnL2VhMo6+JxMgWObpSd11eGmoxoxhj/WoFb/ArEElmD5/owlMaPkbDIxIyBjqGBREiWFl0BJcfgXe1rGYzeO/iw9T/pgoa6a3qHPdRmN2b/lsZJIF8prxCGw126TDkCTRJdIkutQHphRkL1Ce+ViB+RXMd81RIYqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763664184; c=relaxed/simple; bh=PPLIEDyHUtk7qahJ1dpQJZQHzZbivp1Tlxcb2qSuB/o=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=u4/zSf7JVeK6UGlcbMgNXlvGbHrsewCRivvE6h0nInnljQVfkn40luEsZBooMzBwuf8BlcLETT1Fl8ITKUTgCQNLzuZ8uL9nlzYvY7MtLWebWBajnqebfI9zAibx2r1kWLY5tgYaYcWv6Cn+pynxDahTdQZ5wRbFFD8X14vp0yY= 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=B9lpDMmQ; arc=none smtp.client-ip=209.85.216.73 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="B9lpDMmQ" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-343806688cbso3001490a91.3 for ; Thu, 20 Nov 2025 10:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763664182; x=1764268982; 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=JGcCdHbDbTIl/UPp/4b9lzfyFAtmrTaBAs1wcxj1OgM=; b=B9lpDMmQfxOhBN48b8xkQmNGzXkoHX5p8monqPG0PHe8mgjYdSWhYPh8LB7scNLBID sZBu5edRzrcyt8Ry4NDsCfdaXZ2R9oZ/HuLHGeBctBVopzxxbbokZpoqvb1mE4Uy9Btk mwYL2Mt4VhbsmlBV/s1TK1QKz9rhNy1dIl3JnCk7XDkYvXnhNDIT4mJt3zh+L0CgbVRH xDG8B0yVKk9vQ1Pbh5/pklxnidj3WJgm0kyTTef4lhYGvbbR1ffpwiKOorIZqTfUTHyn 2N+R59VSmMU5PRGafUkGHyXy5+QyP8NpbD5cyDWbNsTPtYqo9A3J8AbHsmqQpAtdBQ0b DESw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763664182; x=1764268982; 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=JGcCdHbDbTIl/UPp/4b9lzfyFAtmrTaBAs1wcxj1OgM=; b=VfIiOMJZB8DK3dUO0PIv/u8va+qD4OJo58zLmK9zqPi8HfPv5Cx6G8cuauSGJmhdUf KEX9W5VxYrKcUQnsXXbF4Wj7CMScS+EelYyxkxb0RGsmvV2KFvomtyLSrApJCewxPZ5S EZcaCkSTl9II1NPequmga5c4pscUO0iP2+OO3CJBEUhBuyYbIpvXGXuLclQrikUOMXh7 ycgx6oYSkbbJadRCf/euS4tyJ/KyqJyynpCdg5DEfYT3m06XSaK+jE9EhgU5nldgcJcT 76cb6W5oz+pWVPAT1HHfn81J52qzu4iL+8ep2YTNHh3m5k3S+xPsTmhb3TQrnSTJIirt isUA== X-Forwarded-Encrypted: i=1; AJvYcCXS33tCPat40OspumxJKa7GxC/QvDku2bfcAFAyOTivl8hNSsPn2dO9RFDF3fa8I7CV0pQJtArRccLl0fk=@vger.kernel.org X-Gm-Message-State: AOJu0YyEbj+38yJJCYlsxPGCbdVyJ6ZYloRiY4H05pvexaI011T8BQPl Nc+N5iRqrU++7uNoU1fWKXtT7gVBYdp0z+ctFuDy/HK3BRGxb0Zlq0QNaUdslSm0wfraVlbvw3N R4zoSshwac3dizOtE0MeY3OoOv8aYaA== X-Google-Smtp-Source: AGHT+IFt5QfE8e5NXxmnZJ0/iQdAGNuMSvT4BtRRro1MfwvfVu6kdP0H+7ZtU7YhUZh+wKkjO47g10Q354uCZT6CnAQ= X-Received: from pjwx3.prod.google.com ([2002:a17:90a:c2c3:b0:343:af64:f654]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4a51:b0:340:bfcd:6af3 with SMTP id 98e67ed59e1d1-34731c82829mr327779a91.33.1763664182070; Thu, 20 Nov 2025 10:43:02 -0800 (PST) Date: Thu, 20 Nov 2025 18:42:34 +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-7-willmcvicker@google.com> Subject: [PATCH v6 6/6] arm64: exynos: Drop select CLKSRC_EXYNOS_MCT 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" Since the Exynos MCT driver can be built as a module for some Arm64 SoCs like gs101, drop force-selecting it as a built-in driver by ARCH_EXYNOS and instead depend on `default y if ARCH_EXYNOS` to select it automatically. This allows platforms like Android to build the driver as a module if desired. Reviewed-by: Youngmin Nam Tested-by: Youngmin Nam Signed-off-by: Will McVicker Tested-by: Marek Szyprowski --- arch/arm64/Kconfig.platforms | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 13173795c43d..fc6026c368ca 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -128,7 +128,6 @@ config ARCH_CIX config ARCH_EXYNOS bool "Samsung Exynos SoC family" select COMMON_CLK_SAMSUNG - select CLKSRC_EXYNOS_MCT select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS select EXYNOS_PMU select PINCTRL --=20 2.52.0.rc2.455.g230fcf2819-goog