<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/opp, branch v5.4.250</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.250</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.250'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-03-11T15:43:41Z</updated>
<entry>
<title>OPP: fix error checking in opp_migrate_dentry()</title>
<updated>2023-03-11T15:43:41Z</updated>
<author>
<name>Qi Zheng</name>
<email>zhengqi.arch@bytedance.com</email>
</author>
<published>2023-02-08T04:00:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d19bd48535fc875f01b713e12d87da5516d957ca'/>
<id>urn:sha1:d19bd48535fc875f01b713e12d87da5516d957ca</id>
<content type='text'>
[ Upstream commit eca4c0eea53432ec4b711b2a8ad282cbad231b4f ]

Since commit ff9fb72bc077 ("debugfs: return error values,
not NULL") changed return value of debugfs_rename() in
error cases from %NULL to %ERR_PTR(-ERROR), we should
also check error values instead of NULL.

Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL")
Signed-off-by: Qi Zheng &lt;zhengqi.arch@bytedance.com&gt;
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: Fix error check in dev_pm_opp_attach_genpd()</title>
<updated>2022-08-25T09:18:00Z</updated>
<author>
<name>Tang Bin</name>
<email>tangbin@cmss.chinamobile.com</email>
</author>
<published>2022-05-24T12:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d3f15a4be2098754d49537a7775b8d33ce92cc38'/>
<id>urn:sha1:d3f15a4be2098754d49537a7775b8d33ce92cc38</id>
<content type='text'>
[ Upstream commit 4ea9496cbc959eb5c78f3e379199aca9ef4e386b ]

dev_pm_domain_attach_by_name() may return NULL in some cases,
so IS_ERR() doesn't meet the requirements. Thus fix it.

Fixes: 6319aee10e53 ("opp: Attach genpds to devices from within OPP core")
Signed-off-by: Tang Bin &lt;tangbin@cmss.chinamobile.com&gt;
[ Viresh: Replace ENODATA with ENODEV ]
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: Fix return in _opp_add_static_v2()</title>
<updated>2021-11-17T08:48:44Z</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2021-10-08T07:46:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a893e0eab167421bca07ab4dec04cd56f3b4a6c'/>
<id>urn:sha1:5a893e0eab167421bca07ab4dec04cd56f3b4a6c</id>
<content type='text'>
[ Upstream commit 27ff8187f13ecfec8a26fb1928e906f46f326cc5 ]

Fix sparse warning:
drivers/opp/of.c:924 _opp_add_static_v2() warn: passing zero to 'ERR_PTR'

For duplicate OPPs 'ret' be set to zero.

Fixes: deac8703da5f ("PM / OPP: _of_add_opp_table_v2(): increment count only if OPP is added")
Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
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: Don't print an error if required-opps is missing</title>
<updated>2021-09-22T10:26:33Z</updated>
<author>
<name>Rajendra Nayak</name>
<email>rnayak@codeaurora.org</email>
</author>
<published>2021-08-12T11:27:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d02a1c5fd7d9fff6ec774d89d162a7c072e5038c'/>
<id>urn:sha1:d02a1c5fd7d9fff6ec774d89d162a7c072e5038c</id>
<content type='text'>
[ Upstream commit 020d86fc0df8b865f6dc168d88a7c2dccabd0a9e ]

The 'required-opps' property is considered optional, hence remove
the pr_err() in of_parse_required_opp() when we find the property is
missing.
While at it, also fix the return value of
of_get_required_opp_performance_state() when of_parse_required_opp()
fails, return a -ENODEV instead of the -EINVAL.

Signed-off-by: Rajendra Nayak &lt;rnayak@codeaurora.org&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>opp: remove WARN when no valid OPPs remain</title>
<updated>2021-09-03T08:08:14Z</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2021-07-26T08:30:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0d4ba693db4884a54e0149ed7768d31256cd7dbb'/>
<id>urn:sha1:0d4ba693db4884a54e0149ed7768d31256cd7dbb</id>
<content type='text'>
[ Upstream commit 335ffab3ef864539e814b9a2903b0ae420c1c067 ]

This WARN can be triggered per-core and the stack trace is not useful.
Replace it with plain dev_err(). Fix a comment while at it.

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
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: Reduce the size of critical section in _opp_table_kref_release()</title>
<updated>2020-11-18T18:20:21Z</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=e6049035419111cacb662a8b919ba1c5b743c5a7'/>
<id>urn:sha1:e6049035419111cacb662a8b919ba1c5b743c5a7</id>
<content type='text'>
[ Upstream commit e0df59de670b48a923246fae1f972317b84b2764 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>opp: Prevent memory leak in dev_pm_opp_attach_genpd()</title>
<updated>2020-10-29T08:58:06Z</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=09b63105d089756cbd3f29457ad5d530b2b00c4e'/>
<id>urn:sha1:09b63105d089756cbd3f29457ad5d530b2b00c4e</id>
<content type='text'>
[ Upstream commit cb60e9602cce1593eb1e9cdc8ee562815078a354 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>opp: Increase parsed_static_opps in _of_add_opp_table_v1()</title>
<updated>2020-10-01T11:18:11Z</updated>
<author>
<name>Walter Lozano</name>
<email>walter.lozano@collabora.com</email>
</author>
<published>2020-07-16T02:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4d8d6f71b60fdc3c9fb76446a2dede6c06851518'/>
<id>urn:sha1:4d8d6f71b60fdc3c9fb76446a2dede6c06851518</id>
<content type='text'>
[ Upstream commit 6544abc520f0fff701e9da382110dc29676c683a ]

Currently, when using _of_add_opp_table_v2 parsed_static_opps is
increased and this value is used in _opp_remove_all_static() to
check if there are static opp entries that need to be freed.
Unfortunately this does not happen when using _of_add_opp_table_v1(),
which leads to warnings.

This patch increases parsed_static_opps in _of_add_opp_table_v1() in a
similar way as in _of_add_opp_table_v2().

Fixes: 03758d60265c ("opp: Replace list_kref with a local counter")
Cc: v5.6+ &lt;stable@vger.kernel.org&gt; # v5.6+
Signed-off-by: Walter Lozano &lt;walter.lozano@collabora.com&gt;
[ Viresh: Do the operation with lock held and set the value to 1 instead
	  of incrementing it ]
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: Replace list_kref with a local counter</title>
<updated>2020-10-01T11:17:26Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2019-11-11T11:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9f7d28075ae4a3679e821051e0a69f431ca3afff'/>
<id>urn:sha1:9f7d28075ae4a3679e821051e0a69f431ca3afff</id>
<content type='text'>
[ Upstream commit 03758d60265c773e1d06d436b99ee338f2ac55d6 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>opp: Enable resources again if they were disabled earlier</title>
<updated>2020-08-26T08:40:53Z</updated>
<author>
<name>Rajendra Nayak</name>
<email>rnayak@codeaurora.org</email>
</author>
<published>2020-08-10T07:06:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=10e99c3003d551612dd98ab1a5d7342d3da7822b'/>
<id>urn:sha1:10e99c3003d551612dd98ab1a5d7342d3da7822b</id>
<content type='text'>
[ Upstream commit a4501bac0e553bed117b7e1b166d49731caf7260 ]

dev_pm_opp_set_rate() can now be called with freq = 0 in order
to either drop performance or bandwidth votes or to disable
regulators on platforms which support them.

In such cases, a subsequent call to dev_pm_opp_set_rate() with
the same frequency ends up returning early because 'old_freq == freq'

Instead make it fall through and put back the dropped performance
and bandwidth votes and/or enable back the regulators.

Cc: v5.3+ &lt;stable@vger.kernel.org&gt; # v5.3+
Fixes: cd7ea582866f ("opp: Make dev_pm_opp_set_rate() handle freq = 0 to drop performance votes")
Reported-by: Sajida Bhanu &lt;sbhanu@codeaurora.org&gt;
Reviewed-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
Reported-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Tested-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Rajendra Nayak &lt;rnayak@codeaurora.org&gt;
[ Viresh: Don't skip clk_set_rate() and massaged changelog ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
