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 113FD25FA0E for ; Wed, 18 Jun 2025 21:08:55 +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=1750280937; cv=none; b=Xdx+bZdD/+xwXvAYhRPQQ1r0xYD6lbj/L1tDGYpCXdn2t9zTJ/jQG79onRgTxdkp0yhhApvcMwz6ZYr6Zp/lBr+nVrLRV0R63/Sa4HVgAXVGrWTZXXrOY34dUfiHFfsxZiW/PCk76tQpw3itpKaNbEsojS3nszbRua4EjMDPN08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750280937; c=relaxed/simple; bh=Lz3dQQOzBSazZRbRcgIezuMZcmy9SPEZppaICybM6wA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=P2EQFuf+w4sjFngPwd0aQ/XYVQSXZWB/5Y3cK//1DXeBVIdR8lIERDRFY4s3W2k/jwDmC9J6hdgqy0S+LSk7Ih53k5HieR7OdZptX1FEvhD5gviYlKR9DhZkAuYLZLCQM+5mePF3zq9nQ7PUVuk48RqzwkrRX0ZYQbR0HIPm/SQ= 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=UiY8qWlQ; 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="UiY8qWlQ" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-748f13ef248so57156b3a.3 for ; Wed, 18 Jun 2025 14:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750280935; x=1750885735; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=zRoaCj6hoTPJxaDDV3mKgmJ3Npn8sA7fvAWlw4tbnTU=; b=UiY8qWlQa55CXbzr1vJtppcP2IjK0Ej4DrawxXKmZifsVOD4CljKo7VWqHNwl33BK1 tl2S2VZuJb6k27gV/FVMf9crmqWfQ0fEuC6tjbYR52xA90HeIVoa584085hClHbDBDLs RWuXw5xL9iT30rHZKTPuyLLDrUA8hbUYSIQVsgcyAl/k0jeJGW6tp8KVdgCAF7oqmlv7 rIR8/+HERWYC+66XmCGyKo+84Mj5IMPlSrn7YoE4wkfxpRxUoHv7xT8T2vLwkztaxxnN CUYQtCmJ/qQOB1zha1+4z1aPtJz1AdRdJmqumOZJQ/bKinW1e1E43rnpopaLksKldBPz 6+gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750280935; x=1750885735; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zRoaCj6hoTPJxaDDV3mKgmJ3Npn8sA7fvAWlw4tbnTU=; b=jfE5NOHHB+dkXLWyQ7xyVl9HoyiGoKAwRnmLbCGwGQJfgeSWJBcRggn6SP2xGddlJa HvR7pR/y3k3oXyXgQjJPRr1Sa7G4zAunHU74c/NlOw1fyBqkaNSgfCblNlInhjffRmCm 5KcuRSuir3DbWCbTlK3M3h2Q/tNF6ZAml6ndWgwd3bNxINL1QWXSAjH8BxJUvL87qixs Yy4DEcqdCQ72gEFNLzxGTg7RvH00ot1JB53KQY/mPJF7u4VljK/Eggom4HM/QxFS7QKh 6JiXxz0HMTfdYEdJT+oHDDPnbvsyj67f7aAGSPUs4N3VkxtvBgMbMj/y0gAcJjpH2gF5 +cgA== X-Forwarded-Encrypted: i=1; AJvYcCVMSyh/s2/2ASDI80ImWP+hP7ZAYhQtGJpmTn1yq/x3FCtwMvZDIbU0hhKxjaF9MDoo4HecivmFcD20@vger.kernel.org X-Gm-Message-State: AOJu0Yz/OxvBpPO2ijiMOHT/AmRzeJt0SVCJ0YvPDv0pUc8oGUljQ2L9 /nJJVQoXWFzd/LZGjo2WKFpP1JnWWM8C5mZe7io4rgZEpPqgZlsMWhiG75kHkb95+FJSfi5BHEH 6YRks+MdpHHxwizXbo9iixb17XuUTkA== X-Google-Smtp-Source: AGHT+IHM4S67QrX8m1RQpKcEdli21K1Bw8q46eAiayWAixmfo6GxjxzG/TdPG1taUNLCEpzBbx7ZQPCg2BlL67kHZ7s= X-Received: from pfkq15.prod.google.com ([2002:a05:6a00:84f:b0:748:55b9:ffbe]) (user=willmcvicker job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3d10:b0:740:aa31:fe66 with SMTP id d2e1a72fcca58-7489ce0d39fmr24849663b3a.4.1750280935227; Wed, 18 Jun 2025 14:08:55 -0700 (PDT) Date: Wed, 18 Jun 2025 14:08:37 -0700 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.50.0.rc2.761.g2dc52ea45b-goog Message-ID: <20250618210851.661527-1-willmcvicker@google.com> Subject: [PATCH v3 0/6] Add module support for Arm64 Exynos MCT driver 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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This series adds support to build the Arm64 Exynos MCT driver as a module. This is only possible on Arm64 SoCs since they can use the Arm architected timer as the clocksource. Once the Exynos MCT module is loaded and the device probes, the MCT is used as the wakeup source for the arch_timer to ensure the device can wakeup from the "c2" idle state. These patches are originally from the downstream Pixel 6 (gs101) kernel found at [1] and have been adapted for upstream. Not only has the Exynos MC= T driver been shipping as a module in the field with Android, but I've also tested this series with the upstream kernel on my Pixel 6 Pro. In addition, I verified that the Exynos MCT module cannot be unloaded on my Pixel 6. This is due to /sys/module/exynos_mct/refcnt > 0. So if you try, you'll get this: root@google-gs:~# rmmod exynos_mct rmmod: ERROR: Module exynos_mct is in use root@google-gs:~# cat /sys/module/exynos_mct/refcnt 9 Thanks, Will Note1, instructions to build and flash a Pixel 6 device with the upstream kernel can be found at [2]. Note2, this series is based off of krzk/for-next commit a15edf91668b ("Merg= e branch 'next/dt64' into for-next") with [3] on top. [1] https://android.googlesource.com/kernel/gs/+log/refs/heads/android-gs-r= aviole-5.10-android12-d1 [2] https://git.codelinaro.org/linaro/googlelt/pixelscripts/-/blob/clo/main= /README.md?ref_type=3Dheads [3] https://lore.kernel.org/linux-arm-kernel/20250602151853.1942521-1-danie= l.lezcano@linaro.org/ Cc: Alim Akhtar Cc: Daniel Lezcano Cc: Donghoon Yu Cc: Hosung Kim Cc: kernel-team@android.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Rob Herring Cc: Saravana Kannan Cc: John Stultz Cc: Thomas Gleixner Cc: Youngmin Nam Cc: Peter Griffin Cc: Tudor Ambarus Cc: Andr=C3=A9 Draszik Cc: Will Deacon Cc: Conor Dooley Cc: Krzysztof Kozlowski Cc: linux-samsung-soc@vger.kernel.org --- Changes in v3: - Rebased on top of Daniel's timer modularization prep series [3] and krzk/for-next commit a15edf91668b ("Merge branch 'next/dt64' into for-next") - Added owner references to Exynos MCT clocksource and clockevent objects. - Dropped #ifdef MODULE conditional section in favor of just using module_platform_driver() which will properly handle setting up the of_device_id table based on if the driver is built-in or a module. - Update commit message for patch 2 based on John's feedback. - Dropped DT change from v2 as it was picked up by Krzysztof for CPU Idle. Changes in v2: - Re-worked patch v1 5 based on Rob Herring's review to use the compatible data for retrieving the mct_init function pointer. - Updated the Kconfig logic to disallow building the Exynos MCT driver as a module for ARM32 configurations based on Krzysztof Kozlowski's findings= . - Added comments and clarified commit messages in patches 1 and 2 based on reviews from John Stultz and Youngmin Nam. - Fixed an issue found during testing that resulted in the device getting stuck on boot. This is included in v2 as patch 5. - Collected *-by tags - Rebased to the latest linux-next/master. --- Donghoon Yu (1): clocksource/drivers/exynos_mct: Add module support Hosung Kim (1): clocksource/drivers/exynos_mct: Set local timer interrupts as percpu Will McVicker (4): of/irq: Export of_irq_count for modules clocksource/drivers/exynos_mct: Don't register as a sched_clock on arm64 clocksource/drivers/exynos_mct: Fix uninitialized irq name warning arm64: exynos: Drop select CLKSRC_EXYNOS_MCT arch/arm64/Kconfig.platforms | 1 - drivers/clocksource/Kconfig | 3 +- drivers/clocksource/exynos_mct.c | 75 ++++++++++++++++++++++++++------ drivers/of/irq.c | 1 + 4 files changed, 64 insertions(+), 16 deletions(-) --=20 2.50.0.rc2.761.g2dc52ea45b-goog