All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kevin Hilman <khilman@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Linux PM <linux-pm@vger.kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>, Nishanth Menon <nm@ti.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/7] PM / Domain: Add struct device to genpd
Date: Thu, 22 Mar 2018 11:18:58 +0100	[thread overview]
Message-ID: <CAPDyKFqZeOvHy1oY0JnUau17vFTuRBzCjKp+zzpf=tWzAi3cEw@mail.gmail.com> (raw)
In-Reply-To: <20180322095903.h7hgm3xylq3esjyf@vireshk-mac-ubuntu>

On 22 March 2018 at 10:59, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 22-03-18, 10:30, Ulf Hansson wrote:
>> On 22 December 2017 at 08:26, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> > The power-domain core would be using the OPP core going forward and the
>> > OPP core has the basic requirement of a device structure for its working.
>>
>> According to the OPP core also seems to require the ->dev.of_node to
>> be set. Actually, it seems like that part belongs in patch4 instead,
>> while starting to make use of the opp OF APIs. Could you please move
>> it?
>
> You meaning setting of the of_node to the next patch? I can do that if that;s
> what you want.

Yes, please.

>
>> > +static struct bus_type genpd_bus_type = {
>> > +       .name =         "genpd",
>> > +};
>>
>> This seems silly. Can't we just avoid having a bus type altogether,
>> thus no need to call bus_register() as well?
>
> I thought we need a bus where we want to add the device, haven't tried with that
> pointer being empty. Will try that and let you know.

Great!

>
>> > +
>> >  /**
>> >   * pm_genpd_init - Initialize a generic I/O PM domain object.
>> >   * @genpd: PM domain object to initialize.
>> > @@ -1687,6 +1691,18 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
>> >                         return ret;
>> >         }
>> >
>> > +       genpd->dev.bus = &genpd_bus_type;
>> > +       device_initialize(&genpd->dev);
>> > +       dev_set_name(&genpd->dev, "%s", genpd->name);
>> > +
>> > +       ret = device_add(&genpd->dev);
>>
>> What's the point of adding the device? Can we skip this step, as I
>> guess the opp core is only using the device as cookie rather actual
>> using it? No?
>
> We also use it for the OPP debugfs stuff, so that would be required I believe.

Right, however, isn't that only using the dev_name(dev), which you
don't need to add the device to make use of.

Or maybe I missing something around this...

> We also use it for playing with clk/regulator stuff as well, though we may not
> use it in genpd case for now.
>
> --
> viresh

Kind regards
Uffe

  reply	other threads:[~2018-03-22 10:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22  7:26 [PATCH 0/7] PM /Domain/OPP: Add support to get performance state from DT Viresh Kumar
2017-12-22  7:26 ` [PATCH 1/7] PM / OPP: Implement dev_pm_opp_of_add_table_indexed() Viresh Kumar
2018-03-22  9:28   ` Ulf Hansson
2017-12-22  7:26 ` [PATCH 2/7] PM / OPP: Implement of_dev_pm_opp_find_required_opp() Viresh Kumar
2018-03-22  9:29   ` Ulf Hansson
2017-12-22  7:26 ` [PATCH 3/7] PM / Domain: Add struct device to genpd Viresh Kumar
2018-03-22  9:30   ` Ulf Hansson
2018-03-22  9:59     ` Viresh Kumar
2018-03-22 10:18       ` Ulf Hansson [this message]
2018-04-09  7:53         ` Viresh Kumar
2018-04-09 10:46           ` Ulf Hansson
2017-12-22  7:26 ` [PATCH 4/7] PM / Domain: Add support to parse domain's OPP table Viresh Kumar
2018-03-22  9:31   ` Ulf Hansson
2018-03-22 10:00     ` Viresh Kumar
2018-03-22 10:09       ` Ulf Hansson
2017-12-22  7:26 ` [PATCH 5/7] PM / Domain: Implement of_dev_pm_genpd_get_performance_state() Viresh Kumar
2018-03-22  9:32   ` Ulf Hansson
2017-12-22  7:26 ` [PATCH 6/7] PM / OPP: Get performance state using genpd helper Viresh Kumar
2018-03-22  9:32   ` Ulf Hansson
2017-12-22  7:26 ` [PATCH 7/7] PM / OPP: Remove dev_pm_opp_{un}register_get_pstate_helper() Viresh Kumar
2018-03-22  9:32   ` Ulf Hansson
2018-01-18  6:34 ` [PATCH 0/7] PM /Domain/OPP: Add support to get performance state from DT Viresh Kumar
2018-01-18 19:24   ` Rafael J. Wysocki
2018-01-19  5:42     ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPDyKFqZeOvHy1oY0JnUau17vFTuRBzCjKp+zzpf=tWzAi3cEw@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=khilman@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=rnayak@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.