From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
Rafael Wysocki <rjw@rjwysocki.net>,
Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] cpufreq: Fix double addition of sysfs links
Date: Thu, 23 Jul 2015 11:39:38 +0530 [thread overview]
Message-ID: <20150723060938.GD5322@linux> (raw)
In-Reply-To: <CAJZ5v0jGPHq0P90pTbWGSnydgCQ5TcSxQ-KFuRjZ=qT6gNp_cg@mail.gmail.com>
On 22-07-15, 18:42, Rafael J. Wysocki wrote:
> > 3. what happens when 'policy' is NULL at the point when the first (few) CPUs
> > are added - how do the symlinks get created later if/when policy becomes
> > non-NULL (can it?)
>
> Yes, it can, and we have a design issue here that bothers me a bit.
I replied to Russell with a NO here as the first CPU should have
created the policy. BUT...
> Namley, we need a driver's ->init callback to populate policy->cpus
> for us, but this is not the only thing it is doing, so the concern is
> that it may not be able to deal with CPUs that aren't online.
... the first few CPUs could have been offline and so we might not
have tried to add the policy at all.. Need to fix that for sure.
> I was thinking about an additional driver callback that would *only*
> populate a mask of CPUs that should use the same policy as the given
> one.
Why so ? Drivers today are required to set policy->cpus with all CPUs
that should be managed by that policy. i.e. all online+offline. So,
actually ->init() fills policy->cpus with the value of
policy->related_cpus.
Yes, I thought earlier to change that by setting policy->related_cpus
from drivers, instead of policy->cpus and wasn't sure if I should do
that :)
> We'd be able to call that from cpufreq_add_dev() for offline
> CPUs too and this way the policy object could be created for the first
> CPU using the policy that is registered instead of being added for the
> first CPU using that policy that becomes online (which happens today).
Creating policy for offline CPUs doesn't look that great to me.
What we can do to fix the problem in hand, is to update a global mask
of CPUs (with policy == NULL) which were offline when
cpufreq_add_dev() was called for them. And when we create the policy,
we can add links for all such CPUs.
--
viresh
next prev parent reply other threads:[~2015-07-23 6:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-18 16:31 BUG: cpufreq on imx6solo warns Russell King - ARM Linux
2015-07-20 9:47 ` [PATCH] cpufreq: Avoid double addition/removal of sysfs links Viresh Kumar
2015-07-20 10:36 ` Russell King - ARM Linux
2015-07-21 0:47 ` Rafael J. Wysocki
2015-07-21 1:14 ` Rafael J. Wysocki
2015-07-22 7:04 ` Viresh Kumar
2015-07-21 10:43 ` Viresh Kumar
2015-07-22 6:57 ` Viresh Kumar
2015-07-21 23:15 ` Rafael J. Wysocki
2015-07-22 1:56 ` Rafael J. Wysocki
2015-07-22 3:00 ` Rafael J. Wysocki
2015-07-22 7:12 ` Viresh Kumar
2015-07-22 12:07 ` [PATCH V2] cpufreq: Fix double addition " Viresh Kumar
2015-07-22 12:44 ` Rafael J. Wysocki
2015-07-22 13:15 ` Russell King - ARM Linux
2015-07-22 16:42 ` Rafael J. Wysocki
2015-07-23 6:09 ` Viresh Kumar [this message]
2015-07-23 8:13 ` [PATCH 1/3] cpufreq: print error messages with dev_err() Viresh Kumar
2015-07-23 8:13 ` [PATCH 2/3] cpufreq: Create links for offline CPUs that got added earlier Viresh Kumar
2015-07-23 19:28 ` Rafael J. Wysocki
2015-07-23 8:13 ` [PATCH 3/3] cpufreq: use cpumask_test_and_clear_cpu() instead of separate routines Viresh Kumar
2015-07-23 17:22 ` [PATCH V2] cpufreq: Fix double addition of sysfs links Rafael J. Wysocki
2015-07-23 19:29 ` Rafael J. Wysocki
2015-07-23 5:54 ` 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=20150723060938.GD5322@linux \
--to=viresh.kumar@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).