From nobody Thu Oct 9 02:17:45 2025 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.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 C46731F4CB7 for ; Fri, 20 Jun 2025 18:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443462; cv=none; b=u/xVZcc0QeNq40NG0CLg7FLW6OvuGn87NflgDfWpc5bS6JUWlTAYL2f3H3Zr7QoB25cAO1srQCzyzwvwdUl15Shya0tHsLidZujyVcivz7AM56mzhEhRd0N40uc0qbE/rWuasVGuM8vGHdlqEN+jQOlg9DYBNvogcelNM7ZdD4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443462; c=relaxed/simple; bh=YiB0G6F8wy6l7JvT/ZZMMGcgJTsPVM5/IR5furyk19s=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=T8o1oy2r+LRYF9Nt5shnYdbdr1B2+R+QDwsWvFLE3IMBGvqbwIiQPXFIRTJyg7CFVDXYT2MnWKfQlJrsHINYE2oAbwJFgV7gAbMxwlCwu97eEF44b1xpZM4lOMlypBGReM7CblXNHKC9gzICWkBd6U91Le/aiaGhBNKerj0Uk4M= 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=kEZF0ghV; arc=none smtp.client-ip=209.85.210.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="kEZF0ghV" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-747ddba7c90so1915903b3a.0 for ; Fri, 20 Jun 2025 11:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750443460; x=1751048260; 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=VIV2B0fUwqK8CLLa1kWwxVC8BX5dJhCy6gXrqz6FTh0=; b=kEZF0ghVDfUQitDq23CzPHJ6pLGeasp65ZfPJQwQHE3th09nB8I6Ai2cIzZvv6Y4HK 8cM0gbuYCdakgx2OiwaAcGC6AKMLUNTLqgJp06JMhstPFvOHvJC46uUESDLQKOyvEQTp VmF1q+9fuQWtRPV4nLqbGgLnXz8xwdgr33HUa7JnM/msd7j3aHFVVADhSguOS2e+vCAl v6qhN7sZMdqVHgiBQ99BfsR0Um88hxJB+/xZGFSKwjxreLaD5k/ImFHpGJQ+Nd2pf5CF Y5qHa3mNU1/lZz/zmqpJ9A2z+HAseO4H2C+LVe3Wwh+t6nX5fERwZDnlMzF7zEn6Zy7Z 0NvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443460; x=1751048260; 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=VIV2B0fUwqK8CLLa1kWwxVC8BX5dJhCy6gXrqz6FTh0=; b=OD2F+JuWAavfSw7QGouJgvDzHjwVtSXA5KAs6lCIe0YT5nk+brTUZgjU4kqlmkdVaE 2WwqVRbglDBs4pOyvhTPWndx+UnvymWOTEstv1+/NQdkP4MBMYALp/J3GvSbw5MB0OHu yTdP31II01hDZoysgVz88ULHrMxRrpyUsi1GJzY/gIA7g4jmBWnM9yz0cxTUJpP6fgDe BkICBdO352P/Mt3ObeNEjVKcqKJb8GcRKqVSq9dpGipvcS2y62T26qlKwrZTzlt2qRr6 iAGOanU1e72p8y15F8xGIZQG0VfWtsdSyzgS9ydRDWiR166uGKbkVdp/pnTeHJsSKs7C 2YHg== X-Forwarded-Encrypted: i=1; AJvYcCUexi+cQ0I7hre6/BE2HOKfNhl7z9ijqnbGLcNCfo3Zztsyd3z71hE46lADgVm31XEweJ15lZHIvgGqFA4=@vger.kernel.org X-Gm-Message-State: AOJu0Yxu2UdwpTxit8R2CgtdluX2gkKkRTP+cZlJ/gt2Vw6nHFcugEBP 052VkvC5t7RK/COFQYoSrxDPefN0qxHP5kGUEujEAYCJGuocI9bkRRv0e7WklMvOTr8eaMPxlcf j31a+LscHaGQmRktqyRE3JTXgjUEiVQ== X-Google-Smtp-Source: AGHT+IER+5ubUXb+yU0g6Y0g4aUyAkU4ur+g2SnRAtI7gYMUtRakP+WKgzwI5sAh2R7yuuPE5LK9mNIpkJ/4UWR5zIg= X-Received: from pgww8.prod.google.com ([2002:a05:6a02:2c88:b0:b2c:4548:13d0]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:920e:b0:1f5:591b:4f7a with SMTP id adf61e73a8af0-22026fe7f17mr6330358637.38.1750443460127; Fri, 20 Jun 2025 11:17:40 -0700 (PDT) Date: Fri, 20 Jun 2025 11:17:04 -0700 In-Reply-To: <20250620181719.1399856-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: <20250620181719.1399856-1-willmcvicker@google.com> X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250620181719.1399856-2-willmcvicker@google.com> Subject: [PATCH v4 1/6] of/irq: Export of_irq_count for modules From: Will McVicker To: Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Saravana Kannan Cc: Will McVicker , Donghoon Yu , Hosung Kim , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Arnd Bergmann , Linus Walleij Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Need to export `of_irq_count` in preparation for modularizing the Exynos MCT driver which uses this API for setting up the timer IRQs. Acked-by: Rob Herring (Arm) Acked-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Youngmin Nam Tested-by: Youngmin Nam Signed-off-by: Will McVicker --- drivers/of/irq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index f8ad79b9b1c9..5adda1dac3cf 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -519,6 +519,7 @@ int of_irq_count(struct device_node *dev) =20 return nr; } +EXPORT_SYMBOL_GPL(of_irq_count); =20 /** * of_irq_to_resource_table - Fill in resource table with node's IRQ info --=20 2.50.0.rc2.761.g2dc52ea45b-goog From nobody Thu Oct 9 02:17:45 2025 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.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 13D952EBB80 for ; Fri, 20 Jun 2025 18:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443465; cv=none; b=fc814jg3LFjyyK49YzMx+wCczyi1QRqJk29aUsQv5VqGT/fpsMYF/HggdoSsYoCqHMLz2Yve7Vaun2mPSEFSsDS49hbKjn4sPpAlFKItbLhAuiVyfMAD3ts3k+2mOixvkmqKmZmKQcPM0q86VMkRzWQx/jjEpLmKvf5OMRnWS9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443465; c=relaxed/simple; bh=E5gNelm91XMJ+AZCHJOExXs098uttzq+1BtKy9LZWyY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YY/vLfBhc51ITobvixPEzosGFZa784A+cSoKt0VagK9TzuzD9ijH/KUy9RwyfLCktSYKBaWyLp8R/SdyNyUzW517Y70hgsn+DvNCQUJS7DJKno24g2h+remrQjY2XS13ZYK4Pz5Eu1Z95qbzw3DJI+rHu5v8IUfsba6s7KfcE64= 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=FA5gbIpT; arc=none smtp.client-ip=209.85.210.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="FA5gbIpT" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-748f3d4c7e7so1763728b3a.3 for ; Fri, 20 Jun 2025 11:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750443463; x=1751048263; 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=CMP7Kl6yow8Faa+m4ttvJDoB9/AivqWlJaRr2H7xdgs=; b=FA5gbIpT3eGmw5TCQRoNCphA4HGwPyXSGfUyi3jfnw5gfDmi31+PKgXC6mxizVfwLZ UTg4b/TtHRWSsHUAseVXbxm9uAICxsiKzbgI8aJLDRgd+l3ITvUgO/q6bpCenvhS/TMC 8D6wHZ9fhdMCk1v8XekthBMUafOJ4dCrtDDDNUJcBRw9MXYtVImFrmHOJKG9JkmclmeO ZI3DvFerS0kJEQrpZg78U0Ojy8QVX3YO7mM2lbIy+PD+RpPpDtuA/1843dlmN087L/+w +0FtaMKfv6E29NWqumfzQH0GH9yDpiWrczZfBSEiflH/xgygxeBlxLb833C60huFB9sq BfGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443463; x=1751048263; 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=CMP7Kl6yow8Faa+m4ttvJDoB9/AivqWlJaRr2H7xdgs=; b=M+C3nTctnaugLspXoADWYvkti2M2HT0LCQqykC2O6lkoyGU1cf2rFVygOaxTXgSrZ9 Iesst3Mj8BbCCv74zF6dML/xOO/WIQMEX82jUgAVgnQUIUsyKFlhfiMM89slkRbLeFi6 jCnKDugkyieb7zmcyqwbdgpInb99NWN1jJd+vcfajVi+g0BMAvzxJlyZ/UXbvZeFjnVn OJfsJ+fdAfhBAIykIhMgRw/UrS2Tz8WUDSDdepe50RBVAU2M88FXNrtkYau+GoRYMDVp ot3aB2q2Tn/1T10ohnLFptF/JWhuRS73pc+e6OqFOiKAH/zLGGww/ceQOpCQXw/v6ksK 9WvA== X-Forwarded-Encrypted: i=1; AJvYcCXz+yy7hOfdAtYF6fefGlx5BMe+8kec3IYnFMYzXHCU7+keC96AfksOqaZpUEdg7PglgMstwmaAGN70keM=@vger.kernel.org X-Gm-Message-State: AOJu0YwSV1hyVCgJz46Uq6eSjv4aRTAvz8womde0FdlZAkonOXmY9t5o AHE7EtTj0LJRFMrYNrFNE0ABzzLGry2DrMLQf1dAXkc+RCpjRFStSmKSZ/lGZTCD26Ik7DBwwst sWqY29a8O3G0qLTffw07mCQNBBmPKGw== X-Google-Smtp-Source: AGHT+IGm/vFj5hrKzWy2Z3pEyDUaKOhhI+CR5MlaibQ4Zvsy25uFRQsZYTONpTVOibGjQMqu8859Np1afVaE2rSP3T8= X-Received: from pfbef10.prod.google.com ([2002:a05:6a00:2c8a:b0:749:10a2:4f64]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:2da0:b0:748:6a1f:6d3b with SMTP id d2e1a72fcca58-7490d7b8df9mr5222155b3a.19.1750443463199; Fri, 20 Jun 2025 11:17:43 -0700 (PDT) Date: Fri, 20 Jun 2025 11:17:05 -0700 In-Reply-To: <20250620181719.1399856-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: <20250620181719.1399856-1-willmcvicker@google.com> X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250620181719.1399856-3-willmcvicker@google.com> Subject: [PATCH v4 2/6] clocksource/drivers/exynos_mct: Don't register as a sched_clock on arm64 From: Will McVicker To: Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Saravana Kannan Cc: Will McVicker , Donghoon Yu , Hosung Kim , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Youngmin Nam Acked-by: John Stultz Tested-by: Youngmin Nam 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.50.0.rc2.761.g2dc52ea45b-goog From nobody Thu Oct 9 02:17:45 2025 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.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 A61ED2EBDCA for ; Fri, 20 Jun 2025 18:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443468; cv=none; b=GGRrU9gc4bQEaeoXW/IMI9rGMkydz3ZgVBxDaGOqQkr8zoHgIqT9Zf4U9UuSlXUQrLGIlaHQm/H336LQJJnHS0F7chtmAa7kQeJp1dKqyeE9FiWBUKbrFORHEcbbTuJKcLsCu9t00oNtqt6zmZROXjhCAtPJmuw2UXDBabaJQqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443468; c=relaxed/simple; bh=M0nny4REtUZhhIQOIJ8d/6AAG3bKyfZKLTfcSkQpEvE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XwF5YmGs86dD4nRwgdIrKFPJ35qInCerkC2ce6tXo9L3WhrsSgPgbr5KdQbxv/hmuavMlzyTLksVvJSL1w1IsM28mZP/7fZz67rGxZfnRDaJYJ4LQOLtWRh/IdiqZMkxXYpuB8VN3BmKjgK/+xgGwbTIdrCS+/KzqEWQ+g2Ovgc= 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=lf6cyZD0; arc=none smtp.client-ip=209.85.210.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="lf6cyZD0" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-7489ac848f3so3182102b3a.1 for ; Fri, 20 Jun 2025 11:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750443466; x=1751048266; 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=j/s7oEmyKauEAHgwht1yQk0tIZg1WwzoDzyegW5BYz4=; b=lf6cyZD01do3iImW+w/Mv5+NkOOiVtHVxayLg3nZeEYOMzySTdRPXFoA2NAYMtx8W8 gSa11UviQu8c8O6RtHoys5x6/ATPTDVsLBSaM4yt7SDJNeBC6BD1YLXNImVJftpNFWc6 Q63VzrI6Qh42kcYhPKuxKvqsjojKrtQCheGQLfdQJxHNQ3EM6/3qI3w2mNjYnoLFIjPW +G0iTqnLata2PfwdE4KVgw7K/b9TSne946zw5gkUo4A4DJrCECIJ7PqBJ1xL9aCnlIVW h2FqRrLHKILTG1AP5b5j1wRCJRh3uwyE41Lk4xZUry2X88xaE6dH1jvarRHeS6mNcmX5 2bHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443466; x=1751048266; 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=j/s7oEmyKauEAHgwht1yQk0tIZg1WwzoDzyegW5BYz4=; b=U8cRVdG59OdbWq1ANX4f2ARHzE5lhPOB15qv6rc+kvYVTZ3cY6jdURAgr9rTCb/Yef /pLI8eSr7jpemQ9wxN7fseWwbaUp9z0w8+vVbM/gPAiC91SQADLTk1eHTVBeL3ODBYn+ M2lLysxsnS7CxSWcHACKqJSA640Or0ACsE1KGoCK28yEdRVGtAQl4QhSSIxEez6DXiMa AqUXquewAMSfzOzvmfi3sP3Vn6s1ZwscJzYzl4nkzynULOVw5uhLldV0MZEDONlOJbgN 3rdtHlUo9ttT6tejHnMx79Vi/XQyfTjLjlLOi+EDKwTT596Dta1q2o0mwgM3yWrNDPji 6ffA== X-Forwarded-Encrypted: i=1; AJvYcCW6tkDbAi3LTfrZOYmTbCb52jz8igeqQpOCwM1AL/9E+bNO/qcBw9lD78RdwyFiLoN8e0kNeQyY06wFfes=@vger.kernel.org X-Gm-Message-State: AOJu0YwMhsg85kSmT0VOCGQLB5KNwBVaZg8o55Xrsb6gr3NzIY4Zu0b3 9WtOOTUKTUMlqVEbgcnckxbqd/Ta/JbproOkMC58xHqfUCc+blgane4I5Km5e+GtRnLVPQC9+ur ukF5S8rZC1hMMT44SJlDWOfzkr4F1aw== X-Google-Smtp-Source: AGHT+IHoiuIPOX5cQFNIBafAR41PjPYk18rc3/O/j6tqRVu5p45znC4S855hKfUC4szgUQ9hnGaEGhg3C2WZ1qgdT6c= X-Received: from pfrb30.prod.google.com ([2002:aa7:8ede:0:b0:748:d81f:a79e]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:7702:b0:220:658:855 with SMTP id adf61e73a8af0-22026d72b49mr5784487637.13.1750443466155; Fri, 20 Jun 2025 11:17:46 -0700 (PDT) Date: Fri, 20 Jun 2025 11:17:06 -0700 In-Reply-To: <20250620181719.1399856-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: <20250620181719.1399856-1-willmcvicker@google.com> X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250620181719.1399856-4-willmcvicker@google.com> Subject: [PATCH v4 3/6] clocksource/drivers/exynos_mct: Set local timer interrupts as percpu From: Will McVicker To: Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Saravana Kannan Cc: Will McVicker , Donghoon Yu , Hosung Kim , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , linux-samsung-soc@vger.kernel.org, devicetree@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. 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 Signed-off-by: Will McVicker --- drivers/clocksource/exynos_mct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_= mct.c index 96361d5dc57d..a5ef7d64b1c2 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -596,7 +596,8 @@ 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 | + IRQF_PERCPU, pcpu_mevt->name, pcpu_mevt)) { pr_err("exynos-mct: cannot register IRQ (cpu%d)\n", cpu); --=20 2.50.0.rc2.761.g2dc52ea45b-goog From nobody Thu Oct 9 02:17:45 2025 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.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 A1F602ECD34 for ; Fri, 20 Jun 2025 18:17:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443471; cv=none; b=TXHZooTdmhodxetjf4oPvhijJBb+qGhRldYYmZz+vBSvCApdpAGfpJKnaJjG5IQIwoGqFUPTsOIvq43MqfJeegtZ2yLOLUrRRoU3hVwhdlj7NQdPU1mi+jIF5WxxovFRjJ3sDL/7hlhM6zXOhV/dNHP79B1bBaYwNGzjanibTKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443471; c=relaxed/simple; bh=qdxcwdOlQ3EdsQcn5czc5e/96PPBxIfgnyOOP8Kx86M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=iU3VUBIzercopWlVBtimZO3sa/B3WtA7KYJVMxxCd2dm+d5fgFcMZ62cJFnst0Mc6xhxSuMIN9Gd8VUZpp5gyOe6Fy8C/cCGBalzMlsIvuoJEn9oKx56MC4l0xSNe0ex+hyKaHPMK5AG+kYdYjULp4lyP0UmlqNB88moJQGfVWE= 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=yjTuIaNq; arc=none smtp.client-ip=209.85.215.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="yjTuIaNq" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-b0e0c573531so1418608a12.3 for ; Fri, 20 Jun 2025 11:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750443469; x=1751048269; 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=KucomvysAjkq7Mc20S0WzT2rldg2A7wys58v4bjZBcg=; b=yjTuIaNqXautQ/wHGc8RJ8CQ1oUw61wmO4b9F2Q8Q0E+DhQ1LDgTMG/N3Ye0JYkpXQ bDjMHulvLr1LrFioiP8ZS3DEaEsBJ5lrNbvG3KIFDYbwC09j64zDun8RLf9U0PH2B1iT O/+5ejXOwvKb6yR30AM/hvlYxsNWbv7Ft2NfKa/jDIknBsEyhTlDDM6QB8YrHxmakRVG Wfq7tJ7T3cB9tAefTWmwUvrET8BkJvm6t4PRVpDLVEWqulZM+mBytBOWmyu6N2THUNCK dFMyCWWvW+36SmXZZgD1C6kVqJsgRFGCU568XKN2pbFZg7iE3N/Kc1RpOovoWiNr3odm NmnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443469; x=1751048269; 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=KucomvysAjkq7Mc20S0WzT2rldg2A7wys58v4bjZBcg=; b=q0MH+UwvlhdDOJtn7Ctr/7taG1rJB+/W3T/q07ZjgRCtnf7u/oChc5ns/2I6l3+EWw uFDpHfwKb8MCPSBwgilBZthbF81FsLgCjMcmZqvkvr8Ssz/PwT0kpsMnXdrGHGdKhEFl 8a+AZf5jyTPryr7BqtwLs1RPclgW0G/G0ZGOOzEbP9bILUQlZca0k40w8SjblIqN1fWd 9Auxzc+EWB7+Z/HnImWt0fmCd6sIDd+5J5s/GVRdMnzV2P0Ae6aM5QWuZZLiQqe1xOMW 49vTnHOITVOOB+WAlp1y8wJpOwmWhzyp6Egz/4N6NTPpLjSKKvLcgS8Q4Z3diZ6/OTFJ yB7w== X-Forwarded-Encrypted: i=1; AJvYcCVy4r5IkR6hwXZGHhSh7U5ZdnCVz3Qz9GTzdcYnRECnGcGIt0MbyepaxXxdzegXGvLUqy8RyLSDzQh6E0I=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5ewxwRs69dUZeoiAH7pqvxTCfrYhpUTgI7RiUYuXW21ptnr4j wwZi/Fnvk/QbKYySkiw0/MS1b/9frBHy9tTHWgd9x/ofwCyP3vJHQeRxoetKo1NmUhdUqZZFA3K eTe7C5MMR6gOu/uF8Q3Bnoq+CZYZ8Ww== X-Google-Smtp-Source: AGHT+IHpdvlqIvd5OPMBnBWNmW/55tcTKxbpdQaDGPMx3/p+0hFPHDCPkEbjUA750R9QqBN1jh56itwHNkqhRDPQ52g= X-Received: from pge20.prod.google.com ([2002:a05:6a02:2d14:b0:b2f:637a:a7d0]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:9f8b:b0:1f5:7ea8:a791 with SMTP id adf61e73a8af0-22026c30688mr5635494637.10.1750443468893; Fri, 20 Jun 2025 11:17:48 -0700 (PDT) Date: Fri, 20 Jun 2025 11:17:07 -0700 In-Reply-To: <20250620181719.1399856-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: <20250620181719.1399856-1-willmcvicker@google.com> X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250620181719.1399856-5-willmcvicker@google.com> Subject: [PATCH v4 4/6] clocksource/drivers/exynos_mct: Fix uninitialized irq name warning From: Will McVicker To: Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Saravana Kannan Cc: Will McVicker , Donghoon Yu , Hosung Kim , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , linux-samsung-soc@vger.kernel.org, devicetree@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 --- 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 a5ef7d64b1c2..62febeb4e1de 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.50.0.rc2.761.g2dc52ea45b-goog From nobody Thu Oct 9 02:17:45 2025 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.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 867282ED149 for ; Fri, 20 Jun 2025 18:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443474; cv=none; b=AkSDDYL0GbjzOI96LgS1tKom69YvOko1Y1dertGjvOTb5YbGm7xHeZqa1VC1TYIS8x5g0wZY5jOZnC2EIzPcgULe2q4UkVmd2KyqMDUl8qXqtHG0bzDtBHcDVbM6iaRlPAuMhHCzpRhLxQQl2kT06wEyGO1T1OrR52UWh/0/+Jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443474; c=relaxed/simple; bh=T/EqHStdzh8UFb34W8fcy5u18Dotea7TgFACUbOw974=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=A9lZcxklM14+jCwYPmpVyqyJLtP/e4wusL5SqI082B76ulDQIPz+aZ83TWvsprRQnHLVeWiwLfzi+guxG/ytwJ1BNMMgLrSLMBCH0QnFls5Eg1JqwHSkYcojB0d0G2XBU/lFc+eKH8j2r8VlV30uXOgoSqGHBVp2v03SYifYDoM= 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=Y8Hc605X; arc=none smtp.client-ip=209.85.210.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="Y8Hc605X" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-74834bc5d37so3269000b3a.0 for ; Fri, 20 Jun 2025 11:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750443472; x=1751048272; 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=gIL6fhkHdPNft8maVBpSOO544g+cE+WjCmwBaVe/EH4=; b=Y8Hc605XVCn3BaJsMEQu2SKODL6Q8rbpxf5rbkF8lhBJ/cGC0vIDnE+8EJQNwxEJkW 669WuCmSsu7jKC3vNdEP6dDi3m81DYVYoli4Wl+e0zB+61hq1pYc54TSS+DYWyEfdmMA SNf4vAmB5fPisIpeLyEJ9zCuB3jAGiM5DnFONM7ETwk8zi0wl2tqFj6KmM7v5JZjuzGy sbn3435QBbcvU/2e1rkcKd2prxiQkzy/uM0CJ4AX+kW3Y2+MDvnZ0yAAzROGB4C1iScj xJuvf+FzsJnlbeBFoijpVqJo9ecqQzn8yoJdB6YSQUmyuNl5VEZMNSwCClcM76nCVZMb ksZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443472; x=1751048272; 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=gIL6fhkHdPNft8maVBpSOO544g+cE+WjCmwBaVe/EH4=; b=H/OvR/exnLXQeoHHvdeM2W6lKUlOnO5+7kLTIVvu40cSRT3ozzIuRz8yAzc58uAab8 etyH4KzIhYRmSFOCaD2yPIElkN66UGDGKxrQQWDsrX7R/3w0Ilq549FTTXMCiv1W8jpS Vt4FAIpaUFTW8nbbDKMrNxLuEBGgZVBSRCLgPN18xtH8+TBOfxdgbJ6MRAWh6sEUDVHO Qe+fqfYsMjP3fpmd+/H59a3HzaUVZyRHSKdlKy7i9lO03Ndo0lKU9pRgEfJRiJ8Hxbwx OIeDW/B3tb8qmy7xSqm5hR+mpcWaQwUmBwCGaO+GZvqt6LAzNiIXBCHhRuhu4sX2Ils0 QVfw== X-Forwarded-Encrypted: i=1; AJvYcCU0YMlTBs5Bc7141Akb/exaIxzRor/IusE+fAZDy3Gi7PwvOa+jrkeg9osgVUx/V41ENXAa5kcV5bT23pA=@vger.kernel.org X-Gm-Message-State: AOJu0YxdXzfcq+PqcJ9Ce4ihFDBleZau758OVNEPvKIGQez9b1FfJ6Oi Rd3tChAI+bMjqupqWIaWOrh3wmeXmzWG/3Y651tCp601uiWDn/FKN1IDW9vL2pna99GKBu9oHGH be87wUytFmRdJyAziNaRnRkoGv3SDLA== X-Google-Smtp-Source: AGHT+IHhcpS8jQBHaCeQUGg91BpHtXl20Xrh3qifc5fqLmdTGkugLkpf6jc5U6PsrNzkrlwp5dWtop0DbjdaRfbq1xg= X-Received: from pfwy15.prod.google.com ([2002:a05:6a00:1c8f:b0:739:8cd6:c16c]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:b40b:b0:215:da29:149f with SMTP id adf61e73a8af0-22026e95593mr6335474637.25.1750443471998; Fri, 20 Jun 2025 11:17:51 -0700 (PDT) Date: Fri, 20 Jun 2025 11:17:08 -0700 In-Reply-To: <20250620181719.1399856-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: <20250620181719.1399856-1-willmcvicker@google.com> X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250620181719.1399856-6-willmcvicker@google.com> Subject: [PATCH v4 5/6] clocksource/drivers/exynos_mct: Add module support From: Will McVicker To: Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Saravana Kannan Cc: Will McVicker , Donghoon Yu , Hosung Kim , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , linux-samsung-soc@vger.kernel.org, devicetree@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 [original commit from https://android.googlesource.com/kernel/gs/+/8a52a828= 8ec7d88ff78f0b37480dbb0e9c65bbfd] Reviewed-by: Youngmin Nam Tested-by: Youngmin Nam Signed-off-by: Will McVicker --- drivers/clocksource/Kconfig | 3 +- drivers/clocksource/exynos_mct.c | 51 ++++++++++++++++++++++++++------ 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 645f517a1ac2..d657c8ddc96b 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 62febeb4e1de..5075ebe052a7 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) @@ -652,7 +657,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}; @@ -700,15 +705,43 @@ 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); } -TIMER_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init_spi); -TIMER_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init_ppi); + +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, + }, +}; +module_platform_driver(exynos4_mct_driver); + +MODULE_DESCRIPTION("Exynos Multi Core Timer Driver"); +MODULE_LICENSE("GPL"); --=20 2.50.0.rc2.761.g2dc52ea45b-goog From nobody Thu Oct 9 02:17:45 2025 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.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 BEBE12EAB6A for ; Fri, 20 Jun 2025 18:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443477; cv=none; b=bGMD9cYXCizveLqIiOsZpdmoYFJgF6bYRKScq873OetFWWubDVfJYyHWzIkRkJ9pou6p6/zdwWN+rGeR9doRCbaLgE/N4bZuFb6K/lgPCNxW2Mmn+jGTBqS3P6AzXB5RuDib4Q05CHrk/glwahp3z6HZbsW+XR3WuQ0taV6Wp0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750443477; c=relaxed/simple; bh=FXb5Ooh1SoKLFB+GF1YDuF7hepy8ALKLUWQZf6h1mvk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tVORXoATKcRbmepcOeysLAV8v7Q1zY10UeXR7RdDKx+gzyyF7ZNZdkrCbBkfOFPMDOPWe3tCiAORuV9GEXFoEEJON3YUivCnSPHFw+HppyEkuSOSDs2AKpi6V3o0Vz+F+jC+zB8Ubgy2ZldtGR41fcZ4wMsNdMNtILo3LXUIjz8= 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=s+a/oUsk; arc=none smtp.client-ip=209.85.215.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="s+a/oUsk" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-b31814efd1cso1373507a12.3 for ; Fri, 20 Jun 2025 11:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750443475; x=1751048275; 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=qsGE8lw3KH/D0SLaONE7VxsA+KaDyJNSSOZHiKLjPmQ=; b=s+a/oUskKmcHuRT2SSVKgz62vOwzlPIDfpB2UmecpycwElDkDzMHteeJ7S/IPoihGS HYsbDLMELB4M2PSQyLSY+joLpN8OlXQ5RRw9+GZGvseZr4jXVEDXt5aXgc+wDoxygoO7 KxZUmmCAM2exo89e2d4g1DF77yiGQw4g2ZaIS0vCiLaazsGaP/qDU9k7ajMa1NhTAcgq JrDSd7/VwjfyF2zqKMWK+rLUz+hW+MvoHZkLZPlGUBg8jk2Bnj0yd4XKKUCXaTpSHgP4 m7e8CMSj5K0gghN0QcA1BQfqBfd+gh0VHXJPPJO0LdMIQf8XXDzhH4JOzJxgZObQ8pIH 1NbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750443475; x=1751048275; 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=qsGE8lw3KH/D0SLaONE7VxsA+KaDyJNSSOZHiKLjPmQ=; b=iMjLXbRFImK6xHYqiPRK7bAEADJGV8wiKxKKd/w+xbo7Ug9eEBAChhEEIusSnbzLXE w6ZSocyYeHs8ZQo5H5jjH/N9uj+VU7IdKBOC+5GJ1pH4a5egRz6gCnFwp3/3mu4BcWvP ZVp/EytSoBE9ZILsICW68Z4SwSxXUoq2iPgWmdDygGCjGEubKwgAOWRAXg81eRWcyCpL 9EFlS15bsrGWcjXwCw8XUAlM4lT9tVphph3c1bhLWUj+XduBpPqJbp31gnH/vsy23Jq8 1MiDmtb1ZHd8S1463g2SUo+2H/TfOkMpD03Otg1L/RSqmyVv5kaMsJBW/1D8kMsBJgz4 7QVw== X-Forwarded-Encrypted: i=1; AJvYcCUhQ5rKj+tWle868tgw9nsm1s497FLdPA/uI96EyYdiOMX4ALL+ao8bRvpjphemPRL37IoXj6Fv67PaozQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwnxGZqL69x3NtiDT0F/Eec1c16OI8AvecEl5iOfahEUYlUw9H7 /ZrF4yY1h8nG6+kFB3EgRWcaTxqFvhY611JbebdhzUdi6EN4Kt1AWPvfmVdcY72HGvaqhDfV7Ko 3yOAzSH8Vq0XGnP/8TRs6opyqE1ZrJQ== X-Google-Smtp-Source: AGHT+IHypcBEXCfetti6ZSKrWADvOCJp2Q3YDfRe9x9eHf0/IU91QwPfM1r/wCQjgAiUHhCtBoksoPLTGqQX3VT8HmY= X-Received: from pfiv28.prod.google.com ([2002:aa7:99dc:0:b0:746:2ceb:2ec0]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7f8a:b0:220:eef:e8f0 with SMTP id adf61e73a8af0-22026e479cdmr6696633637.23.1750443475053; Fri, 20 Jun 2025 11:17:55 -0700 (PDT) Date: Fri, 20 Jun 2025 11:17:09 -0700 In-Reply-To: <20250620181719.1399856-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: <20250620181719.1399856-1-willmcvicker@google.com> X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250620181719.1399856-7-willmcvicker@google.com> Subject: [PATCH v4 6/6] arm64: exynos: Drop select CLKSRC_EXYNOS_MCT From: Will McVicker To: Catalin Marinas , Will Deacon , Daniel Lezcano , Thomas Gleixner , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Saravana Kannan Cc: Will McVicker , Donghoon Yu , Hosung Kim , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Stultz , Youngmin Nam , Peter Griffin , Tudor Ambarus , "=?UTF-8?q?Andr=C3=A9=20Draszik?=" , Conor Dooley , linux-samsung-soc@vger.kernel.org, devicetree@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 --- arch/arm64/Kconfig.platforms | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index a541bb029aa4..46825b02d099 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -109,7 +109,6 @@ config ARCH_BLAIZE 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.50.0.rc2.761.g2dc52ea45b-goog