From patchwork Fri Aug 25 11:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13365464 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38818C7EE2C for ; Fri, 25 Aug 2023 11:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242054AbjHYL10 (ORCPT ); Fri, 25 Aug 2023 07:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242294AbjHYL06 (ORCPT ); Fri, 25 Aug 2023 07:26:58 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57F722102 for ; Fri, 25 Aug 2023 04:26:54 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5009969be25so1244367e87.3 for ; Fri, 25 Aug 2023 04:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692962812; x=1693567612; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fBY/HtUs9K9shLxFz87/yhgWybEcdjCy9Ovc6VbYJDM=; b=mO8BvDUU1/immKzeAsfPPrAA491wEj/9AIdCzi62+OFRBSSsvECRTHqmGuK0KhGAy0 zwCARHJgAxUcbQkRTeKoM7d7nClDP75436sEQoxl4HwtzLyTrBgj6sGseJv9lG2gyWw6 hQSBuZ/FUOBUV8f55HO5SbcW4YxGHj+nUPRfSqDOSASVsT3XfRwhGqTvfVDBV0g7p2b+ i2m3erXWZS3R1dEkQI0AdrhbiruzPxQNw/txgyht2ORflP39Tnd0I8CPBLDThwjRTb+k s8G/E3xocw6dm8BU7+qVTFCeeShdjq36psItS4gLJvcL1TZJdzS6VURHNbfVZlwfaV58 +9dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692962812; x=1693567612; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fBY/HtUs9K9shLxFz87/yhgWybEcdjCy9Ovc6VbYJDM=; b=BdvBcNhMYExSdK4ffz2LzCQrEesFdcPNsMZ0tqtV1w3pWp0p3aL7DkLKVJp/MszUKp dSKWQ7ogTk568APU3Tdwtfc9XvvjP0CAxUYhg60D6zWMt1Tt7SkmI/A0Jv5sHG5OnmL2 32C2YBlFg8DsPhPkdBEKsSZkBAmD9R52Mus/t1zQAOnGTqAb7KpfCKmmU0849rZ4vGqr SQNZCcIV+AUPWzECSCVKghdrNc0LkB8TUxsrwFCmzJl50wF1vYQqrl8pMg61WxizOk/5 BecuKKxi9ZfSO98ayni12sxWXbxgkZN6gBDcP6ykoDOQBfPa9PTOMth0PFeMlwG6cIcq mPqQ== X-Gm-Message-State: AOJu0YxL4KtbOFmQssp4POh9vAlZTczIRdWXu3mBXezBZcChHhOLnkhE xwKDVsXihd6KMoYFCBz/C/3CVw== X-Google-Smtp-Source: AGHT+IGGJdkUEbzPSl8I64Rn0u5xOF5sgGb4L+rFAZnxKgpB/IhJ0oB2oEC1OpMXYM9Cz/aMQ88c3w== X-Received: by 2002:a05:6512:32cc:b0:4ff:7e1e:b4b4 with SMTP id f12-20020a05651232cc00b004ff7e1eb4b4mr14760796lfg.39.1692962812488; Fri, 25 Aug 2023 04:26:52 -0700 (PDT) Received: from uffe-tuxpro14.. (h-94-254-63-18.NA.cust.bahnhof.se. [94.254.63.18]) by smtp.gmail.com with ESMTPSA id g7-20020ac25387000000b004fb7ac67bbdsm259164lfh.41.2023.08.25.04.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 04:26:52 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Cristian Marussi , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Nikunj Kela , Prasad Sodagudi , Alexandre Torgue , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 00/13] arm_scmi/cpufreq: Add generic performance scaling support Date: Fri, 25 Aug 2023 13:26:20 +0200 Message-Id: <20230825112633.236607-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Changes in v3: - Re-based upon the for-next/scmi/updates branch. - Re-ordered some of the patches in the series, to eas review. - Added some new DT doc patches in the series, according to comments. - Fixed other comments, see version history for each patch. Changes in v2: - Split up the series, to get the basic support in place as the first step. The part that remains is the integration with the OPP library, to allow consumer drivers to change performance level using the OPP lib. - Re-based on top v6.5-rc1. - Other changes will be described for each patch. The current SCMI performance scaling support is limited to cpufreq. This series extends the support, so it can be used for all kind of devices and not only for CPUs. The changes are spread over a couple of different subsystems, although the changes that affects the other subsystems than the arm_scmi directory are mostly smaller, except for last patch which is in the new genpd directory. The series is based upon the for-next/scmi/updates branch, but to enable the genpd provider in patch 13 (the actual scmi performance domain driver) to be placed in the new genpd directory, I have also merged an immutable branch [1], which is queued for v6.6. Note that, I am runing this on the Qemu virt platform with Optee running an SCMI server. If you want some more details about my test setup, I can share this with you, just let me know. Looking forward to your feedback! Kind regards Ulf Hansson [1] git.kernel.org/pub/scm/linux/kernel/git/people/ulf.hansson/linux-pm.git genpd_create_dir Ulf Hansson (13): firmware: arm_scmi: Extend perf protocol ops to get number of domains firmware: arm_scmi: Extend perf protocol ops to get information of a domain cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq firmware: arm_scmi: Align perf ops to use domain-id as in-parameter firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus() cpufreq: scmi: Drop redundant ifdef in scmi_cpufreq_probe() dt-bindings: arm: cpus: Add a power-domain-name for a performance-domain dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13 dt-bindings: power: Clarify performance capabilities of power-domains cpufreq: scmi: Add support to parse domain-id using #power-domain-cells PM: domains: Allow genpd providers to manage OPP tables directly by its FW genpd: arm: Add the SCMI performance domain .../devicetree/bindings/arm/cpus.yaml | 4 +- .../bindings/firmware/arm,scmi.yaml | 11 +- .../bindings/power/power-domain.yaml | 17 +- MAINTAINERS | 1 + drivers/base/power/domain.c | 11 +- drivers/cpufreq/scmi-cpufreq.c | 55 +++++-- drivers/firmware/arm_scmi/Kconfig | 12 ++ drivers/firmware/arm_scmi/perf.c | 90 +++++------ drivers/genpd/Makefile | 1 + drivers/genpd/arm/Makefile | 3 + drivers/genpd/arm/scmi_perf_domain.c | 150 ++++++++++++++++++ include/linux/pm_domain.h | 5 + include/linux/scmi_protocol.h | 18 ++- 13 files changed, 293 insertions(+), 85 deletions(-) create mode 100644 drivers/genpd/arm/Makefile create mode 100644 drivers/genpd/arm/scmi_perf_domain.c