From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753260AbdCOKuC (ORCPT ); Wed, 15 Mar 2017 06:50:02 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:37014 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbdCOKt7 (ORCPT ); Wed, 15 Mar 2017 06:49:59 -0400 MIME-Version: 1.0 In-Reply-To: <20170313103933.GA3102@vireshk-i7> References: <20170313103933.GA3102@vireshk-i7> From: Viresh Kumar Date: Wed, 15 Mar 2017 16:19:57 +0530 Message-ID: Subject: Re: [PATCH V3 0/7] PM / Domains: Implement domain performance states To: Kevin Hilman Cc: Rafael Wysocki , Ulf Hansson , Nishanth Menon , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Stephen Boyd , Linux Kernel Mailing List , Rob Herring , "Nayak, Rajendra" , Lina Iyer Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13 March 2017 at 16:09, Viresh Kumar wrote: > On 10-03-17, 12:38, Kevin Hilman wrote: >> Why limit it to just voltage levels. >> >> As I suggested earlier, I think this should use OPPs. Remember that a >> PM domain is not limited to a hardware power domain, but is just a >> grouping mechanism for devices that share some PM properties. As >> mentioned by Geert, this can also be a clock domain, where frequencies >> would make sense as well. One can imagine using this type of PM domain >> to manage an interconnect/bus which has scalable voltage/frequencies as >> well. > > Okay, I tried to do that change today and am blocked a bit right now. > > The OPP core and all of its APIs/interfaces have dependency on the > "struct device" for their working. It gets the of_node from it, stores > the device pointer to manage cases where multiple devices share OPP > table, uses it to get clk and regulators. > > But the "genpd" structure doesn't have a 'struct device' associated > with it. How should I make both of them work together? > > I tried to create separate helpers that don't accept 'dev', but that > is also not good. Just too much redundant code everywhere. > > Would creating a 'dev' structure within 'generic_pm_domain' be > acceptable? Or should we ask the domain-drivers to call something like > of_genpd_parse_idle_states(), with a fake 'dev' structure which has > its of_node initialized? Or maybe move that hack within the OPP-core > API, which can create a dev structure at runtime for the genpd passed > to it and get the OPP table out? Ulf/Kevin, I am currently blocked on this decision. Will it be possible for you guys to suggest something, so that I can send V3 soon ? The most ideal solution seems to be adding a device structure in genpd structure and add a genpd bus as well probably. -- viresh