<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/base/power/opp/cpu.c, branch v4.4.151</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.151</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.151'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2015-11-06T22:59:41+00:00</updated>
<entry>
<title>PM / OPP: Protect updates to list_dev with mutex</title>
<updated>2015-11-06T22:59:41+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2015-11-05T08:51:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=87b4115db0239865bc812f61704bb1f43e2439b6'/>
<id>urn:sha1:87b4115db0239865bc812f61704bb1f43e2439b6</id>
<content type='text'>
dev_opp_list_lock is used everywhere to protect device and OPP lists,
but dev_pm_opp_set_sharing_cpus() is missed somehow. And instead we used
rcu-lock, which wouldn't help here as we are adding a new list_dev.

This also fixes a problem where we have called kzalloc(..., GFP_KERNEL)
from within rcu-lock, which isn't allowed as kzalloc can sleep when
called with GFP_KERNEL.

With CONFIG_DEBUG_ATOMIC_SLEEP set, we get following lockdep-splat:

include/linux/rcupdate.h:578 Illegal context switch in RCU read-side critical section!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
5 locks held by swapper/0/1:
 #0:  (&amp;dev-&gt;mutex){......}, at: [&lt;c02f68f4&gt;] __driver_attach+0x48/0x98
 #1:  (&amp;dev-&gt;mutex){......}, at: [&lt;c02f6904&gt;] __driver_attach+0x58/0x98
 #2:  (cpu_hotplug.lock){++++++}, at: [&lt;c00249d0&gt;] get_online_cpus+0x40/0xb0
 #3:  (subsys mutex#5){+.+.+.}, at: [&lt;c02f4f8c&gt;] subsys_interface_register+0x44/0xdc
 #4:  (rcu_read_lock){......}, at: [&lt;c0305c80&gt;] dev_pm_opp_set_sharing_cpus+0x0/0x1e4

stack backtrace:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W       4.3.0-rc7-00047-g81f5932958a8 #59
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[&lt;c0016874&gt;] (unwind_backtrace) from [&lt;c001355c&gt;] (show_stack+0x10/0x14)
[&lt;c001355c&gt;] (show_stack) from [&lt;c022553c&gt;] (dump_stack+0x94/0xbc)
[&lt;c022553c&gt;] (dump_stack) from [&lt;c004904c&gt;] (___might_sleep+0x24c/0x298)
[&lt;c004904c&gt;] (___might_sleep) from [&lt;c00f07e4&gt;] (kmem_cache_alloc+0xe8/0x164)
[&lt;c00f07e4&gt;] (kmem_cache_alloc) from [&lt;c0305354&gt;] (_add_list_dev+0x30/0x58)
[&lt;c0305354&gt;] (_add_list_dev) from [&lt;c0305d50&gt;] (dev_pm_opp_set_sharing_cpus+0xd0/0x1e4)
[&lt;c0305d50&gt;] (dev_pm_opp_set_sharing_cpus) from [&lt;c040eda4&gt;] (cpufreq_init+0x4cc/0x62c)
[&lt;c040eda4&gt;] (cpufreq_init) from [&lt;c040a964&gt;] (cpufreq_online+0xbc/0x73c)
[&lt;c040a964&gt;] (cpufreq_online) from [&lt;c02f4fe0&gt;] (subsys_interface_register+0x98/0xdc)
[&lt;c02f4fe0&gt;] (subsys_interface_register) from [&lt;c040a640&gt;] (cpufreq_register_driver+0x110/0x17c)
[&lt;c040a640&gt;] (cpufreq_register_driver) from [&lt;c040ef64&gt;] (dt_cpufreq_probe+0x60/0x8c)
[&lt;c040ef64&gt;] (dt_cpufreq_probe) from [&lt;c02f8084&gt;] (platform_drv_probe+0x44/0xa4)
[&lt;c02f8084&gt;] (platform_drv_probe) from [&lt;c02f67c0&gt;] (driver_probe_device+0x208/0x2f4)
[&lt;c02f67c0&gt;] (driver_probe_device) from [&lt;c02f6940&gt;] (__driver_attach+0x94/0x98)
[&lt;c02f6940&gt;] (__driver_attach) from [&lt;c02f4c1c&gt;] (bus_for_each_dev+0x68/0x9c)

Reported-by: Michael Turquette &lt;mturquette@baylibre.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 4.3 &lt;stable@vger.kernel.org&gt; # 4.3
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: Propagate error properly from dev_pm_opp_set_sharing_cpus()</title>
<updated>2015-11-06T22:59:41+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2015-11-05T08:51:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1794ec1f9585501e4ed4390f5a5d396fd28c63ce'/>
<id>urn:sha1:1794ec1f9585501e4ed4390f5a5d396fd28c63ce</id>
<content type='text'>
We are returning 0 even in case of errors, fix it.

Fixes: 8d4d4e98acd6 ("PM / OPP: Add helpers for initializing CPU OPPs")
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 4.3 &lt;stable@vger.kernel.org&gt; # 4.3
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: Improve print messages with pr_fmt</title>
<updated>2015-11-02T00:47:43+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2015-10-17T04:15:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d6d2a5289a530a3020703e6a3b19a14668601c27'/>
<id>urn:sha1:d6d2a5289a530a3020703e6a3b19a14668601c27</id>
<content type='text'>
To identify OPP core's print messages easily, prefix them with
KBUILD_MODNAME.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: passing NULL to PTR_ERR()</title>
<updated>2015-10-09T20:17:34+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2015-09-21T16:26:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a6eed752f5fb40990eb28fddb2b93258fb7e3be0'/>
<id>urn:sha1:a6eed752f5fb40990eb28fddb2b93258fb7e3be0</id>
<content type='text'>
The code was using PTR_ERR(NULL) which causes a static checker warning.
I have fixed up the printks and changed the return to -ENOENT.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: Move cpu specific code to opp/cpu.c</title>
<updated>2015-09-15T00:03:16+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2015-09-04T08:17:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f59d3ee8480d30f41914cb4bed5086237e8507b0'/>
<id>urn:sha1:f59d3ee8480d30f41914cb4bed5086237e8507b0</id>
<content type='text'>
Move cpu device specific code out of generic opp library, and add it to
cpu.c.

Along with that, create a core-internal opp.h header, which will be used
to share structures and function prototypes within opp core.

Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: Move opp core to its own directory</title>
<updated>2015-09-15T00:03:16+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2015-09-04T08:17:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=33692dc381f9b89ddfc408631bf670ac2fd08ffc'/>
<id>urn:sha1:33692dc381f9b89ddfc408631bf670ac2fd08ffc</id>
<content type='text'>
OPP code is expanding and is already present in multiple directories
(cpufreq and power). Lets move it to its own directory, to manage it
better.

This also moves/renames the cpufreq_opp file to cpu.c, as it will
contain helpers for cpu device. Its not just about cpufreq, other
frameworks can use OPPs as well.

Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
