<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/devfreq/devfreq.c, branch v5.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-12-11T02:40:13Z</updated>
<entry>
<title>PM / devfreq: add devfreq_suspend/resume() functions</title>
<updated>2018-12-11T02:40:13Z</updated>
<author>
<name>Lukasz Luba</name>
<email>l.luba@partner.samsung.com</email>
</author>
<published>2018-12-05T11:05:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5903195605287681f55094bbcdf8711ea109969b'/>
<id>urn:sha1:5903195605287681f55094bbcdf8711ea109969b</id>
<content type='text'>
This patch adds implementation for global suspend/resume for
devfreq framework. System suspend will next use these functions.

Suggested-by: Tobias Jakobi &lt;tjakobi@math.uni-bielefeld.de&gt;
Suggested-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Lukasz Luba &lt;l.luba@partner.samsung.com&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: add support for suspend/resume of a devfreq device</title>
<updated>2018-12-11T02:09:47Z</updated>
<author>
<name>Lukasz Luba</name>
<email>l.luba@partner.samsung.com</email>
</author>
<published>2018-12-05T11:05:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83f8ca45afbf041e312909f442128b99657d90b7'/>
<id>urn:sha1:83f8ca45afbf041e312909f442128b99657d90b7</id>
<content type='text'>
The patch prepares devfreq device for handling suspend/resume
functionality. The new fields will store needed information during this
process. Devfreq framework handles opp-suspend DT entry and there is no
need of modyfications in the drivers code. It uses atomic variables to
make sure no race condition affects the process.

Suggested-by: Tobias Jakobi &lt;tjakobi@math.uni-bielefeld.de&gt;
Suggested-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Lukasz Luba &lt;l.luba@partner.samsung.com&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: refactor set_target frequency function</title>
<updated>2018-12-11T02:09:44Z</updated>
<author>
<name>Lukasz Luba</name>
<email>l.luba@partner.samsung.com</email>
</author>
<published>2018-12-05T11:05:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=633141721b5bfce7017033a767208af591134b8f'/>
<id>urn:sha1:633141721b5bfce7017033a767208af591134b8f</id>
<content type='text'>
The refactoring is needed for the new client in devfreq: suspend.
To avoid code duplication, move it to the new local function
devfreq_set_target.

Suggested-by: Tobias Jakobi &lt;tjakobi@math.uni-bielefeld.de&gt;
Suggested-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Lukasz Luba &lt;l.luba@partner.samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: remove redundant null pointer check before kfree</title>
<updated>2018-10-02T01:16:41Z</updated>
<author>
<name>zhong jiang</name>
<email>zhongjiang@huawei.com</email>
</author>
<published>2018-09-21T13:18:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8188b154f95014dae4d19892fefb202c8df3f885'/>
<id>urn:sha1:8188b154f95014dae4d19892fefb202c8df3f885</id>
<content type='text'>
kfree has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree.

Signed-off-by: zhong jiang &lt;zhongjiang@huawei.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: stopping the governor before device_unregister()</title>
<updated>2018-10-02T01:16:41Z</updated>
<author>
<name>Vincent Donnefort</name>
<email>vincent.donnefort@arm.com</email>
</author>
<published>2018-09-03T00:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f061fd0c2d852e32e03a903fccd810663c5c31e'/>
<id>urn:sha1:2f061fd0c2d852e32e03a903fccd810663c5c31e</id>
<content type='text'>
device_release() is freeing the resources before calling the device
specific release callback which is, in the case of devfreq, stopping
the governor.

It is a problem as some governors are using the device resources. e.g.
simpleondemand which is using the devfreq deferrable monitoring work. If it
is not stopped before the resources are freed, it might lead to a use after
free.

