From patchwork Mon Jul 4 12:07:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12905179 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 92B51C43334 for ; Mon, 4 Jul 2022 12:09:26 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xaM+7nD9fZbhR3N9o6kzAUu0f7FLr/2ksC448N5m7jQ=; b=p+OfXriAd+HYqF w1dUOnZBY1bU1b9cEuwF9Idk6dCIxWhMc/P798ZFRlN6E/obsXzLDjCBR0KG2BI7ZPjajuh2ODvoW siL848LIVoym9Z1nBGgLhXRjSY0/JD21p/9Ys3fCASUH3Xf/CbO4OaumJ5RuiAEwPz0F7waq8Xd0a 2p5q3g8eObrAhFl0noQVgvBGolSTZCIZo5nkyMe4cEM10WZYZVfpraJeOe9vNH//2ZNjbPfn6H1IS q/fuXcIbX5sFj2o1SYlvX88lQq4AYJmNJxWLd0jiMXCY9aE7FBUjzpuAdxb9fuJBCE4MYTKcSvC/W myk5x0hHdwrNbC70jyXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8KsB-008ZGc-Hr; Mon, 04 Jul 2022 12:08:15 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8Ks7-008YoC-Uh for linux-arm-kernel@lists.infradead.org; Mon, 04 Jul 2022 12:08:13 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d5so8369287plo.12 for ; Mon, 04 Jul 2022 05:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oRPwtSfaZ4lK+/Kwqo3hIoWwSAaNNETI/B4QeMlq4K0=; b=vJ8/VNDeZy+E+GejBNM7BapmNbdbn8iOiAYLS8BzvfKFvpk6CdR/Mnagao/Gw0H7jf LnQLiFNEht81PcZFPHiWhIaSCu70QDfOqAa6+yId1JCV4HSO1Unw3VcKXpVFK7l+uLAa 6tgC/XrPbB61OdJR18NqwpzOUGI4obFkG6Jsi69ZcVRV/RfsUIhvkkLWPN3KU8aReJTi AFIjCf42RSzRiBRGfKs+tzI9gBb1Ye1L96wXhT1ElmU6pn/qgv75K8/crdjKUUfOX3J/ noZLYEmHwmI1jmH5mN0RcBuHTxCbA/TegDWRR6awCiMU/3dx7+ZyEYVwegC7cot1yxTR zv0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oRPwtSfaZ4lK+/Kwqo3hIoWwSAaNNETI/B4QeMlq4K0=; b=TIqzTiPcePmwxeL0BOMIQJtobp0WoBGHRLYiBweeLJx/F2mg30oL+CUhPhfUnC8N5O iL0xLYzybbG9eVezDpMdLKmtMVmWeIZjU8C+qwNmZqW4UHt3+C8Jcr3bRyyqClTQs8Rm P6+us1VOa2iEGriNAyaVjcp6wM+s86kaUWeythwR7aWYntDco8B4NixSnQY8Si5R2pIQ bYfQ0wgVioIbrzPt/+eB4jkDHqhrGxakGVsbfBqQF82T49PGAUgPF6vqKkhSTLrmcPBd U5r6xoeP7nxPAJEaNcKYCsjQ7AryBOodQOOvyKWUev5bbYIaS8rHaKLhQGsQ+9k+8oAg BsdQ== X-Gm-Message-State: AJIora+UF7gH9bGoL8B06+WdMToLsL3SCbUqVYqTfsOUAKbS4fzAs2UQ VmEHoTAUQaaprp4LebVAodkC8g== X-Google-Smtp-Source: AGRyM1sM6QESGjlfD1GGt0oFtY+CVN6+kz3J/8IXAvOmEUXgWJ/VGwfVTka8Ig/8o207cGsoSgkOBA== X-Received: by 2002:a17:902:b184:b0:168:a310:3eb0 with SMTP id s4-20020a170902b18400b00168a3103eb0mr36007275plr.9.1656936490190; Mon, 04 Jul 2022 05:08:10 -0700 (PDT) Received: from localhost ([122.171.18.80]) by smtp.gmail.com with ESMTPSA id u4-20020a170902714400b0015e8d4eb28fsm21099493plm.217.2022.07.04.05.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 05:08:09 -0700 (PDT) From: Viresh Kumar To: Alim Akhtar , Alyssa Rosenzweig , Andy Gross , Bjorn Andersson , Chanwoo Choi , Chen-Yu Tsai , Fabio Estevam , Ilia Lin , Jernej Skrabec , Jonathan Hunter , Krzysztof Kozlowski , Kyungmin Park , MyungJoo Ham , Nishanth Menon , NXP Linux Team , Patrice Chotard , Pengutronix Kernel Team , Qiang Yu , "Rafael J. Wysocki" , Rob Herring , Samuel Holland , Sascha Hauer , Shawn Guo , Stephen Boyd , Steven Price , Thierry Reding , Tomeu Vizoso , Viresh Kumar , Viresh Kumar , Yangtao Li Cc: linux-pm@vger.kernel.org, Vincent Guittot , Dmitry Osipenko , dri-devel@lists.freedesktop.org, Greg Kroah-Hartman , lima@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org Subject: [PATCH V3 00/20] OPP: Add new configuration interface: dev_pm_opp_set_config() Date: Mon, 4 Jul 2022 17:37:38 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220704_050812_039731_0A076E01 X-CRM114-Status: GOOD ( 18.18 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, We have too many configuration specific APIs currently, six of them already, like dev_pm_opp_set_regulators(). This makes it complex/messy for both the OPP core and its users to manage. There is also code redundancy in these APIs, in the way they add/manage the OPP table specific stuff. This patch series is an attempt to simplify these interfaces by adding a new interface, dev_pm_opp_set_config(), which is now used by all the existing ones. This series also migrates few users to the new API, where multiple configurations were required and rest are updated for API interface changes. This is pushed here: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/linux-next This was earlier tested by various folks, I have tested it again on hikey board, it will get further tested on linux-next in the coming days. Build test is already done by Linaro's bot for enough platform though. The entire patchset shall get merged via the OPP tree in 5.20-rc1, please do not merge individual patches. V2->V3: - Merged two patchsets: [PATCH V2 00/30] OPP: Add new configuration interface: dev_pm_opp_set_config() [PATCH V2 0/5] OPP: Replace custom set_opp() with config_regulators() - The existing APIs aren't removed anymore, but are made to use the new core API to set various configurations (Greg KH). - clk-names and regulator-names are NULL terminated arrays now (Greg KH). - New interface added: dev_pm_opp_set_config_regulators(). V1->V2: - dev_pm_opp_set_config() doesn't return the OPP table anymore, but a token allocated with xa_alloc(). The same needs to be passed to clear-config API. - Updated all users according to that as well. - The clk_names interface is updated to allow multiple clocks. - Converted few // comments to /* */. - Added tags by few people. - Dropped the last patch to rearrange stuff, not required anymore. Thanks. --- Viresh Viresh Kumar (20): OPP: Track if clock name is configured by platform OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list OPP: Add dev_pm_opp_set_config() and friends cpufreq: qcom-nvmem: Migrate to dev_pm_opp_set_config() cpufreq: sti: Migrate to dev_pm_opp_set_config() cpufreq: ti: Migrate to dev_pm_opp_set_config() drm/lima: Migrate to dev_pm_opp_set_config() soc/tegra: Add comment over devm_pm_opp_set_clkname() soc/tegra: Migrate to dev_pm_opp_set_config() OPP: Migrate set-regulators API to use set-config helpers OPP: Migrate set-supported-hw API to use set-config helpers OPP: Migrate set-clk-name API to use set-config helpers OPP: Migrate set-opp-helper API to use set-config helpers OPP: Migrate attach-genpd API to use set-config helpers OPP: Migrate set-prop-name helper API to use set-config helpers OPP: Add support for config_regulators() helper OPP: Make _generic_set_opp_regulator() a config_regulators() interface OPP: Add dev_pm_opp_get_supplies() OPP: ti: Migrate to dev_pm_opp_set_config_regulators() OPP: Remove custom OPP helper support drivers/cpufreq/cpufreq-dt.c | 19 +- drivers/cpufreq/imx-cpufreq-dt.c | 12 +- drivers/cpufreq/qcom-cpufreq-nvmem.c | 109 +-- drivers/cpufreq/sti-cpufreq.c | 27 +- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 31 +- drivers/cpufreq/tegra20-cpufreq.c | 12 +- drivers/cpufreq/ti-cpufreq.c | 42 +- drivers/devfreq/exynos-bus.c | 21 +- drivers/gpu/drm/lima/lima_devfreq.c | 12 +- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 4 +- drivers/memory/tegra/tegra124-emc.c | 11 +- drivers/opp/core.c | 821 +++++++++----------- drivers/opp/opp.h | 32 +- drivers/opp/ti-opp-supply.c | 77 +- drivers/soc/tegra/common.c | 49 +- drivers/soc/tegra/pmc.c | 4 +- include/linux/pm_opp.h | 295 ++++--- 17 files changed, 750 insertions(+), 828 deletions(-)