From mboxrd@z Thu Jan 1 00:00:00 1970 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 F16DAECDFA1 for ; Mon, 24 Oct 2022 08:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YAhkHwmpVHe8QC6p5uVvuXK2prI7nmwP3lFLHiBHY4Q=; b=R0DnidZmNCqvQ7 w08v2mbmlR1ythsr3b6IMJ+8f/kWxiS06Bg+Il9Se+m5PrUmaOqqRDhtgR40BzZb3xVqfNg9SoUPw +8hu5dLHNVqkHudiebSp52Iw1THqa4L/NvDlYNKfw04joUVWXX3bxkUvWltb8wcyXAyANtvVI3SIm jhf3ZFQanCA9MGHHrxoeqlBq3oZhANkQEDxK+5ttk2YMjx4aMgZNFvptbom3l12ATLXUVV0aUaTwk XTJxJMMiOLEbwNNnEl2QLitjrUppDFewDc8geJOtmZf1j4i+KtAtZ5/htBB10Iv8cRsh0WfilgJv3 C/18b7yXgFknVMus+LtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1omsuW-0008kt-28; Mon, 24 Oct 2022 08:34:18 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1omspK-00066y-SI for linux-arm-kernel@lists.infradead.org; Mon, 24 Oct 2022 08:28:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2042060B47; Mon, 24 Oct 2022 08:28:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7928AC433D6; Mon, 24 Oct 2022 08:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666600133; bh=uC7mKT8uDqXXd0XO6Nf+G9XWZ6e3itlzM+GC1HHhwag=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dcH5Ozu/tQLQGNGU98OnUJBu9h8Ei6xr0Op9knsWMQvUB0j08FvS2ucjeD/ciG27W 0PUi6CnyMjfgji7ySgaoqEkfah2qZQOPcXal7gn0E7w+iNL2MyZsGBMXGRp2D1UIA+ GjVI0gkXe/ntofPeJqdZDeCKQUQFU4HeUzDhND5Je/I516gjwBN92jzglcamxHSwZS PoYbh5m/WTlPxfvoHNEcbF6prff8q4XhdjbwxbaGgVGokjWVgLGtRM2YDErg2tW+ST 1cgbJHYWZcnjCUTLr8V35gzjHELlDDVadmCev84JrPiCjwm+HkY4FReDY8viTny20D 195z2HoM3+zpw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1omspH-00165X-99; Mon, 24 Oct 2022 09:28:51 +0100 Date: Mon, 24 Oct 2022 09:28:50 +0100 Message-ID: <861qqxocal.wl-maz@kernel.org> From: Marc Zyngier To: Hector Martin Cc: "Rafael J. Wysocki" , Viresh Kumar , Matthias Brugger , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Stephen Boyd , Ulf Hansson , Mark Kettenis , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/5] Apple SoC cpufreq driver In-Reply-To: <20221024043925.25379-1-marcan@marcan.st> References: <20221024043925.25379-1-marcan@marcan.st> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: marcan@marcan.st, rafael@kernel.org, viresh.kumar@linaro.org, matthias.bgg@gmail.com, sven@svenpeter.dev, alyssa@rosenzweig.io, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sboyd@kernel.org, ulf.hansson@linaro.org, mark.kettenis@xs4all.nl, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221024_012855_031442_8768BD08 X-CRM114-Status: GOOD ( 33.49 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 24 Oct 2022 05:39:20 +0100, Hector Martin wrote: > > Hi folks, > > Third time's the charm? Here's v3 of the cpufreq driver for Apple SoCs. > This version takes a page from both v1 and v2, keeping the dedicated > cpufreq style (instead of pretending to be a clock controller) but using > dedicated DT nodes for each cluster, which accurately represents the > hardware. In particular, this makes supporting t6002 (M1 Ultra) a lot > more reasonable on the DT side. > > This version also switches to the standard performance-domains binding, > so we don't need any more vendor-specific properties. In order to > support this, I had to make the performance-domains parsing code more > generic. This required a minor change to the only consumer > (mediatek-cpufreq-hw). > > The Linux driver probes based on platform compatible, and then attempts > to locate the cluster nodes by following the performance-domains links > from CPU nodes (this will then fail for any incompatible nodes, e.g. if > a future SoC needs a new compatible and can't fall back). This approach > was suggested by robh as the right way to handle the impedance mismatch > between the hardware, which has separate controllers per cluster, and > the Linux model where there can only be one CPUFreq driver instance. > > Functionality-wise, there are no significant changes from v2. The only > notable difference is support for t8112 (M2). This works largely the > same as the other SoCs, but they ran out of bits in the current PState > register, so that needs a SoC-specific quirk. Since that register is > not used by macOS (it was discovered experimentally) and is not critical > for functionality (it just allows accurately reporting the current > frequency to userspace, given boost clock limitations), I've decided to > only use it when a SoC-specific compatible is present. The default > fallback code will simply report the requested frequency as actual. > I expect this will work for future SoCs. > > As usual, MAINTAINERS and DT changes are split. I expect patches #2~#4 > to go through the cpufreq tree, and we'll take care of #1 and #5 via > the asahi-soc tree. > > Hector Martin (5): > MAINTAINERS: Add entries for Apple SoC cpufreq driver > dt-bindings: cpufreq: apple,soc-cpufreq: Add binding for Apple SoC > cpufreq > cpufreq: Generalize of_perf_domain_get_sharing_cpumask phandle format > cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states > arm64: dts: apple: Add CPU topology & cpufreq nodes for t8103 > > .../cpufreq/apple,cluster-cpufreq.yaml | 119 ++++++ > MAINTAINERS | 2 + > arch/arm64/boot/dts/apple/t8103.dtsi | 206 +++++++++- > drivers/cpufreq/Kconfig.arm | 9 + > drivers/cpufreq/Makefile | 1 + > drivers/cpufreq/apple-soc-cpufreq.c | 352 ++++++++++++++++++ > drivers/cpufreq/cpufreq-dt-platdev.c | 2 + > drivers/cpufreq/mediatek-cpufreq-hw.c | 14 +- > include/linux/cpufreq.h | 28 +- > 9 files changed, 706 insertions(+), 27 deletions(-) > create mode 100644 Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml > create mode 100644 drivers/cpufreq/apple-soc-cpufreq.c FWIW, and for the whole series: Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel