<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/opp, branch v5.10.48</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.48</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.48'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-03-04T10:37:27Z</updated>
<entry>
<title>opp: Correct debug message in _opp_add_static_v2()</title>
<updated>2021-03-04T10:37:27Z</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2021-01-18T00:55:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=276d6b35f3bc0c5985b3a452d0f06cf0c4ffe84f'/>
<id>urn:sha1:276d6b35f3bc0c5985b3a452d0f06cf0c4ffe84f</id>
<content type='text'>
[ Upstream commit d7b9d9b31a3e55dcc9b5c289abfafe31efa5b5c4 ]

The debug message always prints rate=0 instead of a proper value, fix it.

Fixes: 6c591eec67cb ("OPP: Add helpers for reading the binding properties")
Tested-by: Peter Geis &lt;pgwipeout@gmail.com&gt;
Tested-by: Nicolas Chauvet &lt;kwizart@gmail.com&gt;
Tested-by: Matt Merhar &lt;mattmerhar@protonmail.com&gt;
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
[ Viresh: Added Fixes tag ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>opp: Call the missing clk_put() on error</title>
<updated>2021-01-06T13:56:49Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-12-28T05:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1a58c171a523d2224fe12fb26fc459231f245b0d'/>
<id>urn:sha1:1a58c171a523d2224fe12fb26fc459231f245b0d</id>
<content type='text'>
commit 0e1d9ca1766f5d95fb881f57b6c4a1ffa63d4648 upstream.

Fix the clock reference counting by calling the missing clk_put() in the
error path.

Cc: v5.10 &lt;stable@vger.kernel.org&gt; # v5.10
Fixes: dd461cd9183f ("opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER")
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>opp: fix memory leak in _allocate_opp_table</title>
<updated>2021-01-06T13:56:49Z</updated>
<author>
<name>Quanyang Wang</name>
<email>quanyang.wang@windriver.com</email>
</author>
<published>2020-12-24T10:49:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e8322837a2e56d6b8d4b87d81292805948991e2c'/>
<id>urn:sha1:e8322837a2e56d6b8d4b87d81292805948991e2c</id>
<content type='text'>
commit 976509bb310b913d30577f15b58bdd30effb0542 upstream.

In function _allocate_opp_table, opp_dev is allocated and referenced
by opp_table via _add_opp_dev. But in the case that the subsequent calls
return -EPROBE_DEFER, it will jump to err label and opp_table will be
freed. Then opp_dev becomes an unreferenced object to cause memory leak.
So let's call _remove_opp_dev to do the cleanup.

This fixes the following kmemleak report:

unreferenced object 0xffff000801524a00 (size 128):
  comm "swapper/0", pid 1, jiffies 4294892465 (age 84.616s)
  hex dump (first 32 bytes):
    40 00 56 01 08 00 ff ff 40 00 56 01 08 00 ff ff  @.V.....@.V.....
    b8 52 77 7f 08 00 ff ff 00 3c 4c 00 08 00 ff ff  .Rw......&lt;L.....
  backtrace:
    [&lt;00000000b1289fb1&gt;] kmemleak_alloc+0x30/0x40
    [&lt;0000000056da48f0&gt;] kmem_cache_alloc+0x3d4/0x588
    [&lt;00000000a84b3b0e&gt;] _add_opp_dev+0x2c/0x88
    [&lt;0000000062a380cd&gt;] _add_opp_table_indexed+0x124/0x268
    [&lt;000000008b4c8f1f&gt;] dev_pm_opp_of_add_table+0x20/0x1d8
    [&lt;00000000e5316798&gt;] dev_pm_opp_of_cpumask_add_table+0x48/0xf0
    [&lt;00000000db0a8ec2&gt;] dt_cpufreq_probe+0x20c/0x448
    [&lt;0000000030a3a26c&gt;] platform_probe+0x68/0xd8
    [&lt;00000000c618e78d&gt;] really_probe+0xd0/0x3a0
    [&lt;00000000642e856f&gt;] driver_probe_device+0x58/0xb8
    [&lt;00000000f10f5307&gt;] device_driver_attach+0x74/0x80
    [&lt;0000000004f254b8&gt;] __driver_attach+0x58/0xe0
    [&lt;0000000009d5d19e&gt;] bus_for_each_dev+0x70/0xc8
    [&lt;0000000000d22e1c&gt;] driver_attach+0x24/0x30
    [&lt;0000000001d4e952&gt;] bus_add_driver+0x14c/0x1f0
    [&lt;0000000089928aaa&gt;] driver_register+0x64/0x120

Cc: v5.10 &lt;stable@vger.kernel.org&gt; # v5.10
Fixes: dd461cd9183f ("opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER")
Signed-off-by: Quanyang Wang &lt;quanyang.wang@windriver.com&gt;
[ Viresh: Added the stable tag ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>opp: Reduce the size of critical section in _opp_table_kref_release()</title>
<updated>2020-10-27T07:51:03Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-10-22T06:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0df59de670b48a923246fae1f972317b84b2764'/>
<id>urn:sha1:e0df59de670b48a923246fae1f972317b84b2764</id>
<content type='text'>
There is a lot of stuff here which can be done outside of the big
opp_table_lock, do that. This helps avoiding few circular dependency
lockdeps around debugfs and interconnects.

Reported-by: Rob Clark &lt;robdclark@gmail.com&gt;
Reported-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Fix early exit from dev_pm_opp_register_set_opp_helper()</title>
<updated>2020-10-27T05:08:28Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-10-20T10:33:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=47efcbcb340cca5d3b3d515964f09e1fec599a29'/>
<id>urn:sha1:47efcbcb340cca5d3b3d515964f09e1fec599a29</id>
<content type='text'>
We returned earlier by mistake even when there were no failures. Fix it.

Fixes: dd461cd9183f ("opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER")
Reported-by: Naresh Kamboju &lt;naresh.kamboju@linaro.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Naresh Kamboju &lt;naresh.kamboju@linaro.com&gt;
</content>
</entry>
<entry>
<title>opp: Don't always remove static OPPs in _of_add_opp_table_v1()</title>
<updated>2020-10-27T05:08:28Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-10-14T04:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1f6620f87006dc02c608466cd990778aaadf386a'/>
<id>urn:sha1:1f6620f87006dc02c608466cd990778aaadf386a</id>
<content type='text'>
The patch missed returning 0 early in case of success and hence the
static OPPs got removed by mistake. Fix it.

Fixes: 90d46d71cce2 ("opp: Handle multiple calls for same OPP table in _of_add_opp_table_v1()")
Reported-by: Aisheng Dong &lt;aisheng.dong@nxp.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm</title>
<updated>2020-10-05T11:31:32Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2020-10-05T11:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=757e282188f0138a06ebf925c950995feb7bd666'/>
<id>urn:sha1:757e282188f0138a06ebf925c950995feb7bd666</id>
<content type='text'>
Pull opertaing performance points (OPP) framework fixes for 5.10-rc1
from Viresh Kumar:

"- Return -EPROBE_DEFER properly from dev_pm_opp_get_opp_table()
   (Stephan Gerhold).

 - Minor cleanups around required-opps (Stephan Gerhold).

 - Extends opp-supported-hw property to contain multiple versions
   (Viresh Kumar).

 - Multiple cleanups around dev_pm_opp_attach_genpd() (Viresh Kumar).

 - Multiple fixes, cleanups in the OPP core for overall better design
   (Viresh Kumar)."

* 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  opp: Allow opp-level to be set to 0
  opp: Prevent memory leak in dev_pm_opp_attach_genpd()
  ARM: tegra: Pass multiple versions in opp-supported-hw property
  opp: Allow opp-supported-hw to contain multiple versions
  dt-bindings: opp: Allow opp-supported-hw to contain multiple versions
  opp: Set required OPPs in reverse order when scaling down
  opp: Reduce code duplication in _set_required_opps()
  opp: Drop unnecessary check from dev_pm_opp_attach_genpd()
  opp: Handle multiple calls for same OPP table in _of_add_opp_table_v1()
  opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
  opp: Remove _dev_pm_opp_find_and_remove_table() wrapper
  opp: Split out _opp_set_rate_zero()
  opp: Reuse the enabled flag in !target_freq path
  opp: Rename regulator_enabled and use it as status of all resources
</content>
</entry>
<entry>
<title>opp: Allow opp-level to be set to 0</title>
<updated>2020-09-16T08:32:34Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-09-11T09:26:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a5663c9b1e31c00e0bdfaf4d92eb51358fc3950f'/>
<id>urn:sha1:a5663c9b1e31c00e0bdfaf4d92eb51358fc3950f</id>
<content type='text'>
The DT bindings don't put such a constraint, nor should the kernel. It
is perfectly fine for opp-level to be set to 0, if we need to put the
performance state votes for a domain for a particular OPP.

Reported-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Tested-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Prevent memory leak in dev_pm_opp_attach_genpd()</title>
<updated>2020-09-16T08:32:33Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-08-31T05:52:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cb60e9602cce1593eb1e9cdc8ee562815078a354'/>
<id>urn:sha1:cb60e9602cce1593eb1e9cdc8ee562815078a354</id>
<content type='text'>
If dev_pm_opp_attach_genpd() is called multiple times (once for each CPU
sharing the table), then it would result in unwanted behavior like
memory leak, attaching the domain multiple times, etc.

Handle that by checking and returning earlier if the domains are already
attached. Now that dev_pm_opp_detach_genpd() can get called multiple
times as well, we need to protect that too.

Note that the virtual device pointers aren't returned in this case, as
they may become unavailable to some callers during the middle of the
operation.

Reported-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Allow opp-supported-hw to contain multiple versions</title>
<updated>2020-09-16T08:32:33Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-08-26T11:02:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0ff25c99042a56cd1580b381dd747a56286489cd'/>
<id>urn:sha1:0ff25c99042a56cd1580b381dd747a56286489cd</id>
<content type='text'>
The bindings allow multiple versions to be passed to "opp-supported-hw"
property, either of which can result in enabling of the OPP.

Update code to allow that.

Tested-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
</feed>
