Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2761858rwi; Tue, 1 Nov 2022 11:23:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7obY6Wz7tRrJAZ7hVHsFzQxJ0o+tdYDZ148xpY55N3WMfWHBCy54DhWLAICkQexM0EbS+x X-Received: by 2002:a05:6a00:1a8a:b0:56c:c538:f926 with SMTP id e10-20020a056a001a8a00b0056cc538f926mr21387793pfv.70.1667326981528; Tue, 01 Nov 2022 11:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667326981; cv=none; d=google.com; s=arc-20160816; b=uyM6UXGnxi6FMhbOYSNJLu63x6/iJ3LzsIufLNdGqrCzUIxPMt1l7+JP0fQ8IH743p /784aTffQ4s4K7RE7Qw7dji7+Rd5T/60avyb02wY+H5x58iBTSRjsWOzanZUi9nNFxtE igU+UFe2JUYJsKEJrbEuaf/PYaH/CuMU2cwHUKaXZ4b+FP5bMgJ1EBPAIeRs0+qIyy/3 KX5+yj4LZHa3zodcdTlCGU7Wnryh2IlxEOlYB56H4gxbrOMv5p3s0BpZLLOQN9E5quvQ 82XmkRmzKxMOoMGeJVzKM3qty3N/UTcQzzSaL9pexPUDc+HUFocZ1zMQBApuB0EFB9zn 8QNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xRVJZUTA41GRsnx6RNIIAw6+CIo5Kdzba6KpbDx7Vo8=; b=Kjz5CCRCE9aOobLxWEy62294sxiF8SemGTDliLoyy0fwTXgaTvliCAKpW4H4ekB5EV szm060esfBhr8pxe5Wzt38pdXx8H4ukuGmlkDgwW/wdbfw3O1ZGDpcQEXcM3B+kl9KFx 4V5/sOWoc79IriGAt4JbB87pXc+XEyDz17SXKZGbA7izGmZAhRAwWkLANsX4OdoUJnjO NmI+3A6UnWm3IS0gW4Ro8lSJbqzKIc0zSPIiLMkGQc6nxa5k/szhjPCrvzxvuTZkYo4Q ZB8K3xW6rkszcYe14CbscFucfIDaMxyk0GonOVuTiNBeEbdC9PQKkVEbexVK10QtYmmg aljQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=zL6q+tNE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020a170903110600b00182bccf6195si16410909plh.596.2022.11.01.11.22.47; Tue, 01 Nov 2022 11:23:01 -0700 (PDT) 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=@marcan.st header.s=default header.b=zL6q+tNE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbiKASRc (ORCPT + 98 others); Tue, 1 Nov 2022 14:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbiKASR3 (ORCPT ); Tue, 1 Nov 2022 14:17:29 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 064A810548; Tue, 1 Nov 2022 11:17:26 -0700 (PDT) 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 90F894267F; Tue, 1 Nov 2022 18:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1667326644; bh=GJ6UagwrNwG/uy6EayoDIRM68iGK+xdSGDUz3nYaQYk=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=zL6q+tNEyi5i/2DUXyv6d24t0f5qiyTKF5Oyf7Zy6rigRBpX7SEPw6hEZwy7xg7Zl 1IM4ww4DszMY8f0McbZqzDAnwG6/J8eMNfLfWGZW702nTigM6q5w2cR8YN/xVp0x/l Ybi6RNCHP3YadSkYjDe5nvu8Gt5fkaS40rPfkU8wZMjBcUVZZzobfnSsIAGm+jFcvE +M6ZptTWWuJtYaSGMtURzQPCZ4WPNEikroi1LWyJ1HE1QnMtD19PcNViH5naCsCMgn jeSzUbZ8gEF8b7gcurOGoyVhxcsTUqcBKMMo3BjpO5n3AaKEMj1ffglaHIFIqzgiij yHxuxbK5p17Dw== Message-ID: Date: Wed, 2 Nov 2022 03:17:17 +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: Ulf Hansson Cc: "Rafael J. Wysocki" , Viresh Kumar , Matthias Brugger , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Stephen Boyd , Marc Zyngier , 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> From: Hector Martin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 02/11/2022 00.16, Ulf Hansson wrote: > On Mon, 24 Oct 2022 at 06:40, 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. > > Out of curiosity, may I ask if this implies the need of a > synchronization mechanism on the Linux side? Or is the boost frequency > dynamically managed solely by HW/FW? It's managed by hardware - Linux gets to request whatever frequency it wants, and the hardware will limit it to what is achievable given the current idle states within the cluster (and it will change automatically with them). So if Linux asks for 3.2 GHz but there are no deep idle cores in the cluster, you get 3.0. If there's one deep idle core, you get 3.1 (I think). Three, 3.2. So this driver doesn't have to do anything (and will report the correct current-frequency as long as the per-SoC compatible is matched; without that this feature is disabled and it just reports the requested frequency). We could enable the boost states today just fine, it's just that they would never actually be reached by the hardware. - Hector