From patchwork Mon Mar 31 23:00:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will McVicker X-Patchwork-Id: 14034198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2267C3600C for ; Mon, 31 Mar 2025 23:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2A1KKKyyzdpcSVMQiU3dhTgCCmATcVgptXdxBkHBo5A=; b=Lsxjt1xyd4YpwX7vSaZbTCNba/ ImoHNiNvqIvHtJvCwhpEKVBCbAWHEsXSwFV1abSNBUCgvNC/PdoFpo2cyoMPOA82YSOaGChbaFoN/ fIl5lYe9kHM1pi3F34ksHpZg0DY8py9MtJv+vje52eXmmDCFRUZE/JgikCD+43hsLNAvOL68SU6Nj 7OL29tmhHh3NtPjtWuS3/ADpNiV1ewCTGeiIYBAW6RcmepTQ5Cx1PUenLLPSGfrmV/CXYKqftQDTw /57DkncZd3diju60TqJlHMLGBiBnxdlMQ/fD02DXX/VzH9kTIESBXJDU/cHPwhR1OppMdOxc3uyDE kgpLakbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzOB5-00000001Z8c-2WYJ; Mon, 31 Mar 2025 23:04:23 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzO7Z-00000001YXD-21gc for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2025 23:00:46 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2ff6aaa18e8so8572300a91.1 for ; Mon, 31 Mar 2025 16:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743462044; x=1744066844; darn=lists.infradead.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=2A1KKKyyzdpcSVMQiU3dhTgCCmATcVgptXdxBkHBo5A=; b=c0mxnzQjuF71WSrb7OHh9f/Hf3aq9K8M8cg6fz4FbZ9n5b9fa2/Y/beLxlF9imDSmw mYTjfohpoY8hlFgbJRy+af6AhIoGuKDF+MOOGOVZD7uHKYYEw4wXHaN0/wRlDB/el4rl pNWc0fVUovd49GW7LNLwdvsx847sJhfEE+o6kHmjTL70X87svXGsAoN1bpo57bMXyJEv wF2eMGdPMMYGtrsTctN8p18Bq1Wpp9rat+8DVxFgJjhGSWoQsIXH3z7ISC4VpHjU69kw Iu4VjnwGPIBlE2Wn9H4QEsiojhqjRDnSuA51Mn9+fZtbKcK0NYzqamnz2dYZe0iupukj kI/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462044; x=1744066844; 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=2A1KKKyyzdpcSVMQiU3dhTgCCmATcVgptXdxBkHBo5A=; b=GW3n1n0Aa5zr/+kcIV2DC6L7flEfVf09TNnkF8S8IvNrTtyg+hWfPo6/vIvQRUIFxB PtG1W8sAm0CtnMftIz5DqAc2+FpcZUUi+rYb5/4Q/OSmm0ZijkYSzN4vD/jrvIbgo95z h7T0g2KOqZ/Bvh0+CEybVaLT3x6WDh6plPyDv2DPiEgkC+HLrIEKlpt6jlt/WJLMEiXC HmdztTnA67zSk+DfijfZKif8Ir4eRwpJpKsaXMQE6yFzRgy8/MDamCc75YSlKw1vEawH JPamyfc9oI7Z0dFx2ULSS4DYXiXEDB8v8iTaBLzIpdOiX+/Up1pFWtCeew2Y1l+2jmkk o6fw== X-Forwarded-Encrypted: i=1; AJvYcCXFPcXFvJ14bHGhHPxxuV3fIkMdxY25KHu1u6s1Mw1JTqKO/kjXtUPcLr8+MYOY3vWurx03Ss+sHWVetgUPs6st@lists.infradead.org X-Gm-Message-State: AOJu0Yx0rWzyQV8YpsuJX5sBYt/wVcmZQ4caSyAOp1FlMHwKPnIcSMD2 awOBPeS22/6ACePuK+JxbLJXF8CllUnst2QKHwhhmirmGKx/Z0lypTKz41d6CImtjC1yPKpxPR6 Eu6k0cMZqsr4w9baMTe1FANFQ7Q== X-Google-Smtp-Source: AGHT+IG/ebJE2gKC/wqWBycsTxmqQFxHKcT+hLYLzDS5AFcHBpCYSXiF3vCmtkgKMTAKak4Gunic/DECRCqZWeNK0w8= X-Received: from pjbso14.prod.google.com ([2002:a17:90b:1f8e:b0:2ff:84e6:b2bd]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:e187:b0:2fe:a8b1:7d8 with SMTP id 98e67ed59e1d1-30560949dc0mr1232407a91.25.1743462044603; Mon, 31 Mar 2025 16:00:44 -0700 (PDT) Date: Mon, 31 Mar 2025 16:00:23 -0700 In-Reply-To: <20250331230034.806124-1-willmcvicker@google.com> Mime-Version: 1.0 References: <20250331230034.806124-1-willmcvicker@google.com> X-Mailer: git-send-email 2.49.0.472.ge94155a9ec-goog Message-ID: <20250331230034.806124-2-willmcvicker@google.com> Subject: [PATCH v1 1/6] of/irq: Export of_irq_count for modules From: Will McVicker To: Catalin Marinas , Will Deacon , Peter Griffin , " =?utf-8?q?Andr=C3=A9_Draszik?= " , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Daniel Lezcano , Thomas Gleixner , Saravana Kannan Cc: Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250331_160045_520433_D40407A2 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Need to export `of_irq_count` in preparation for modularizing the Exynos MCT driver which uses this API for setting up the timer IRQs. Signed-off-by: Will McVicker Acked-by: Rob Herring (Arm) --- 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) return nr; } +EXPORT_SYMBOL_GPL(of_irq_count); /** * of_irq_to_resource_table - Fill in resource table with node's IRQ info From patchwork Mon Mar 31 23:00:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will McVicker X-Patchwork-Id: 14034199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2AE3C3600C for ; Mon, 31 Mar 2025 23:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rNxanwBhZtQZDwmjxM/W4Nk49HxAQJthjw2/nXfZ67g=; b=v8rauvchUCNrr4gT00W/ZOhOll b4nY3fzi9pPQXKnX/6u0I3rV9YYrh0yk2pgzGxfPqUSBeo7E5d1K7JaxdetMG+FOBFHfu/4UeSTNc Xsy55LcfDtt1/g0E+QdfN5ONUYQF9CEyBm0wJ6zONqrPAhv5S0YRZJx7fwIwgRJYaktmNl/voYI9r vY3jy+ur70Yva430eCE5CXEliRDuKTLHKAnANoLC3FWLTEA/fwIwCDU/qIrUplaLMmbLanUuYZgki bMQqzxNJJ1f8U1S4KsRsM116SYgeJjg7FbQOceHpoJST8lxCfLZT6XVlvCSTFjx2/x6PqFIi5hCfV uf/kmfow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzOCp-00000001ZJR-1G3Y; Mon, 31 Mar 2025 23:06:11 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzO7b-00000001YXg-43Fr for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2025 23:00:49 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2ff68033070so8146908a91.2 for ; Mon, 31 Mar 2025 16:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743462047; x=1744066847; darn=lists.infradead.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=rNxanwBhZtQZDwmjxM/W4Nk49HxAQJthjw2/nXfZ67g=; b=vZITrzkpbrPzT8tdTEQHlaysNFZLh94cAXq14BqDIPPZYbfAyN+6ysah/g6tTZpPQw /iiiGQcfwsKTP1PheC7C0cZFWybUk8hMe+KVdTMdJMfBvOnpdnmO7Dm9aRLpeQmclyCe nE81BbO5BWSZDPnjQ1H/oluqp54oAskAYMn8+4qZDlkkmFHL6zHjdWHgpBQQradXz7Ns Tn7CGNjCXiZHKrri6fcCu9GMZVolY/k8LzT8dYIM3YitYxUeLw/uE3qXyLLMOaG+hKjP 6Noh4u11UvLCUtGuq8izctRn77jGM5y1QL+DMcoYvMMd8XVLmTI4ZcqAJ5BOm5v+uTBC rkOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462047; x=1744066847; 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=rNxanwBhZtQZDwmjxM/W4Nk49HxAQJthjw2/nXfZ67g=; b=JcG6ZHrwfsLKFUtuuyy/D/ad27U5yCahCFPzMsaIGwFBEG/CooDSy5PbX2ftcVXlpI pxpWpKuXoUH8G4KyD/xANvRXq8z6MduvNMLQJDIAYmhF/5QoJr/07WZW5cddpX4vugOB 8e8VLhiYD5KUpe/cHbMKPVvKflhrY1xtVaNroA6yV0P2qWJDwPc+XP0KsGqxS83QN7eX f/kVI/BXj/IJQRcU0z0O3Tdm4jnme7vx0+XUlpnKhnPbI+/dkvhkftolbeM/ba6fndCU 7QEzA3J+aVH4MHAW4+AFOafKRbpj96vuHACpRby5tM9gpMfDtXq3N7q/uCg6tDieNnEM W3sg== X-Forwarded-Encrypted: i=1; AJvYcCWhg1tF8MKhBel/RMxeSXQusyBEVP609wGqzmCucklr2IQuFYEkwxr9dNUNtXr66IdR3YFnWngQbQmyPbn43ALR@lists.infradead.org X-Gm-Message-State: AOJu0YxK5NABJdu9wLJiGYj3sH2XHsSUqb+YlywqyJuGbMMmKd6ad4Xa A3OhjZfCgTcUZ+sZpPjAkWPcChS2O6Ag+IgG8OUJIZRT7sQ0DywV9A+LqDJKM2+T9sFLGudWe5J CiI6C3ilXjJVlc3iWW7bLq4MTow== X-Google-Smtp-Source: AGHT+IGJF8B4sxZb6LHBqCORBrMjWxFGFtbVo3ixsesEJYQP3zIzMH571Rnw1V4KCZ3ejHSwrtmuRTWbQo8qDLDw2/U= X-Received: from pjbqi8.prod.google.com ([2002:a17:90b:2748:b0:301:2a0f:b03d]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3bc8:b0:305:2d68:8d91 with SMTP id 98e67ed59e1d1-3056094bca9mr1574788a91.28.1743462046748; Mon, 31 Mar 2025 16:00:46 -0700 (PDT) Date: Mon, 31 Mar 2025 16:00:24 -0700 In-Reply-To: <20250331230034.806124-1-willmcvicker@google.com> Mime-Version: 1.0 References: <20250331230034.806124-1-willmcvicker@google.com> X-Mailer: git-send-email 2.49.0.472.ge94155a9ec-goog Message-ID: <20250331230034.806124-3-willmcvicker@google.com> Subject: [PATCH v1 2/6] clocksource/drivers/exynos_mct: Don't register as a sched_clock on arm64 From: Will McVicker To: Catalin Marinas , Will Deacon , Peter Griffin , " =?utf-8?q?Andr=C3=A9_Draszik?= " , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Daniel Lezcano , Thomas Gleixner , Saravana Kannan , Krzysztof Kozlowski Cc: Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Donghoon Yu , Youngmin Nam X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250331_160048_004431_B4DFCEAB X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When using the Exynos MCT as a sched_clock, accessing the timer value via the MCT register is extremely slow. To improve performance on Arm64 SoCs, use the Arm architected timer instead for timekeeping. Note, ARM32 SoCs don't have an architectured timer and therefore will continue to use the MCT timer. Detailed discussion on this topic can be found at [1]. [1] https://lore.kernel.org/all/1400188079-21832-1-git-send-email-chirantan@chromium.org/ Signed-off-by: Donghoon Yu Signed-off-by: Youngmin Nam [Original commit from https://android.googlesource.com/kernel/gs/+/630817f7080e92c5e0216095ff52f6eb8dd00727 Signed-off-by: Will McVicker Reviewed-by:: Youngmin Nam --- drivers/clocksource/exynos_mct.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index da09f467a6bb..05c50f2f7a7e 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -219,12 +219,12 @@ static struct clocksource mct_frc = { .resume = exynos4_frc_resume, }; +#if defined(CONFIG_ARM) static u64 notrace exynos4_read_sched_clock(void) { return exynos4_read_count_32(); } -#if defined(CONFIG_ARM) static struct delay_timer exynos4_delay_timer; static cycles_t exynos4_read_current_timer(void) @@ -250,12 +250,13 @@ static int __init exynos4_clocksource_init(bool frc_shared) exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer; exynos4_delay_timer.freq = clk_rate; register_current_timer_delay(&exynos4_delay_timer); + + sched_clock_register(exynos4_read_sched_clock, 32, clk_rate); #endif if (clocksource_register_hz(&mct_frc, clk_rate)) panic("%s: can't register clocksource\n", mct_frc.name); - sched_clock_register(exynos4_read_sched_clock, 32, clk_rate); return 0; } From patchwork Mon Mar 31 23:00:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will McVicker X-Patchwork-Id: 14034200 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5D28C3600C for ; Mon, 31 Mar 2025 23:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eYIAFf/wPB1FgKJfqKNRuXGM4xXRDDSYrMtDo5kebno=; b=NIklHEdpQmTB5THK1nPoierlzP c+g8kMigRG6aNZC+2h5C0SxSx5jisCmdexJtO8OWFw/KG8TsHEebTXHBBgIMwZYuO3hVsWUV/4Uwd pBjTPpxHC8FwLs5UFw2qeuf4rVQExC7h4Smv0T5RBPofzpGRvq/DDSIfcQ0DUkSBJWuOxoMO+Ml+I eYArPpwbnijfi7elmfFmRgT1mKVnhKnNUYPzLSimH/0niec9mRnBNFAAv+oIa63eqkJ7rb4Vs3zOh eHiK/LIWJ+P2v60Dsqpwts/Kz2vkgaAoOlk5KmgXREvr/AOve67sgn4738V4d9TRsbdZI03+3+17B BvWAJKKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzOEa-00000001ZRC-01TB; Mon, 31 Mar 2025 23:08:00 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzO7e-00000001YY0-0Nd1 for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2025 23:00:51 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-3054210ce06so6572560a91.2 for ; Mon, 31 Mar 2025 16:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743462049; x=1744066849; darn=lists.infradead.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=eYIAFf/wPB1FgKJfqKNRuXGM4xXRDDSYrMtDo5kebno=; b=ZHegdCYtpvg+GE/Isif9+fdygDwg6wW7IaWDDIqTD+pE0GhgKzxft96UlT6oqGc8xH KPwG7ZTF2PE2WSv6g7aO+wRj5keIW/NHKhJ7DuURtqlFlYuCCeiptBCYrtp5sMG34PSu 9tmqjR7ZmehxFKx2FpNwk0zs3yYaOj2Y1cOFRQtDnkIsL90Kyddfv4zB1peMLh1aTZh4 d7gkf/GBheOjb+dcij/SbnxdjWaZQJxZnifMw2s8xNDP4Smq7aVLHdtm0PWbror82iVn xfkOvL6OITKk1gpg7799qWRyt/zYD/13HQfn8i9BTf4N+uv3oeoGDYdmCU2MHtw+VcaF Nwqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462049; x=1744066849; 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=eYIAFf/wPB1FgKJfqKNRuXGM4xXRDDSYrMtDo5kebno=; b=ZLi7C6CWPgmpYWvoI8CEa4phnYPnnLIWhpK3CaSTPbDHS9z4iTMDstSQ+D63GIcLsi qGUyD0olsqOXOWKPGIhEGj3i2441a63Td4IbCxAWHS6qv2vQuKjIGCN7ktWYFwaJe+Nw IzTizgI0gSaGQu6Kb7GBQDPqLzCp4LfvdlNxodD1Lv2XXuC+ktFur2xDXuxT5b8g0OFT FWAzgXNPMSugsMq0kqzfdyA2KPpmHzlCwZYVA0q5IrqX3LAs8VppdZTblpnB3vzLPhB/ 65V3VvyJGj0rCR+ourByKtZobRfXKoFCYCG6lXi0qQ9LsojAj77WMFC6IYcnXm9h00pS 5V8w== X-Forwarded-Encrypted: i=1; AJvYcCWcwCs/AXhnkWKA7mNeZ3MFkMhGfNv4OeDj1JO1TuV+t+SWfxfTIJVRJgbr8Xh2uce1uyd6Ov7ND4SLMBt6WYaK@lists.infradead.org X-Gm-Message-State: AOJu0YzoCLmHvgvq/qpJiUN6ORHBdD7UsIoWL+53kJpOmf+pPbq0DDWh aAUKAG3QZfqZpSwt+Oz0alU4wAkLp7lWnLNlbru5LHV4/D4OBYvq9v1FN/naUtdxC7UmQKOcZhU vQe6K3PMsCOTUsiWLgvMYSQ6t8w== X-Google-Smtp-Source: AGHT+IFpiB1mL5vyi3i3SJZAHaJn7lRrJRhzSesvvlRpke5S6KVBbYcslhy5s8ASZECHhLaZs8DNDJw+s18hm0Fszqw= X-Received: from pjcc4.prod.google.com ([2002:a17:90b:5744:b0:2f2:e97a:e77f]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1644:b0:2ff:6aa6:47a3 with SMTP id 98e67ed59e1d1-30532164b69mr14496424a91.25.1743462048717; Mon, 31 Mar 2025 16:00:48 -0700 (PDT) Date: Mon, 31 Mar 2025 16:00:25 -0700 In-Reply-To: <20250331230034.806124-1-willmcvicker@google.com> Mime-Version: 1.0 References: <20250331230034.806124-1-willmcvicker@google.com> X-Mailer: git-send-email 2.49.0.472.ge94155a9ec-goog Message-ID: <20250331230034.806124-4-willmcvicker@google.com> Subject: [PATCH v1 3/6] clocksource/drivers/exynos_mct: Set local timer interrupts as percpu From: Will McVicker To: Catalin Marinas , Will Deacon , Peter Griffin , " =?utf-8?q?Andr=C3=A9_Draszik?= " , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Daniel Lezcano , Thomas Gleixner , Saravana Kannan , Krzysztof Kozlowski Cc: Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Hosung Kim X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250331_160050_129230_49C9CA95 X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Hosung Kim The MCT local timers can be used as a per-cpu event timer. To prevent the timer interrupts from migrating to other CPUs, set the flag IRQF_PERCPU. Signed-off-by: Hosung Kim [Original commit from https://android.googlesource.com/kernel/gs/+/03267fad19f093bac979ca78309483e9eb3a8d16] 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 05c50f2f7a7e..21ded37137d7 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -590,7 +590,8 @@ static int __init exynos4_timer_interrupts(struct device_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); From patchwork Mon Mar 31 23:00:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will McVicker X-Patchwork-Id: 14034204 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E465CC3600C for ; Mon, 31 Mar 2025 23:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5wAloBg1GSJoUoSs1Fe6e5szwOsXLtBgN31oDTUHQ8I=; b=4lHg67G+L+DVlv8d0jAC1bdrBg 8jIaq/rED5XQVrYPRr9lg+5h8wvpw/hIzaoEI/jdSnWuCmF0PmvRbSCDP7RTySeGr4aBHvRSb2zCS 1D0F4AIgm24rt5jOBvp4agcPDcsPe6ssG1+kNQU66rHJwpfnYaG/TKnG4eTDZNS+efuGifx7WsKjB WkTvjJpxdHzDeVgt2twAnuLvPsqrtSXekeNDMWZzfFn/Z6ona7UPr09GbSuC7wQHJCrIZ/osHnU19 kv4PnTKO5As8YkHN9lqjaetDysrFVZqldpMoZGTP0Yoj32d5eowuOb10h7KRNmrGzNDPyHcGgz3J1 sGs2dHfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzOGJ-00000001ZWv-3EZa; Mon, 31 Mar 2025 23:09:47 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzO7g-00000001YYN-0UOs for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2025 23:00:53 +0000 Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-2241ae15dcbso115799135ad.0 for ; Mon, 31 Mar 2025 16:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743462051; x=1744066851; darn=lists.infradead.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=5wAloBg1GSJoUoSs1Fe6e5szwOsXLtBgN31oDTUHQ8I=; b=4ObdL9g5z0qALL2CXUBpRBn8tLB7+SJEM4OZl/td7SM1IDrd2u4C0wxXlWoMuSvMGZ 7uAdcUj5RX9ftlJ1//JY5wR9eX5qN26R+ia/pLu+/rxT0FaQ2Je5XTc3k1O7KgqHj7eV SNOwRFuWfZBtG9fDZHfSobdZ6h5PVsoj/bIRDESBtLZ9MpbqjwjfzzTjwG9EvdziZn2E Nd/yevr7g5sun5awekSPot0rVQFxTYnZJu6h5O/oAFKY4rHN1RXs0oM2GhsR6ZvjJlg5 6/ekmf/pVxeVFl+qg0NHFExJFLi+t6wHjTv99MAWPJA5JSiMWbij6rw3OKIzi8s6estr eRZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462051; x=1744066851; 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=5wAloBg1GSJoUoSs1Fe6e5szwOsXLtBgN31oDTUHQ8I=; b=ReThotJiYc3UloO/8xOp2cvLIXQ05ZH6AnDEis6KU4ORIGdeohXgPXdfiTX0nPrhwU tOIYvz7KCb/mXn5FTFZY0DTmkfQ+jtRVmGOM7jUn7dHO2IL69UIlUsgtXN7icGFtNTag cHFYx53hB2EkFfqBWaXIG/bmXdPyDXglS48MPHcBwDTIYczcdkQWb2vE7SFKwDYW3sCp my5GNILTdM6T9ouL2io70rpbRqExAmrn2UkQE6r6950J2AD+KuvLofn4e4nnkcx/nJJx TwLQBcrXbv16p5k/lbgv5LZpVMldx+Qf4N9+FjXQix915h/0TaOTZXq2r9UI5qqWa7JZ 30lA== X-Forwarded-Encrypted: i=1; AJvYcCV7gAJZxlK515OkCHq98erQT834jQwZtwQowoyyOW22M1dqJLtCm8/A7tjEcefSNj83rVVUCxIK5km+ynDJPXqF@lists.infradead.org X-Gm-Message-State: AOJu0Yx4fHUILSLaBrK+lG2GrUOVLwd4EYD+pIMKG8tp45OkBH7Rhlhx gi5YPy028hqkG8OAy3nkyS4Lo0Yb1LI7FFCaGzVIGDZyKJ2L5/ia5orueUTKbQDrLhw1pZ6jUvD YquOtDgit7jkU/qmC1XtQvrhL+w== X-Google-Smtp-Source: AGHT+IFhkqYe7aFPYhXhB/uXFuJRx2APqvedOXzVTYhLwQ5pf0aEv93uw3ToHTM6Wa3C2QveIbk5Q7eGKFiWITWBEiY= X-Received: from pfbit9.prod.google.com ([2002:a05:6a00:4589:b0:736:5b36:db8f]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4fd3:b0:736:53f2:87bc with SMTP id d2e1a72fcca58-739803994b1mr16712693b3a.13.1743462050772; Mon, 31 Mar 2025 16:00:50 -0700 (PDT) Date: Mon, 31 Mar 2025 16:00:26 -0700 In-Reply-To: <20250331230034.806124-1-willmcvicker@google.com> Mime-Version: 1.0 References: <20250331230034.806124-1-willmcvicker@google.com> X-Mailer: git-send-email 2.49.0.472.ge94155a9ec-goog Message-ID: <20250331230034.806124-5-willmcvicker@google.com> Subject: [PATCH v1 4/6] arm64: dts: exynos: gs101: Add 'local-timer-stop' to cpuidle nodes From: Will McVicker To: Catalin Marinas , Will Deacon , Peter Griffin , " =?utf-8?q?Andr=C3=A9_Draszik?= " , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Daniel Lezcano , Thomas Gleixner , Saravana Kannan Cc: Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250331_160052_155271_5C3CEA2F X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Will Deacon In preparation for switching to the architected timer as the primary clockevents device, mark the cpuidle nodes with the 'local-timer-stop' property to indicate that an alternative clockevents device must be used for waking up from the "c2" idle state. Signed-off-by: Will Deacon [Original commit from https://android.googlesource.com/kernel/gs/+/a896fd98638047989513d05556faebd28a62b27c] Signed-off-by: Will McVicker --- arch/arm64/boot/dts/exynos/google/gs101.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi index 3de3a758f113..fd0badf24e6f 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -155,6 +155,7 @@ ananke_cpu_sleep: cpu-ananke-sleep { idle-state-name = "c2"; compatible = "arm,idle-state"; arm,psci-suspend-param = <0x0010000>; + local-timer-stop; entry-latency-us = <70>; exit-latency-us = <160>; min-residency-us = <2000>; @@ -164,6 +165,7 @@ enyo_cpu_sleep: cpu-enyo-sleep { idle-state-name = "c2"; compatible = "arm,idle-state"; arm,psci-suspend-param = <0x0010000>; + local-timer-stop; entry-latency-us = <150>; exit-latency-us = <190>; min-residency-us = <2500>; @@ -173,6 +175,7 @@ hera_cpu_sleep: cpu-hera-sleep { idle-state-name = "c2"; compatible = "arm,idle-state"; arm,psci-suspend-param = <0x0010000>; + local-timer-stop; entry-latency-us = <235>; exit-latency-us = <220>; min-residency-us = <3500>; From patchwork Mon Mar 31 23:00:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will McVicker X-Patchwork-Id: 14034205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C272CC3600C for ; Mon, 31 Mar 2025 23:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ulmUmxoKn2frrsYltohW0CKthat5ISQxrYAQM4kkNLU=; b=pcxwaxgirfe3YUDiijpxZU383W gK0tneOj1wo0wQUnW2NfwYkGHYFKrnw51UtQ9FInPlKftg5Cs5WamyTSj7AoxImitYHWEdr5tV7JY 7YWZfD6+su11Xhb4xsJcRXGevPpwFooF0FHLPRegsMpqVfr5737V7tPbZnzf22TCbW44m2/0XtEf+ UBafPIDTC0LV6her9j4Xb+ZzEIF/bIGYE0Dd/yIt7kBkjadA2iWVHtqdAzDKR8xEaqojKnSbw9x/0 fmciiKyAwK+rBtoOrM0qnwcrrDOdhQ/gQKWSb2E7yTbi+nKLy9W01hpjourdV3xWufKC45ogHBEFG nwzVQJIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzOI4-00000001Zgr-1mz1; Mon, 31 Mar 2025 23:11:36 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzO7i-00000001YYz-1E0j for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2025 23:00:55 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2ff64898e2aso9527085a91.1 for ; Mon, 31 Mar 2025 16:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743462053; x=1744066853; darn=lists.infradead.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=ulmUmxoKn2frrsYltohW0CKthat5ISQxrYAQM4kkNLU=; b=nRYJUpvt3hxbxPXbQJwZBMtcxVk3OnZvEN9LNTl+7Fnv8BvSgxYsCEOwNwR/bLmlyX f8IrtgY5AEmwpKzb426unzH1oNWrZXWh+POQmvvbwq+MDZfaR11308GX98VmeC1rJa9C k3c+GKym3hXbLlLHGCxpvFjCaQ/DuW92WZjY4DAHnVfBhWZSS7/pPT3x2If8cHYimW3e WHs/nJmE5Erb4OJfsVzDzdsipijZgUDAxl606USRdycjALUYBdV8t57GjXaqj5384Do/ 8+ib/6f6SrNe11tdcGMzu8Yt3szD6A6yLhaMmnFMhflTzWuyPqQ+Vrz2UXgneAWFddRw HncQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462053; x=1744066853; 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=ulmUmxoKn2frrsYltohW0CKthat5ISQxrYAQM4kkNLU=; b=aPI2pgFkgp2h1VPU5gH6gBqYNmSgGqOX5PcTcionG8lLF+iHxLNg3G9/KYD7GiqauF WactuCQTf3Hk37WoWTH5KNvWpTR44K+hZCnYjnYr4GtLAnxisxqJg6WH7zE0Fbx3K1e3 pZzU1D3SabZdo0BLHCAwsDFdCnnj9xHyehlLUFrjBHlrXAiFmTTB+fN9hz0mrqAEbdBl W6e1ccMoUaRiRor1EDiOss+3wD5RTdbJuqfX5RCBk44IQfrePOaQAv6pPTHdn53ZYSJq yeMBZVVr9hsrHxeTMA2LBzLYx9tpaLTPF/vpbwAyNZSeMnqvPhrJfhI+jGaMkoRIJkvk igQQ== X-Forwarded-Encrypted: i=1; AJvYcCVtmIAxq0bCpjyboXvtIzQM4I28YkPl7OBHaP0XeZ80hBY1VCESiWVGCepZLhPxPt1tQELWPbre7Gs81d/Apnll@lists.infradead.org X-Gm-Message-State: AOJu0YzeI06Zj/QmUvTM99TkfZe0w9gvfHWxqH3p7cQ2vZL6HYpRzE2J dlN4AdykXOidO7FH1l92YSLGPDRJs0p6QBr7H0SEKC7FZ885l8H8SpBYGeuS7DJKT2cSlnkIEqV VRv+c8kMSmDnf6X/vvD+zNOoCBw== X-Google-Smtp-Source: AGHT+IE5NyFQYus/tf1QYYAFIfVAMg9yb/cSsm8CoRrwBXhSWC0iBExikv4kLw7OwXIeyQY2hQdq59zsfug5q/X9xxE= X-Received: from pjbsb5.prod.google.com ([2002:a17:90b:50c5:b0:2ff:4ba2:f3a5]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1cc7:b0:2fa:1d9f:c80 with SMTP id 98e67ed59e1d1-3051c9752admr21092256a91.17.1743462053067; Mon, 31 Mar 2025 16:00:53 -0700 (PDT) Date: Mon, 31 Mar 2025 16:00:27 -0700 In-Reply-To: <20250331230034.806124-1-willmcvicker@google.com> Mime-Version: 1.0 References: <20250331230034.806124-1-willmcvicker@google.com> X-Mailer: git-send-email 2.49.0.472.ge94155a9ec-goog Message-ID: <20250331230034.806124-6-willmcvicker@google.com> Subject: [PATCH v1 5/6] clocksource/drivers/exynos_mct: Add module support From: Will McVicker To: Catalin Marinas , Will Deacon , Peter Griffin , " =?utf-8?q?Andr=C3=A9_Draszik?= " , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Daniel Lezcano , Thomas Gleixner , Saravana Kannan , Krzysztof Kozlowski Cc: Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Donghoon Yu , Youngmin Nam X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250331_160054_332121_05AA5083 X-CRM114-Status: GOOD ( 20.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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/+/8a52a8288ec7d88ff78f0b37480dbb0e9c65bbfd] Signed-off-by: Will McVicker --- drivers/clocksource/Kconfig | 3 +- drivers/clocksource/exynos_mct.c | 47 +++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 487c85259967..e5d9d8383607 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -443,7 +443,8 @@ config ATMEL_TCB_CLKSRC Support for Timer Counter Blocks on Atmel SoCs. config CLKSRC_EXYNOS_MCT - bool "Exynos multi core timer driver" if COMPILE_TEST + tristate "Exynos multi core timer driver" + default y if ARCH_EXYNOS 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 21ded37137d7..da4460d8a0ba 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 @@ -235,7 +237,7 @@ static cycles_t exynos4_read_current_timer(void) } #endif -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 @@ -507,7 +509,7 @@ static int exynos4_mct_dying_cpu(unsigned int cpu) return 0; } -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; @@ -535,7 +537,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) @@ -640,7 +642,7 @@ static int __init exynos4_timer_interrupts(struct device_node *np, return err; } -static int __init mct_init_dt(struct device_node *np, unsigned int int_type) +static int mct_init_dt(struct device_node *np, unsigned int int_type) { bool frc_shared = of_property_read_bool(np, "samsung,frc-shared"); u32 local_idx[MCT_NR_LOCAL] = {0}; @@ -688,15 +690,46 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type) return exynos4_clockevent_init(); } - -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); } -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 MODULE +static int exynos4_mct_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + + if (of_machine_is_compatible("samsung,exynos4412-mct")) + return mct_init_ppi(np); + + return mct_init_spi(np); +} + +static const struct of_device_id exynos4_mct_match_table[] = { + { .compatible = "samsung,exynos4210-mct" }, + { .compatible = "samsung,exynos4412-mct" }, + {} +}; +MODULE_DEVICE_TABLE(of, exynos4_mct_match_table); + +static struct platform_driver exynos4_mct_driver = { + .probe = exynos4_mct_probe, + .driver = { + .name = "exynos-mct", + .of_match_table = exynos4_mct_match_table, + }, +}; +module_platform_driver(exynos4_mct_driver); +#else TIMER_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init_spi); TIMER_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init_ppi); +#endif + +MODULE_DESCRIPTION("Exynos Multi Core Timer Driver"); +MODULE_LICENSE("GPL"); From patchwork Mon Mar 31 23:00:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will McVicker X-Patchwork-Id: 14034210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 655E7C3600C for ; Mon, 31 Mar 2025 23:13:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vqQfU5MFNX+M9dMbS6b209zYYBr6gV4W0L8ERj/h45U=; b=i2oRbnxrRX7fcO5v0oLZ0MllCw cejvRoX1EZD4CC5F8A3hag2q28O2ipE9YB0IUjmOtAawRNCpQox7zVgxjMRB8G7rr6UhX0PCxK84p nknp9xNjHtEX66PW6vX4Fw7qeYvWt2Aslw/1Oc8v7rxFJtso/6IA1mqWfMLCAXbCSJJPUkVFktChf HeMeI6btLfi0pGHNgcSSmltPwk+r8gfP4UkQ9ZJHWTqknUhLpDYg35qVVCwZiXnILW3Lg3vb7Rxlz bBcDTt8NVnVpQtYJTH+1GIhE6gnmaiJU1RW5CH7TjZVByn/wlSsDPWa1VFjRG/vcBbpUFJS31C39c h8oiNdXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzOJo-00000001Zq5-0UY3; Mon, 31 Mar 2025 23:13:24 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzO7k-00000001YZe-3VkR for linux-arm-kernel@lists.infradead.org; Mon, 31 Mar 2025 23:00:57 +0000 Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-2ff7cf599beso9012272a91.0 for ; Mon, 31 Mar 2025 16:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743462055; x=1744066855; darn=lists.infradead.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=vqQfU5MFNX+M9dMbS6b209zYYBr6gV4W0L8ERj/h45U=; b=BPEn2z/yXWzn6d/aFH83ciCiUAirrFPuqmhUXlVkw2fwd6MqHjJE3GYUFfUdH6wRkv Zu5A+wLzrBXwH7IdO2NaR34f1gimQAsNf5HsPuobsePP0JnreKyi65RoRT/XPL4soQzp tGmBjS1oPnryjiXbGX6zdvOiCBy5yx13RnpDEBD6nvgmI/+3STGbsZ3Yc0HmodpfSHNF 9GiuvDc/bxyX/QLQ0usjJAfFOdghRiQSQbFI28zZbWXNka9mNfkhJeCZx1YQ+9g+/r7/ dDSk/V+7XeIMJfmGqq9DasMwsX0pGktOyyvGC/eLgKBOzKABYcYkQVhlelQ9UXElDDvE mRDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462055; x=1744066855; 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=vqQfU5MFNX+M9dMbS6b209zYYBr6gV4W0L8ERj/h45U=; b=BUwxmnar9mAZ5TZB7GYb+3PzMWkMxdOWSOpyv0sS1/iLFsZcqFq/NTlWacLlhDDa+N FW9bCQPaJhtHPLGzIu/Y8DlI0lumEv1btb5kpG/KK9AGsc1+H17KFegH0tswJQfx/K5v q2qV4l2pOM8bVpIw25QoB0e5LgUOwWg+tWBUSdRfmlSebon3UGFupE4bn4eGhGiSd6OF H/PNL76m0WEMzakoVapcNDy3Wky+V5BQwD385jDQ9HBs+imgsPZFYZbLBRxx3qvl1gAJ tr/+rUY6vVol3DgywINqaQy8cbYI/9aO8XIj2/fXBfHWmtk1qxqMpX6ddQdlrs4/f8lP dAsg== X-Forwarded-Encrypted: i=1; AJvYcCVgDHmWJnWHwgc2LXejaSMOqLN1wc9L/BRLQaghenoMs+Ffb4AP9V6w7A1fLHP9c1VT1r73vR6KZndwM2JtDfuT@lists.infradead.org X-Gm-Message-State: AOJu0YxtQBm1A+f2WSNEtUO+Mr99KiVKNr1AJ5COrJN2g55iJoINm+nO ICjo3GBe44HMr9XUXhgZ71Umw/cs9VKNxfGkNMKrRSHgfeyQwtLIwDiYUwpDDy3+yf+IZRIvER1 Z55FH2VCNWR52eZeRPZ1EglsgpA== X-Google-Smtp-Source: AGHT+IEx4n4bxYc/YGt82JQ6y5gWLCjA7rtOL1EcSQ5FOyxHXLQUeEqlUnQfPzSQjxNpXS/pD1jk7mi3qLuRMiZ4+F4= X-Received: from pjbmj3.prod.google.com ([2002:a17:90b:3683:b0:305:2d68:2be6]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3c06:b0:2fe:994d:613b with SMTP id 98e67ed59e1d1-3053215a3d8mr16944353a91.35.1743462055036; Mon, 31 Mar 2025 16:00:55 -0700 (PDT) Date: Mon, 31 Mar 2025 16:00:28 -0700 In-Reply-To: <20250331230034.806124-1-willmcvicker@google.com> Mime-Version: 1.0 References: <20250331230034.806124-1-willmcvicker@google.com> X-Mailer: git-send-email 2.49.0.472.ge94155a9ec-goog Message-ID: <20250331230034.806124-7-willmcvicker@google.com> Subject: [PATCH v1 6/6] arm64: exynos: Drop select CLKSRC_EXYNOS_MCT From: Will McVicker To: Catalin Marinas , Will Deacon , Peter Griffin , " =?utf-8?q?Andr=C3=A9_Draszik?= " , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Daniel Lezcano , Thomas Gleixner , Saravana Kannan Cc: Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250331_160056_875629_E82C3DEE X-CRM114-Status: GOOD ( 11.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. 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 8b76821f190f..325279193e2c 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