From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56A78EBE2 for ; Wed, 9 Nov 2022 15:39:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 3DCE642168; Wed, 9 Nov 2022 15:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1668008384; bh=gJgjxLC/opOKAlINQDBTgDNZach6gSpta5DKFmngup8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=CmCwGacg9CAujTmTiX66T5ZSZrMGmPq6cHme5VJziOjIbzRSaFIYVsEUeJQ4ItNZz ceXH6ASwFIObAsxUoznwh5XU61Spy5rRSUiOL0T3xcH5dvRBxqrx3CJbkQHhlI9y97 H1mR+j60e5BhTkA7Zd8lvsPcxmvJMzwpQx07Cv0oJGhqJ//qtBEwxpaBCLmKChAGQl Lrr/aVNOgIvJfXcIdOwXalemsgd7efGgSD7gR+X+i0DiIXizjkmsgnhbKg5+j2/zo+ t47I9oVLpz4HP8P2KYKNExZGwIBIIMfK0P6y9kzSXMkxWkkR0AJ3RoMhx3JT6i/bK1 bZX+UmkCZeG3A== Message-ID: Date: Thu, 10 Nov 2022 00:39:37 +0900 Precedence: bulk X-Mailing-List: asahi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3 4/5] cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states Content-Language: en-US To: Marc Zyngier 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 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> <86v8nop5ts.wl-maz@kernel.org> From: Hector Martin In-Reply-To: <86v8nop5ts.wl-maz@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09/11/2022 23.20, Marc Zyngier wrote: > 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... > Good point, done :) - Hector 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 21D9BC4332F for ; Wed, 9 Nov 2022 15:41:15 +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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L9qgBH44TlJPsdU6GGlLHF15Fvak1hHvxYj8T/DWX+Q=; b=QyQqYI5qRWWYpk 2Fw3GlP+ocN6mEDF6BVR4GnVwdCrvf1pehh5IuKoQmKJp/vF1FrfZ+EzUMeVJxdV6APj/vXe6TZwt BIPXX0bHyY1CCQ+nzRHvzZGbMkewQN3rSAS8116JDBkpM/4NDzRmfFct8Fs5a2EZKqTlRIFhYIg3p UsoT/bJVdnRoTlV8cLGeXTVPFEf1vc833s1pY7U4y+bJN6k6dn1n+8EoRPBj6lsd5/JQk5gp8oSO2 CwIaaiz6gDJyE5U0KSprW6mQ+qW9a1fDdHiQ7SRnUQgPKw6UY09pc6M6HTYXI9xWTlWyHprJ3pB3K RPaAViPlNlMCzm9e+J+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osnBB-00Eg4l-Vo; Wed, 09 Nov 2022 15:39:54 +0000 Received: from marcansoft.com ([212.63.210.85] helo=mail.marcansoft.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osnB8-00Eg14-GH for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 15:39:52 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 3DCE642168; Wed, 9 Nov 2022 15:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1668008384; bh=gJgjxLC/opOKAlINQDBTgDNZach6gSpta5DKFmngup8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=CmCwGacg9CAujTmTiX66T5ZSZrMGmPq6cHme5VJziOjIbzRSaFIYVsEUeJQ4ItNZz ceXH6ASwFIObAsxUoznwh5XU61Spy5rRSUiOL0T3xcH5dvRBxqrx3CJbkQHhlI9y97 H1mR+j60e5BhTkA7Zd8lvsPcxmvJMzwpQx07Cv0oJGhqJ//qtBEwxpaBCLmKChAGQl Lrr/aVNOgIvJfXcIdOwXalemsgd7efGgSD7gR+X+i0DiIXizjkmsgnhbKg5+j2/zo+ t47I9oVLpz4HP8P2KYKNExZGwIBIIMfK0P6y9kzSXMkxWkkR0AJ3RoMhx3JT6i/bK1 bZX+UmkCZeG3A== Message-ID: Date: Thu, 10 Nov 2022 00:39:37 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3 4/5] cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states Content-Language: en-US To: Marc Zyngier 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 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> <86v8nop5ts.wl-maz@kernel.org> From: Hector Martin In-Reply-To: <86v8nop5ts.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221109_073950_913068_0B69C122 X-CRM114-Status: GOOD ( 15.47 ) 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 09/11/2022 23.20, Marc Zyngier wrote: > 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... > Good point, done :) - Hector _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel