Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp623160rwb; Wed, 9 Nov 2022 06:53:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf4OqQeJsEppenl7eKhzHyfm2CZ4BKDkqzVPVb82VjiWDrtW+xcCVwTCRvRvlax6fl0s6Bgd X-Received: by 2002:a63:550a:0:b0:470:71e2:132f with SMTP id j10-20020a63550a000000b0047071e2132fmr15056685pgb.614.1668005592711; Wed, 09 Nov 2022 06:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668005592; cv=none; d=google.com; s=arc-20160816; b=t4ngvhyi4hmeK/IvlEoaTbDDEwEf/1qY/UNKV5vcDp07PO33kLEcUoNIfxn8/VpaND Utjho31LenEVJLVLEEGyvnVYBgo3AQA1VA4/Zn58rhoxb+WPBq7RkmVgVg1/q/11Xh4p TDB/Jj0PI3iGfCgt6lygaiMtfIUhoPhzISLvkyCuaqtmF0a1hd1zffyvGdeMhdpmVNEa OBAIsVuXYjLgUkSQ68URYuZzPu1U2MRUU7cbDXaGsNcR6170IHDJwVKRWAKO3jQ3a7Oc Qgsw6vA/izPDEPjJAsJchPnbRbdnSIqkJlM6aDmKPrBxuoGYqDATp4nnKy5/ro8ax357 ZAaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=I24aTbR+MUA7cSzohVmDSJmnaRRaHwQTRnOMyQvMRxQ=; b=QN8Vs++d7VL3GPhvEPHansldgxuOsBR4AOj+f4sMKDp8awI+Cx53EpCAK5fGawhms6 FrF8iaWV8cUTsf5xXYPHHjRz9q5YkZHT0rfDuKasXMRKERAP8pFJDh5/WA8oogy7NLQG fg3NibXb+MvwyCMtnk59iAt6VVtGNTb0QXfAbqTFvzhy/N/85GtE5RDZJRYeEGUYPP/P 0UCEDttXZkoSZN7Ina+Mkq4bo4olLiYzP5tgzuKvVnt1mpd6SLWa/dAX0XnLKkKwSZ9e bDT1az8gun2zxGlUnn7orIZ6BlJZ5PPaN49ixoSY+dQVXpPi55cWr0Q0J2KlrOqt9N9x O7Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=at9a6f9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a17090ac20500b00214064c6c55si1371507pjt.50.2022.11.09.06.52.59; Wed, 09 Nov 2022 06:53:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=at9a6f9v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbiKIOW6 (ORCPT + 92 others); Wed, 9 Nov 2022 09:22:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbiKIOWl (ORCPT ); Wed, 9 Nov 2022 09:22:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B976227FD0; Wed, 9 Nov 2022 06:20:53 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 64E6FB81F0C; Wed, 9 Nov 2022 14:20:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F16AFC433D6; Wed, 9 Nov 2022 14:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668003651; bh=R0d+e4AdJ2Po6pEtyX7eL5IfvQAUQy4DjsaeX0GaoDY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=at9a6f9v122U0kVYFxgGtwpdg96Pc2vJZm4v4xb0dEbLL8IiwKzAx26pGIzPVC2UX NDxi56Imv4Hy6IaBRLmzWLrZxOkkjjPZH8LnUwMVdOBox+/FxAoc+Y2/NvLRy7Tc3G EDimLtiyEEomjqy5nBCqvFRa/MmWCTVlumFQeC0/u3aw44SlR9CZmJckulKXYFt6Rs vLF5NOBvDABZT6tRAtjGKear1eURDWKg7mE4goFIfiOQRy7U+cKFEf/GCtC1I3vQjT I/G6WLS3C9J+y5YWKFQxSzbQWZjC6dkuXMjLmK16H2W53IAJghZxknrykpr+Eqh3ag xtovpcX77veVw== 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 1oslwe-004vkC-MP; Wed, 09 Nov 2022 14:20:48 +0000 Date: Wed, 09 Nov 2022 14:20:47 +0000 Message-ID: <86v8nop5ts.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 4/5] cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states In-Reply-To: <3d4536c9-4b3b-8312-4868-5e5b42a87424@marcan.st> References: <20221024043925.25379-1-marcan@marcan.st> <20221024043925.25379-5-marcan@marcan.st> <8635bdocco.wl-maz@kernel.org> <3d4536c9-4b3b-8312-4868-5e5b42a87424@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") Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 09 Nov 2022 12:13:33 +0000, Hector Martin wrote: > > On 24/10/2022 17.27, Marc Zyngier wrote: > > On Mon, 24 Oct 2022 05:39:24 +0100, > > Hector Martin wrote: > >> > >> This driver implements CPU frequency scaling for Apple Silicon SoCs, > >> including M1 (t8103), M1 Max/Pro/Ultra (t600x), and M2 (t8112). > >> > >> Each CPU cluster has its own register set, and frequency management is > >> fully automated by the hardware; the driver only has to write one > >> register. There is boost frequency support, but the hardware will only > >> allow their use if only a subset of cores in a cluster are in > >> non-deep-idle. Since we don't support deep idle yet, these frequencies > >> are not achievable, but the driver supports them. They will remain > >> disabled in the device tree until deep idle is implemented, to avoid > >> confusing users. > >> > >> This driver does not yet implement the memory controller performance > >> state tuning that usually accompanies higher CPU p-states. This will be > >> done in a future patch. > >> > >> Signed-off-by: Hector Martin > >> --- > >> drivers/cpufreq/Kconfig.arm | 9 + > >> drivers/cpufreq/Makefile | 1 + > >> drivers/cpufreq/apple-soc-cpufreq.c | 352 +++++++++++++++++++++++++++ > >> drivers/cpufreq/cpufreq-dt-platdev.c | 2 + > >> 4 files changed, 364 insertions(+) > >> create mode 100644 drivers/cpufreq/apple-soc-cpufreq.c > >> > > > > [...] > > > >> +static struct freq_attr *apple_soc_cpufreq_hw_attr[] = { > >> + &cpufreq_freq_attr_scaling_available_freqs, > >> + NULL, > >> + NULL, > > > > nit: extra NULL? > > That slot gets filled in later if boost is enabled, hence the need for > an extra terminating NULL in that case. Right. Consider placing a comment next to the first NULL so that someone else doesn't consider it useless and accidentally removes it... M. -- Without deviation from the norm, progress is not possible.