<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/opp/core.c, branch v5.8</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>opp: Remove bandwidth votes when target_freq is zero</title>
<updated>2020-05-29T04:45:12+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-05-27T04:03:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b00e667a6d8b2b0f53098ec12ff1ffe7f7c9be20'/>
<id>b00e667a6d8b2b0f53098ec12ff1ffe7f7c9be20</id>
<content type='text'>
We already drop several votes when target_freq is set to zero, drop
bandwidth votes as well.

Reported-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Reviewed-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Tested-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Tested-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We already drop several votes when target_freq is set to zero, drop
bandwidth votes as well.

Reported-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Reviewed-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Tested-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Tested-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: core: add regulators enable and disable</title>
<updated>2020-05-29T04:45:12+00:00</updated>
<author>
<name>Kamil Konieczny</name>
<email>k.konieczny@samsung.com</email>
</author>
<published>2019-07-19T15:05:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8d45719caaf56c859be0172447f8559c0df40f93'/>
<id>8d45719caaf56c859be0172447f8559c0df40f93</id>
<content type='text'>
Add enable regulators to dev_pm_opp_set_regulators() and disable
regulators to dev_pm_opp_put_regulators(). Even if bootloader
leaves regulators enabled, they should be enabled in kernel in
order to increase the reference count.

Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Tested-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Signed-off-by: Kamil Konieczny &lt;k.konieczny@samsung.com&gt;
[ Viresh: Enable the regulator only after it is programmed and add a
	  flag to track its status. ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add enable regulators to dev_pm_opp_set_regulators() and disable
regulators to dev_pm_opp_put_regulators(). Even if bootloader
leaves regulators enabled, they should be enabled in kernel in
order to increase the reference count.

Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Tested-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Signed-off-by: Kamil Konieczny &lt;k.konieczny@samsung.com&gt;
[ Viresh: Enable the regulator only after it is programmed and add a
	  flag to track its status. ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: Reorder the code for !target_freq case</title>
<updated>2020-05-29T04:45:12+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-05-15T07:07:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b23dfa3543f31fbb8c0098925bf90fc23193d17a'/>
<id>b23dfa3543f31fbb8c0098925bf90fc23193d17a</id>
<content type='text'>
Reorder the code a bit to make it more readable. Add additional comment
as well.

Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Tested-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reorder the code a bit to make it more readable. Add additional comment
as well.

Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Tested-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: Update the bandwidth on OPP frequency changes</title>
<updated>2020-05-29T04:45:10+00:00</updated>
<author>
<name>Georgi Djakov</name>
<email>georgi.djakov@linaro.org</email>
</author>
<published>2020-05-12T12:53:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fe2af40250bfc3cca9120cd5c315e2ea7a1082ed'/>
<id>fe2af40250bfc3cca9120cd5c315e2ea7a1082ed</id>
<content type='text'>
If the OPP bandwidth values are populated, we want to switch also the
interconnect bandwidth in addition to frequency and voltage.

Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the OPP bandwidth values are populated, we want to switch also the
interconnect bandwidth in addition to frequency and voltage.

Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: Add support for parsing interconnect bandwidth</title>
<updated>2020-05-29T04:45:08+00:00</updated>
<author>
<name>Georgi Djakov</name>
<email>georgi.djakov@linaro.org</email>
</author>
<published>2020-05-12T12:53:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6d3f922c46f2e91f63c92f8dd28381f097082912'/>
<id>6d3f922c46f2e91f63c92f8dd28381f097082912</id>
<content type='text'>
The OPP bindings now support bandwidth values, so add support to parse it
from device tree and store it into the new dev_pm_opp_icc_bw struct, which
is part of the dev_pm_opp.

Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
[ Viresh: Create _read_bw() and use it, renamed _of_find_icc_paths() to
	  dev_pm_opp_of_find_icc_paths(), exported it and made opp_table
	  argument optional. Also drop the depends on from Kconfig. ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The OPP bindings now support bandwidth values, so add support to parse it
from device tree and store it into the new dev_pm_opp_icc_bw struct, which
is part of the dev_pm_opp.

Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
[ Viresh: Create _read_bw() and use it, renamed _of_find_icc_paths() to
	  dev_pm_opp_of_find_icc_paths(), exported it and made opp_table
	  argument optional. Also drop the depends on from Kconfig. ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>OPP: Add helpers for reading the binding properties</title>
<updated>2020-05-13T06:18:13+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-05-12T12:53:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6c591eec67cbb4db988ab35b944f5cf9013c0714'/>
<id>6c591eec67cbb4db988ab35b944f5cf9013c0714</id>
<content type='text'>
The opp-hz DT property is not mandatory and we may use another property
as a key in the OPP table. Add helper functions to simplify the reading
and comparing the keys.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
[ Viresh: Removed an unnecessary comment ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The opp-hz DT property is not mandatory and we may use another property
as a key in the OPP table. Add helper functions to simplify the reading
and comparing the keys.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
[ Viresh: Removed an unnecessary comment ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: Manage empty OPP tables with clk handle</title>
<updated>2020-04-13T10:44:55+00:00</updated>
<author>
<name>Rajendra Nayak</name>
<email>rnayak@codeaurora.org</email>
</author>
<published>2020-04-08T13:46:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aca48b61f963869ccbb5cf84805a7ad68bf812cd'/>
<id>aca48b61f963869ccbb5cf84805a7ad68bf812cd</id>
<content type='text'>
With OPP core now supporting DVFS for IO devices, we have instances of
IO devices (same IP block) which require an OPP on some platforms/SoCs
while just needing to scale the clock on some others.

In order to avoid conditional code in every driver which supports such
devices (to check for availability of OPPs and then deciding to do
either dev_pm_opp_set_rate() or clk_set_rate()) add support to manage
empty OPP tables with a clk handle.

This makes dev_pm_opp_set_rate() equivalent of a clk_set_rate() for
devices with just a clk and no OPPs specified, and makes
dev_pm_opp_set_rate(0) bail out without throwing an error.

Signed-off-by: Rajendra Nayak &lt;rnayak@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With OPP core now supporting DVFS for IO devices, we have instances of
IO devices (same IP block) which require an OPP on some platforms/SoCs
while just needing to scale the clock on some others.

In order to avoid conditional code in every driver which supports such
devices (to check for availability of OPPs and then deciding to do
either dev_pm_opp_set_rate() or clk_set_rate()) add support to manage
empty OPP tables with a clk handle.

This makes dev_pm_opp_set_rate() equivalent of a clk_set_rate() for
devices with just a clk and no OPPs specified, and makes
dev_pm_opp_set_rate(0) bail out without throwing an error.

Signed-off-by: Rajendra Nayak &lt;rnayak@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: Replace list_kref with a local counter</title>
<updated>2019-12-10T10:27:00+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2019-11-11T11:05:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=03758d60265c773e1d06d436b99ee338f2ac55d6'/>
<id>03758d60265c773e1d06d436b99ee338f2ac55d6</id>
<content type='text'>
A kref or refcount isn't the right tool to be used here for counting
number of devices that are sharing the static OPPs created for the OPP
table. For example, we are reinitializing the kref again, after it
reaches a value of 0 and frees the resources, if the static OPPs get
added for the same OPP table structure (as the OPP table structure was
never freed). That is messy and very unclear.

This patch makes parsed_static_opps an unsigned integer and uses it to
count the number of users of the static OPPs. The increment and
decrement to parsed_static_opps is done under opp_table-&gt;lock now to
make sure no races are possible if the OPP table is getting added and
removed in parallel (which doesn't happen in practice, but can in
theory).

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A kref or refcount isn't the right tool to be used here for counting
number of devices that are sharing the static OPPs created for the OPP
table. For example, we are reinitializing the kref again, after it
reaches a value of 0 and frees the resources, if the static OPPs get
added for the same OPP table structure (as the OPP table structure was
never freed). That is messy and very unclear.

This patch makes parsed_static_opps an unsigned integer and uses it to
count the number of users of the static OPPs. The increment and
decrement to parsed_static_opps is done under opp_table-&gt;lock now to
make sure no races are possible if the OPP table is getting added and
removed in parallel (which doesn't happen in practice, but can in
theory).

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / OPP: Support adjusting OPP voltages at runtime</title>
<updated>2019-11-11T04:57:15+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@codeaurora.org</email>
</author>
<published>2019-10-16T14:57:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=25cb20a212a1f989385dfe23230817e69c62bee5'/>
<id>25cb20a212a1f989385dfe23230817e69c62bee5</id>
<content type='text'>
On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention. Add an API to the OPP library for
the former case, so that AVS type devices can update the voltages
for an OPP when the hardware determines the voltage should
change. The assumption is that drivers like CPUfreq or devfreq
will register for the OPP notifiers and adjust the voltage
according to suggestions that AVS makes.

This patch is derived from [1] submitted by Stephen.
[1] https://lore.kernel.org/patchwork/patch/599279/

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
[Roger Lu: Changed to rcu less implementation]
Signed-off-by: Roger Lu &lt;roger.lu@mediatek.com&gt;
[s.nawrocki@samsung.com: added handling of OPP min/max voltage]
Signed-off-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention. Add an API to the OPP library for
the former case, so that AVS type devices can update the voltages
for an OPP when the hardware determines the voltage should
change. The assumption is that drivers like CPUfreq or devfreq
will register for the OPP notifiers and adjust the voltage
according to suggestions that AVS makes.

This patch is derived from [1] submitted by Stephen.
[1] https://lore.kernel.org/patchwork/patch/599279/

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
[Roger Lu: Changed to rcu less implementation]
Signed-off-by: Roger Lu &lt;roger.lu@mediatek.com&gt;
[s.nawrocki@samsung.com: added handling of OPP min/max voltage]
Signed-off-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>opp: core: Revert "add regulators enable and disable"</title>
<updated>2019-10-21T02:28:12+00:00</updated>
<author>
<name>Marek Szyprowski</name>
<email>m.szyprowski@samsung.com</email>
</author>
<published>2019-10-17T10:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=24957db1004353346583c9cc6d783db8f213e3ad'/>
<id>24957db1004353346583c9cc6d783db8f213e3ad</id>
<content type='text'>
All the drivers, which use the OPP framework control regulators, which
are already enabled. Typically those regulators are also system critical,
due to providing power to CPU core or system buses. It turned out that
there are cases, where calling regulator_enable() on such boot-enabled
regulator has side-effects and might change its initial voltage due to
performing initial voltage balancing without all restrictions from the
consumers. Until this issue becomes finally solved in regulator core,
avoid calling regulator_enable()/disable() from the OPP framework.

This reverts commit 7f93ff73f7c8c8bfa6be33bcc16470b0b44682aa.

Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All the drivers, which use the OPP framework control regulators, which
are already enabled. Typically those regulators are also system critical,
due to providing power to CPU core or system buses. It turned out that
there are cases, where calling regulator_enable() on such boot-enabled
regulator has side-effects and might change its initial voltage due to
performing initial voltage balancing without all restrictions from the
consumers. Until this issue becomes finally solved in regulator core,
avoid calling regulator_enable()/disable() from the OPP framework.

This reverts commit 7f93ff73f7c8c8bfa6be33bcc16470b0b44682aa.

Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