Signed-off-by: Vincent Donnefort &lt;vincent.donnefort@arm.com&gt;
Reviewed-by: John Einar Reitan &lt;john.reitan@arm.com&gt;
[cw00.choi: Fix merge conflict]
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Fix handling of min/max_freq == 0</title>
<updated>2018-10-02T01:16:41Z</updated>
<author>
<name>Matthias Kaehlcke</name>
<email>mka@chromium.org</email>
</author>
<published>2018-08-03T20:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=df5cf4a36178c5d4f2b8b9469cb2f722e64cd102'/>
<id>urn:sha1:df5cf4a36178c5d4f2b8b9469cb2f722e64cd102</id>
<content type='text'>
Commit ab8f58ad72c4 ("PM / devfreq: Set min/max_freq when adding the
devfreq device") initializes df-&gt;min/max_freq with the min/max OPP when
the device is added. Later commit f1d981eaecf8 ("PM / devfreq: Use the
available min/max frequency") adds df-&gt;scaling_min/max_freq and the
following to the frequency adjustment code:

  max_freq = MIN(devfreq-&gt;scaling_max_freq, devfreq-&gt;max_freq);

With the current handling of min/max_freq this is incorrect:

Even though df-&gt;max_freq is now initialized to a value != 0 user space
can still set it to 0, in this case max_freq would be 0 instead of
df-&gt;scaling_max_freq as intended. In consequence the frequency adjustment
is not performed:

  if (max_freq &amp;&amp; freq &gt; max_freq) {
	freq = max_freq;

To fix this set df-&gt;min/max freq to the min/max OPP in max/max_freq_store,
when the user passes a value of 0. This also prevents df-&gt;max_freq from
being set below the min OPP when df-&gt;min_freq is 0, and similar for
min_freq. Since it is now guaranteed that df-&gt;min/max_freq can't be 0 the
checks for this case can be removed.

Fixes: f1d981eaecf8 ("PM / devfreq: Use the available min/max frequency")
Signed-off-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Drop custom MIN/MAX macros</title>
<updated>2018-10-02T01:16:41Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2018-04-24T19:46:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0e464205b8a1fa21357aad0bbf136500d7e688d'/>
<id>urn:sha1:d0e464205b8a1fa21357aad0bbf136500d7e688d</id>
<content type='text'>
Drop the custom MIN/MAX macros in favour of the standard min/max from
kernel.h

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Fix devfreq_add_device() when drivers are built as modules.</title>
<updated>2018-10-02T01:16:41Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2018-07-04T08:45:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23c7b54ca1cd1797ef39169ab85e6d46f1c2d061'/>
<id>urn:sha1:23c7b54ca1cd1797ef39169ab85e6d46f1c2d061</id>
<content type='text'>
When the devfreq driver and the governor driver are built as modules,
the call to devfreq_add_device() or governor_store() fails because the
governor driver is not loaded at the time the devfreq driver loads. The
devfreq driver has a build dependency on the governor but also should
have a runtime dependency. We need to make sure that the governor driver
is loaded before the devfreq driver.

This patch fixes this bug by adding a try_then_request_governor()
function. First tries to find the governor, and then, if it is not found,
it requests the module and tries again.

Fixes: 1b5c1be2c88e (PM / devfreq: map devfreq drivers to governor using name)
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Init user limits from OPP limits, not viceversa</title>
<updated>2018-07-18T04:58:38Z</updated>
<author>
<name>Matthias Kaehlcke</name>
<email>mka@chromium.org</email>
</author>
<published>2018-05-25T20:30:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c2cb1e6b05b90d55b4b943646faa3cfbdf78f6e'/>
<id>urn:sha1:2c2cb1e6b05b90d55b4b943646faa3cfbdf78f6e</id>
<content type='text'>
Commit ab8f58ad72c4 ("PM / devfreq: Set min/max_freq when adding
the devfreq device") introduced the initialization of the user
limits min/max_freq from the lowest/highest available OPPs. Later
commit f1d981eaecf8 ("PM / devfreq: Use the available min/max
frequency") added scaling_min/max_freq, which actually represent
the frequencies of the lowest/highest available OPP. scaling_min/
max_freq are initialized with the values from min/max_freq, which
is totally correct in the context, but a bit awkward to read.

Swap the initialization and assign scaling_min/max_freq with the
OPP freqs and then the user limts min/max_freq with scaling_min/
max_freq.

Needless to say that this change is a NOP, intended to improve
readability.

Signed-off-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Reviewed-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: use put_device() instead of kfree()</title>
<updated>2018-07-18T04:56:49Z</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2018-03-30T11:44:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d803dc8f7a5f622ac47c3b650834ada3a2659b9'/>
<id>urn:sha1:2d803dc8f7a5f622ac47c3b650834ada3a2659b9</id>
<content type='text'>
Never directly free @dev after calling device_register() or
device_unregister(), even if device_register() returned an error.
Always use put_device() to give up the reference initialized.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
</feed>
