<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/opp, branch v5.12.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.12.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.12.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-03-12T03:56:52Z</updated>
<entry>
<title>opp: Don't drop extra references to OPPs accidentally</title>
<updated>2021-03-12T03:56:52Z</updated>
<author>
<name>Beata Michalska</name>
<email>beata.michalska@arm.com</email>
</author>
<published>2021-03-04T15:07:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=606a5d4227e4610399c61086ac55c46068a90b03'/>
<id>urn:sha1:606a5d4227e4610399c61086ac55c46068a90b03</id>
<content type='text'>
We are required to call dev_pm_opp_put() from outside of the
opp_table-&gt;lock as debugfs removal needs to happen lock-less to avoid
circular dependency issues.

commit cf1fac943c63 ("opp: Reduce the size of critical section in
_opp_kref_release()") tried to fix that introducing a new routine
_opp_get_next() which keeps returning OPPs that can be freed by the
callers and this routine shall be called without holding the
opp_table-&gt;lock.

Though the commit overlooked the fact that the OPPs can be referenced by
other users as well and this routine will end up dropping references
which were taken by other users and hence freeing the OPPs prematurely.

In effect, other users of the OPPs will end up having invalid pointers
at hand. We didn't see any crash reports earlier as the exact situation
never happened, though it is certainly possible.

We need a way to mark which OPPs are no longer referenced by the OPP
core, so we don't drop extra references to them accidentally.

This commit adds another OPP flag, "removed", which is used to track
this. And now we should never end up dropping extra references to the
OPPs.

Cc: v5.11+ &lt;stable@vger.kernel.org&gt; # v5.11+
Fixes: cf1fac943c63 ("opp: Reduce the size of critical section in _opp_kref_release()")
Signed-off-by: Beata Michalska &lt;beata.michalska@arm.com&gt;
[ Viresh: Almost rewrote entire patch, added new "removed" field,
	  rewrote commit log and added the correct Fixes tag. ]
Co-developed-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Don't skip freq update for different frequency</title>
<updated>2021-02-18T07:01:08Z</updated>
<author>
<name>Jonathan Marek</name>
<email>jonathan@marek.ca</email>
</author>
<published>2021-02-16T20:10:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=de04241ab87afcaac26f15fcc32a7bd27294dd47'/>
<id>urn:sha1:de04241ab87afcaac26f15fcc32a7bd27294dd47</id>
<content type='text'>
We skip the OPP update if the current and target OPPs are same. This is
fine for the devices that don't support frequency but may cause issues
for the ones that need to program frequency.

An OPP entry doesn't really signify a single operating frequency but
rather the highest frequency at which the other properties of the OPP
entry apply. And we may reach here with different frequency values,
while all of them would point to the same OPP entry in the OPP table.

We just need to update the clock frequency in that case, though in order
to not add special exit points we reuse the code flow from a normal
path.

While at it, rearrange the conditionals in the 'if' statement to check
'enabled' flag at the end.

Fixes: 81c4d8a3c414 ("opp: Keep track of currently programmed OPP")
Signed-off-by: Jonathan Marek &lt;jonathan@marek.ca&gt;
[ Viresh: Improved commit log and subject, rename current_freq as
	  current_rate, document it, remove local variable and rearrange
	  code. ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>OPP: Add function to look up required OPP's for a given OPP</title>
<updated>2021-02-04T11:00:14Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2021-02-04T08:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7d8658ef65a4f891d0cff6340fa717b378384642'/>
<id>urn:sha1:7d8658ef65a4f891d0cff6340fa717b378384642</id>
<content type='text'>
Add a function that allows looking up required OPPs given a source OPP
table, destination OPP table and the source OPP.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
[ Viresh: Rearranged code, fixed return errors ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Don't ignore clk_get() errors other than -ENOENT</title>
<updated>2021-02-02T05:00:53Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2021-01-29T10:42:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d4a4c7a41153d701f23322ea5d39c766e9ff6eee'/>
<id>urn:sha1:d4a4c7a41153d701f23322ea5d39c766e9ff6eee</id>
<content type='text'>
Not all devices that need to use OPP core need to have clocks, a missing
clock is fine in which case -ENOENT shall be returned by clk_get().

Anything else is an error and must be handled properly.

Reported-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Update bandwidth requirements based on scaling up/down</title>
<updated>2021-02-02T05:00:53Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2021-01-28T10:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=870d5d963972ddefa83a09a7dbe4bef01f0b35b8'/>
<id>urn:sha1:870d5d963972ddefa83a09a7dbe4bef01f0b35b8</id>
<content type='text'>
The bandwidth must be scaled at a different point in the code flow based
on if we are scaling up or down the frequency, otherwise this may cause
undesired effects as the device will try to use more of the memory
bandwidth which may be shared across several devices. Much like how
regulators and required-opps are programmed.

Reported-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Reported-by: Akhil P Oommen &lt;akhilpo@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
</content>
</entry>
<entry>
<title>opp: Allow lazy-linking of required-opps</title>
<updated>2021-02-02T05:00:53Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2019-11-25T08:27:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7eba0c7641b0009818e469dbfcdd87a0155ab9d4'/>
<id>urn:sha1:7eba0c7641b0009818e469dbfcdd87a0155ab9d4</id>
<content type='text'>
The OPP core currently requires the required opp tables to be available
before the dependent OPP table is added, as it needs to create links
from the dependent OPP table to the required ones. This may not be
convenient for all the platforms though, as this requires strict
ordering for probing the drivers.

This patch allows lazy-linking of the required-opps. The OPP tables for
which the required-opp-tables aren't available at the time of their
initialization, are added to a special list of OPP tables:
lazy_opp_tables. Later on, whenever a new OPP table is registered with
the OPP core, we check if it is required by an OPP table in the pending
list; if yes, then we complete the linking then and there.

An OPP table is marked unusable until the time all its required-opp
tables are available. And if lazy-linking fails for an OPP table, the
OPP core disables all of its OPPs to make sure no one can use them.

Tested-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>opp: Remove dev_pm_opp_set_bw()</title>
<updated>2021-02-02T05:00:53Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2021-01-21T09:57:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=240ae50e23061cd1fe1937daab195c17226ffd2e'/>
<id>urn:sha1:240ae50e23061cd1fe1937daab195c17226ffd2e</id>
<content type='text'>
All the users have migrated to dev_pm_opp_set_opp() now, get rid of the
duplicate API, dev_pm_opp_set_bw(), which only performs a part of the new API.

While at it, remove the unnecessary parameter to _set_opp_bw().

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
</content>
</entry>
<entry>
<title>opp: Implement dev_pm_opp_set_opp()</title>
<updated>2021-02-02T04:58:07Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2021-01-21T06:45:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=abbe348340c7df9e08fd7c24491c1be31ab65370'/>
<id>urn:sha1:abbe348340c7df9e08fd7c24491c1be31ab65370</id>
<content type='text'>
The new helper dev_pm_opp_set_opp() can be used for configuring the
devices for a particular OPP and can be used by different type of
devices, even the ones which don't change frequency (like power
domains).

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
</content>
</entry>
<entry>
<title>opp: Update parameters of  _set_opp_custom()</title>
<updated>2021-02-02T04:58:03Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2021-01-21T07:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=509e4777ca41d30808deda5ae3c1e09e3f58a33f'/>
<id>urn:sha1:509e4777ca41d30808deda5ae3c1e09e3f58a33f</id>
<content type='text'>
Drop the unnecessary parameters and follow the pattern from
_generic_set_opp_regulator().

While at it, also remove the local variable old_freq.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
</content>
</entry>
<entry>
<title>opp: Allow _generic_set_opp_clk_only() to work for non-freq devices</title>
<updated>2021-02-02T04:58:01Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2021-01-21T07:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=35e74b2ee8ec64da6f8067c5b0744f16ff19915b'/>
<id>urn:sha1:35e74b2ee8ec64da6f8067c5b0744f16ff19915b</id>
<content type='text'>
In order to avoid conditional statements at the caller site, this patch
updates _generic_set_opp_clk_only() to work for devices that don't
change frequency (like power domains, etc.). Return 0 if the clk pointer
passed to this routine is not valid.

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