Linux Power Management development
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
	Waldemar Rymarkiewicz <waldemarx.rymarkiewicz@intel.com>,
	linux-pm@vger.kernel.org, Viresh Kumar <vireshk@kernel.org>,
	Nishanth Menon <nm@ti.com>
Subject: Re: [PATCH] PM / OPP: Don't check not plugged in CPUs to avoid error
Date: Thu, 20 Jul 2017 09:01:58 +0530	[thread overview]
Message-ID: <20170720033158.GH352@vireshk-i7> (raw)
In-Reply-To: <CAHKzcENsE=So2omU2v27XoHEbvcpW1gmB5P0NM=Z-Bg=f_O_4g@mail.gmail.com>

On 19-07-17, 16:10, Waldemar Rymarkiewicz wrote:
> Anyway, below a proposal how we can solve the problem of getting
> shared CPUs when hotplug is used.
> 
> 
> @@ -555,8 +576,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table);
>  int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
>                                    struct cpumask *cpumask)
>  {
> -       struct device_node *np, *tmp_np;
> -       struct device *tcpu_dev;
> +       struct device_node *np, *tmp_np, *cpu_np;
>         int cpu, ret = 0;
> 
>         /* Get OPP descriptor node */
> @@ -572,22 +592,16 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
>         if (!of_property_read_bool(np, "opp-shared"))
>                 goto put_cpu_node;
> 
> -       for_each_possible_cpu(cpu) {
> +       for_each_node_by_type(cpu_np, "cpu") {
> +               cpu = of_device_node_get_cpu(cpu_np);

Actually you can keep the original loop as it is and use
of_get_cpu_node() here. We better open code of_device_node_get_cpu()
here.

> +
>                 if (cpu == cpu_dev->id)
>                         continue;
> 
> -               tcpu_dev = get_cpu_device(cpu);
> -               if (!tcpu_dev) {
> -                       dev_err(cpu_dev, "%s: failed to get cpu%d device\n",
> -                               __func__, cpu);
> -                       ret = -ENODEV;
> -                       goto put_cpu_node;
> -               }
> -
>                 /* Get OPP descriptor node */
> -               tmp_np = _of_get_opp_desc_node(tcpu_dev);

I see dev_pm_opp_of_get_opp_desc_node() here, not sure how you got
above change..

> +               tmp_np = of_parse_phandle(cpu_np, "operating-points-v2", 0);

I would create _opp_of_get_opp_desc_node(np) and use it everywhere,
i.e. from dev_pm_opp_of_get_opp_desc_node() as well.

>                 if (!tmp_np) {
> -                       dev_err(tcpu_dev, "%s: Couldn't find tcpu_dev node.\n",
> +                       dev_err(cpu_dev, "%s: Couldn't find tcpu_dev node.\n",
>                                 __func__);
>                         ret = -ENOENT;
>                         goto put_cpu_node;

Thanks.

-- 
viresh

  reply	other threads:[~2017-07-20  3:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170713122201.30048-1-waldemarx.rymarkiewicz@intel.com>
2017-07-13 23:42 ` [PATCH] PM / OPP: Don't check not plugged in CPUs to avoid error Stephen Boyd
2017-07-17  7:12   ` Viresh Kumar
2017-07-17 13:03     ` Waldemar Rymarkiewicz
2017-07-18  4:35       ` Viresh Kumar
2017-07-19 14:10         ` Waldemar Rymarkiewicz
2017-07-20  3:31           ` Viresh Kumar [this message]
2017-07-20  9:06             ` Waldemar Rymarkiewicz

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=20170720033158.GH352@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@codeaurora.org \
    --cc=vireshk@kernel.org \
    --cc=waldemar.rymarkiewicz@gmail.com \
    --cc=waldemarx.rymarkiewicz@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox