<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/base/power/opp/core.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-01-06T10:16:23Z</updated>
<entry>
<title>PM / OPP: Pass opp_table to dev_pm_opp_put_regulator()</title>
<updated>2017-01-06T10:16:23Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2016-11-30T10:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3742a15d6cdad8a22cea66feb3ad44618085072'/>
<id>urn:sha1:e3742a15d6cdad8a22cea66feb3ad44618085072</id>
<content type='text'>
commit 91291d9ad92faa65a56a9a19d658d8049b78d3d4 upstream.

Joonyoung Shim reported an interesting problem on his ARM octa-core
Odoroid-XU3 platform. During system suspend, dev_pm_opp_put_regulator()
was failing for a struct device for which dev_pm_opp_set_regulator() is
called earlier.

This happened because an earlier call to
dev_pm_opp_of_cpumask_remove_table() function (from cpufreq-dt.c file)
removed all the entries from opp_table-&gt;dev_list apart from the last CPU
device in the cpumask of CPUs sharing the OPP.

But both dev_pm_opp_set_regulator() and dev_pm_opp_put_regulator()
routines get CPU device for the first CPU in the cpumask. And so the OPP
core failed to find the OPP table for the struct device.

This patch attempts to fix this problem by returning a pointer to the
opp_table from dev_pm_opp_set_regulator() and using that as the
parameter to dev_pm_opp_put_regulator(). This ensures that the
dev_pm_opp_put_regulator() doesn't fail to find the opp table.

Note that similar design problem also exists with other
dev_pm_opp_put_*() APIs, but those aren't used currently by anyone and
so we don't need to update them for now.

Reported-by: Joonyoung Shim &lt;jy0922.shim@samsung.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ Viresh: Wrote commit log and tested on exynos 5250 ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PM / OPP: optimize dev_pm_opp_set_rate() performance a bit</title>
<updated>2016-07-28T21:54:16Z</updated>
<author>
<name>Jisheng Zhang</name>
</author>
<published>2016-07-25T06:11:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=067b7ce083df6c69e67345bdba658ab59274cc01'/>
<id>urn:sha1:067b7ce083df6c69e67345bdba658ab59274cc01</id>
<content type='text'>
In dev_pm_opp_set_rate(), _find_opp_table() is called 4 times: once by
_get_opp_clk(), once by dev_pm_opp_set_rate() itself, and twice by
dev_pm_opp_find_freq_ceil(). If there are several opp_tables in the
system, three times of opp table finding is a big waste. This patch
reduced the call of _find_opp_table() to twice.

Signed-off-by: Jisheng Zhang &lt;jszhang@marvell.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>Merge back new material for v4.7.</title>
<updated>2016-05-06T20:05:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2016-05-06T20:05:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8541203a680a63ba7dcc4e50cd25d40e9a13dff'/>
<id>urn:sha1:c8541203a680a63ba7dcc4e50cd25d40e9a13dff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>PM / OPP: Move CONFIG_OF dependent code in a separate file</title>
<updated>2016-05-06T11:22:49Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2016-05-05T10:50:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f47b72a15a9679dd4dc1af681d4d2f1ca2815552'/>
<id>urn:sha1:f47b72a15a9679dd4dc1af681d4d2f1ca2815552</id>
<content type='text'>
Recently, a few issues were noticed in the code where CONFIG_OF wasn't
consistently used for many routines. The core file is big enough now and
ifdef hackery makes it less readable.

Move OF-specific code to another file and compile that only if CONFIG_OF
is enabled.

Compile-tested:
- For ARM (exynos) with CONFIG_OF enabled
- For X86 with CONFIG_OF disabled (have to enable CONFIG_PM_OPP separately)

No functional changes.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: Remove useless check</title>
<updated>2016-05-04T23:42:19Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2016-05-04T13:19:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21f8a99ce61b2d4b74bd425a5bf7e9efbe162788'/>
<id>urn:sha1:21f8a99ce61b2d4b74bd425a5bf7e9efbe162788</id>
<content type='text'>
Regulators are optional for devices using OPPs and the OPP core
shouldn't be printing any errors for such missing regulators.

It was fine before the commit 0c717d0f9cb4, but that failed to update
this part of the code to remove an 'always true' check and an extra
unwanted print message.

Fix that now.

Fixes: 0c717d0f9cb4 (PM / OPP: Initialize regulator pointer to an error value)
Reported-by: Marc Gonzalez &lt;marc_gonzalez@sigmadesigns.com&gt;
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: add non-OF versions of dev_pm_opp_{cpumask_, }remove_table</title>
<updated>2016-05-04T23:38:44Z</updated>
<author>
<name>Sudeep Holla</name>
</author>
<published>2016-05-03T14:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=411466c5081d2f649b3583cae0f6c9ad5edec636'/>
<id>urn:sha1:411466c5081d2f649b3583cae0f6c9ad5edec636</id>
<content type='text'>
Functions dev_pm_opp_of_{cpumask_,}remove_table removes/frees all the
static OPP entries associated with the device and/or all cpus(in case
of cpumask) that are created from DT.

However the OPP entries are populated reading from the firmware or some
different method using dev_pm_opp_add are marked dynamic and can't be
removed using above functions.

This patch adds non DT/OF versions of dev_pm_opp_{cpumask_,}remove_table
to support the above mentioned usecase.

This is in preparation to make use of the same in scpi-cpufreq.c

Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Acked-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: Rename structures for clarity</title>
<updated>2016-02-21T13:24:35Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2016-02-16T08:47:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c2709dc6921c5d246b686521f932c73a20f428f'/>
<id>urn:sha1:2c2709dc6921c5d246b686521f932c73a20f428f</id>
<content type='text'>
Stephen pointed out recently, that few structures always confuse him as
they aren't named properly. And this patch tries to address that:

Names are updated as:
- device_opp or dev_opp -&gt; opp_table
- dev_opp_list -&gt; opp_tables
- dev_opp_list_lock -&gt; opp_table_lock
- device_list_opp -&gt; opp_device (it was never a list, but a structure)
- list_dev -&gt; opp_dev
- And similar changes in comments and function names as well.

This also fixes checkpatch warnings that were generated with this patch.

No functional changes.

Suggested-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
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: Fix incorrect comments</title>
<updated>2016-02-21T13:24:04Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2016-02-16T08:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5da64477ee79efa748df256928ec8840a2a7986'/>
<id>urn:sha1:a5da64477ee79efa748df256928ec8840a2a7986</id>
<content type='text'>
Some comments were just copy/pasted from other sections and don't match
to the routines they were added for. Fix them.

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: Initialize regulator pointer to an error value</title>
<updated>2016-02-16T12:12:41Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2016-02-15T16:26:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0c717d0f9cb46259dce5272705adce64a2d646d9'/>
<id>urn:sha1:0c717d0f9cb46259dce5272705adce64a2d646d9</id>
<content type='text'>
We are currently required to do two checks for regulator pointer:
IS_ERR() and IS_NULL().

And multiple instances are reported, about both of these not being used
consistently and so resulting in crashes.

Fix that by initializing regulator pointer with an error value and
checking it only against an error.

This makes code more consistent and more efficient.

Fixes: 7d34d56ef334 (PM / OPP: Disable OPPs that aren't supported by the regulator)
Reported-and-tested-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Reported-and-tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Reported-and-tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ rjw: Initialize to -ENXIO ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / OPP: Initialize u_volt_min/max to a valid value</title>
<updated>2016-02-15T21:55:35Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2016-02-15T04:51:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c88c395f4a6485f23f81e385c79945d68bcd5c5d'/>
<id>urn:sha1:c88c395f4a6485f23f81e385c79945d68bcd5c5d</id>
<content type='text'>
We kept u_volt_min/max initialized to 0, when only the target voltage is
present in DT, instead of the target/min/max triplet.

This didn't go well with the regulator framework, as on few calls the
min voltage was set to target and max was set to 0 and so resulted in a
kernel crash like below:

kernel BUG at ../drivers/regulator/core.c:216!

[&lt;c0684af4&gt;] (regulator_check_voltage) from [&lt;c06857ac&gt;] (regulator_set_voltage_unlocked+0x58/0x230)
[&lt;c06857ac&gt;] (regulator_set_voltage_unlocked) from [&lt;c06859ac&gt;] (regulator_set_voltage+0x28/0x54)
[&lt;c06859ac&gt;] (regulator_set_voltage) from [&lt;c0775b28&gt;] (_set_opp_voltage+0x30/0x98)
[&lt;c0775b28&gt;] (_set_opp_voltage) from [&lt;c0776630&gt;] (dev_pm_opp_set_rate+0xf0/0x28c)
[&lt;c0776630&gt;] (dev_pm_opp_set_rate) from [&lt;c096f784&gt;] (__cpufreq_driver_target+0x184/0x2b4)
[&lt;c096f784&gt;] (__cpufreq_driver_target) from [&lt;c0973760&gt;] (dbs_check_cpu+0x1b0/0x1f4)
[&lt;c0973760&gt;] (dbs_check_cpu) from [&lt;c0973f30&gt;] (cpufreq_governor_dbs+0x324/0x5c4)
[&lt;c0973f30&gt;] (cpufreq_governor_dbs) from [&lt;c0970958&gt;] (__cpufreq_governor+0xe4/0x1ec)
[&lt;c0970958&gt;] (__cpufreq_governor) from [&lt;c09711e0&gt;] (cpufreq_init_policy+0x64/0x8c)
[&lt;c09711e0&gt;] (cpufreq_init_policy) from [&lt;c09718cc&gt;] (cpufreq_online+0x2fc/0x708)
[&lt;c09718cc&gt;] (cpufreq_online) from [&lt;c0765ff0&gt;] (subsys_interface_register+0x94/0xd8)
[&lt;c0765ff0&gt;] (subsys_interface_register) from [&lt;c0970530&gt;] (cpufreq_register_driver+0x14c/0x19c)
[&lt;c0970530&gt;] (cpufreq_register_driver) from [&lt;c09746dc&gt;] (dt_cpufreq_probe+0x70/0xec)
[&lt;c09746dc&gt;] (dt_cpufreq_probe) from [&lt;c076907c&gt;] (platform_drv_probe+0x4c/0xb0)
[&lt;c076907c&gt;] (platform_drv_probe) from [&lt;c07678e0&gt;] (driver_probe_device+0x214/0x2c0)
[&lt;c07678e0&gt;] (driver_probe_device) from [&lt;c0767a18&gt;] (__driver_attach+0x8c/0x90)
[&lt;c0767a18&gt;] (__driver_attach) from [&lt;c0765c2c&gt;] (bus_for_each_dev+0x68/0x9c)
[&lt;c0765c2c&gt;] (bus_for_each_dev) from [&lt;c0766d78&gt;] (bus_add_driver+0x1a0/0x218)
[&lt;c0766d78&gt;] (bus_add_driver) from [&lt;c076810c&gt;] (driver_register+0x78/0xf8)
[&lt;c076810c&gt;] (driver_register) from [&lt;c0301d74&gt;] (do_one_initcall+0x90/0x1d8)
[&lt;c0301d74&gt;] (do_one_initcall) from [&lt;c1100e14&gt;] (kernel_init_freeable+0x15c/0x1fc)
[&lt;c1100e14&gt;] (kernel_init_freeable) from [&lt;c0b27a0c&gt;] (kernel_init+0x8/0xf0)
[&lt;c0b27a0c&gt;] (kernel_init) from [&lt;c0307d78&gt;] (ret_from_fork+0x14/0x3c)
Code: e1550004 baffffeb e3a00000 e8bd8070 (e7f001f2)

Fix that by initializing u_volt_min/max to the target voltage in such cases.

Reported-and-tested-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Fixes: 274659029c9d (PM / OPP: Add support to parse "operating-points-v2" bindings)
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>
