All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Niklas Cassel <niklas.cassel@linaro.org>
Cc: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] opp: Return genpd virtual devices from dev_pm_opp_attach_genpd()
Date: Wed, 17 Jul 2019 08:22:17 +0530	[thread overview]
Message-ID: <20190717025217.ne5tf2le2lj7oxbf@vireshk-i7> (raw)
In-Reply-To: <20190716104354.GA13780@centauri>

On 16-07-19, 12:43, Niklas Cassel wrote:
> On Mon, Jul 08, 2019 at 11:30:11AM +0530, Viresh Kumar wrote:
> > The cpufreq drivers don't need to do runtime PM operations on the
> > virtual devices returned by dev_pm_domain_attach_by_name() and so the
> > virtual devices weren't shared with the callers of
> > dev_pm_opp_attach_genpd() earlier.
> > 
> > But the IO device drivers would want to do that. This patch updates the
> > prototype of dev_pm_opp_attach_genpd() to accept another argument to
> > return the pointer to the array of genpd virtual devices.
> > 
> > Reported-by: Rajendra Nayak <rnayak@codeaurora.org>
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> > @Rajendra: Can you please test this one ? I have only compile tested it.
> > 
> >  drivers/opp/core.c     | 5 ++++-
> >  include/linux/pm_opp.h | 4 ++--
> >  2 files changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> > index 2958cc7bbb58..07b6f1187b3b 100644
> > --- a/drivers/opp/core.c
> > +++ b/drivers/opp/core.c
> > @@ -1775,6 +1775,7 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
> >   * dev_pm_opp_attach_genpd - Attach genpd(s) for the device and save virtual device pointer
> >   * @dev: Consumer device for which the genpd is getting attached.
> >   * @names: Null terminated array of pointers containing names of genpd to attach.
> > + * @virt_devs: Pointer to return the array of virtual devices.
> >   *
> >   * Multiple generic power domains for a device are supported with the help of
> >   * virtual genpd devices, which are created for each consumer device - genpd
> > @@ -1789,7 +1790,8 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
> >   * This helper needs to be called once with a list of all genpd to attach.
> >   * Otherwise the original device structure will be used instead by the OPP core.
> >   */
> > -struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names)
> > +struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
> > +		const char **names, struct device ***virt_devs)
> >  {
> >  	struct opp_table *opp_table;
> >  	struct device *virt_dev;
> > @@ -1850,6 +1852,7 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names
> >  		name++;
> >  	}
> >  
> > +	*virt_devs = opp_table->genpd_virt_devs;
> 
> Could we perhaps only do this if (virt_devs), that way callers can send in
> NULL if they don't care about the genpd virtual devices.

That was the idea and I failed to add it :(

-- 
viresh

      reply	other threads:[~2019-07-17  2:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08  6:00 [PATCH] opp: Return genpd virtual devices from dev_pm_opp_attach_genpd() Viresh Kumar
2019-07-11  9:39 ` Rajendra Nayak
2019-07-17  5:47   ` Viresh Kumar
2019-07-17 10:04     ` Rajendra Nayak
2019-07-17 10:14       ` Viresh Kumar
2019-07-16 10:43 ` Niklas Cassel
2019-07-17  2:52   ` Viresh Kumar [this message]

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=20190717025217.ne5tf2le2lj7oxbf@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=niklas.cassel@linaro.org \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=rnayak@codeaurora.org \
    --cc=sboyd@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vireshk@kernel.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.