From patchwork Thu Oct 25 05:52:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 149511 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp913397ljp; Wed, 24 Oct 2018 22:53:18 -0700 (PDT) X-Google-Smtp-Source: AJdET5fvh+PiCGYvZUjAI0ZHJZu6uGW6ey1E0BdGclNnQ9LZOkZYtpkcxh5vpMeLdubrlJnWPMFc X-Received: by 2002:a65:4cc3:: with SMTP id n3-v6mr185485pgt.257.1540446798118; Wed, 24 Oct 2018 22:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540446798; cv=none; d=google.com; s=arc-20160816; b=nk4vK527Jn60V4zm1SslhCspocdnsQABTWCSTwvCoRU9btGzdIOHpr88cUkD080IWp EpCNboDiNLcBI0NnRFmg+QTd+C/F4sGKM7VO/CIbRU4Raf47ZClF/7YsENpSccP9u5yd EZ3XOC9fenCNnEIZ2dS33aCo7OhNUmd7I/6GekMkI7FhDs6VRHtnnHnij8JYt72yWqpI Lv6WlkYJMAw8Hc9Mv0erGvMLAIJzKFg5rTSLbkJ8Hb2UNntOGLVQAC0zzXI3nj5Ugead n2xf4owHCQzldpfn3ciurDFOBy7pDxyX5Ffry00vkZg/BmMCVnR5m4evrauMMDpgEbMF 3OGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Tzyi/ZGPplqRmySLR5Ad2qLNX4GQSjbXCHd3ssSxWeE=; b=QmKp6jZaCmqSTkOuC08owYb3txR/3bw4KUWVJAFIS6XA6mHc/H/JLBtkduXh004uBq R0uE6r8zoqHIpSme+dLTNVJ/SRu1DIb5vYVQQkCJ90X63Q2Nzdb48TDmkaUHsea5Etw7 2CgK+rN40NQMEzAhzXUBVpQwk46oc6RKdF8VDTy/d2Dvhy3p8cpzt8h5dyJwWqBpV4yD ql+O9MFhRwIR26CLS4l6/Q/LgR7RQdwRTO5zxoMrG+dLBojHskWQYziwTEEIfZSC/j4D zzvydxKH9nLTkRi+EW2SC7ydGYtOmsXvSZVm/JHkim+UTYwsUapDCB4YBuJbEoTfW9o1 tqNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="V7Src/0/"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18-v6si7311920plj.82.2018.10.24.22.53.17; Wed, 24 Oct 2018 22:53:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="V7Src/0/"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbeJYOY0 (ORCPT + 11 others); Thu, 25 Oct 2018 10:24:26 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36839 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbeJYOY0 (ORCPT ); Thu, 25 Oct 2018 10:24:26 -0400 Received: by mail-pl1-f195.google.com with SMTP id y11-v6so3352864plt.3 for ; Wed, 24 Oct 2018 22:53:16 -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=Tzyi/ZGPplqRmySLR5Ad2qLNX4GQSjbXCHd3ssSxWeE=; b=V7Src/0/TBHZBBC2eNOYWhLGf65tST2WcKGTKD4+UsOc3sRKSDgbKrRHpnOHbW3pzt hjRF2UsTf7j16UD9jQ+Trmp3Qbr0Z9VU++e4PKVWrDWhV2ruRempaheDab/dG2VDCI90 nyW5YYwNOU9HJ/jIR6I4qst1gx3/IGdSL/FSk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tzyi/ZGPplqRmySLR5Ad2qLNX4GQSjbXCHd3ssSxWeE=; b=G2jKGNDyACNDe4D2Vi6ndWaaSDFMk0ZpclixCXe4ETqp22jPyTJQss1PcjKLyclzkB nEcVz8jeBQdE1eGoFmGgwtxFiqi+UfHsnggBqyWfd6FBRBDfhSz+bVU3Zdo04Kfg7/To Bbci9htz9mjzjAG+AVjYJkyUXBV9VvH/WtqNDf32HR3+Kv/upXQELLa9IHNYjymfyM+X zORi7dM1hGpB+D0Uvn2yqIGXuoptpEx+J2kbzSGCQKrSvn/WfX+YgF82ViO9akd4t7zl XDCeDK4j9WXptV6w9G+o+W+XReHDtEB47A0MMsJ0yIps/IwIGfl4vP3QOVFFEXmTi/Kc MHgg== X-Gm-Message-State: AGRZ1gIpjWXrfXdq5z0pOMuOeXGAiMvUQgUi79jWonpthmHcykyUFHeq 8UV8IHLher/kTgkFnbezPzUvJw== X-Received: by 2002:a17:902:b03:: with SMTP id 3-v6mr187573plq.141.1540446795558; Wed, 24 Oct 2018 22:53:15 -0700 (PDT) Received: from localhost ([122.172.217.9]) by smtp.gmail.com with ESMTPSA id y8-v6sm18558016pfd.168.2018.10.24.22.53.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 22:53:14 -0700 (PDT) From: Viresh Kumar To: ulf.hansson@linaro.org, Kevin Hilman , Len Brown , Nishanth Menon , Pavel Machek , "Rafael J. Wysocki" , Stephen Boyd , Viresh Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , niklas.cassel@linaro.org, rnayak@codeaurora.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 00/10] OPP: Support multiple power-domains per device Date: Thu, 25 Oct 2018 11:22:37 +0530 Message-Id: X-Mailer: git-send-email 2.19.1.568.g152ad8e3369a MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hello, This series improves the OPP core (and a bit of genpd core as well) to support multiple phandles in the "required-opps" property, which are only used for multiple power-domains per device for now. We still don't propagate the changes to master domains for the sub-domains, but this patchset is an important stepping stone for that to happen. Tested on Hikey960 after faking some power domains for CPUs. V2->V3: - Gained an additional patch to properly name the virtual device (1/10) - Renamed the virtual device as virt_dev instead of genpd_dev. - Few helpers renamed as well accordingly. - Use container_of() instead of traversing list of genpd. - Included tags received from Ulf. V1->V2: - Had a discussion at Linaro connect with Ulf regarding the changes V1 did in the genpd core and what his objections are to them. Based on his suggestions many changes are made. - The OPP core still needs the virtual device pointers to set the performance state for multiple domains, but the genpd core doesn't provide them automatically to the OPP core. One of the reasons behind this is to give more power to the consumer drivers which may not want to enable all the genpds at once. - The consumer drivers would now need to call the APIs dev_pm_opp_{set|put}_genpd_device() in order to set/reset these virtual device pointers. - More locking is put in place to protect the genpd device pointers in OPP core. - Reorg of the code at many places to make code less redundant. -- viresh Viresh Kumar (10): PM / Domains: Rename genpd virtual devices as virt_dev OPP: Identify and mark genpd OPP tables OPP: Separate out custom OPP handler specific code OPP: Populate required opp tables from "required-opps" property OPP: Populate OPPs from "required-opps" property PM / Domains: Add genpd_opp_to_performance_state() OPP: Add dev_pm_opp_{set|put}_genpd_virt_dev() helper OPP: Configure all required OPPs OPP: Rename and relocate of_genpd_opp_to_performance_state() OPP: Remove of_dev_pm_opp_find_required_opp() drivers/base/power/domain.c | 70 ++++---- drivers/opp/core.c | 261 ++++++++++++++++++++++-------- drivers/opp/of.c | 313 +++++++++++++++++++++++++++++++----- drivers/opp/opp.h | 20 +++ include/linux/pm_domain.h | 8 +- include/linux/pm_opp.h | 16 +- 6 files changed, 526 insertions(+), 162 deletions(-) -- 2.19.1.568.g152ad8e3369a Reviewed-by: Ulf Hansson Reviewed-by: Ulf Hansson