<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/devfreq/devfreq.c, branch v3.16.76</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.16.76</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.16.76'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-02-11T17:53:24+00:00</updated>
<entry>
<title>PM / devfreq: Fix devfreq_add_device() when drivers are built as modules.</title>
<updated>2019-02-11T17:53:24+00:00</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2018-07-04T08:45:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8c349ad1277faf8f4c609321fb11b3aac69c2978'/>
<id>urn:sha1:8c349ad1277faf8f4c609321fb11b3aac69c2978</id>
<content type='text'>
commit 23c7b54ca1cd1797ef39169ab85e6d46f1c2d061 upstream.

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;
[bwh: Backported to 3.16:
 - Use string literal instead of DEVFREQ_GOV_SIMPLE_ONDEMAND
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Propagate error from devfreq_add_device()</title>
<updated>2018-06-16T21:21:45+00:00</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2017-11-06T05:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5cf81a54c156779558718d453a657a086f6c3fc2'/>
<id>urn:sha1:5cf81a54c156779558718d453a657a086f6c3fc2</id>
<content type='text'>
commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream.

Propagate the error of devfreq_add_device() in devm_devfreq_add_device()
rather than statically returning ENOMEM. This makes it slightly faster
to pinpoint the cause of a returned error.

Fixes: 8cd84092d35e ("PM / devfreq: Add resource-managed function for devfreq device")
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL</title>
<updated>2017-03-16T02:26:43+00:00</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2016-12-28T11:52:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2eb579839657b0872c575d3d79ffc9add27d99c1'/>
<id>urn:sha1:2eb579839657b0872c575d3d79ffc9add27d99c1</id>
<content type='text'>
commit 73613b16cb5c5d5a659fc8832eff99eead3f9afb upstream.

This patch fixes the bug of devfreq_add_device(). The devfreq device must
have the default governor. If find_devfreq_governor() returns error,
devfreq_add_device() fail to add the devfreq instance.

Fixes: 1b5c1be2c88e (PM / devfreq: map devfreq drivers to governor using name)
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Add proper locking around list_del()</title>
<updated>2017-03-16T02:26:43+00:00</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@ingics.com</email>
</author>
<published>2016-09-29T02:13:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d462d9e11bf889d7fc9df690b8e442252ec3394'/>
<id>urn:sha1:0d462d9e11bf889d7fc9df690b8e442252ec3394</id>
<content type='text'>
commit 0f376c9cd86c23f37312d37748b233660ef9d9af upstream.

Use devfreq_list_lock around list_del() to prevent list corruption.

Signed-off-by: Axel Lin &lt;axel.lin@ingics.com&gt;
Acked-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Fix incorrect type issue.</title>
<updated>2016-11-20T01:17:39+00:00</updated>
<author>
<name>Xiaolong Ye</name>
<email>yexl@marvell.com</email>
</author>
<published>2015-09-11T03:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3465266e970e0506c7ce7b582db5e433ad8912fa'/>
<id>urn:sha1:3465266e970e0506c7ce7b582db5e433ad8912fa</id>
<content type='text'>
commit 5f25f066f75a67835abb5e400471a27abd09395b upstream.

time_in_state in struct devfreq is defined as unsigned long, so
devm_kzalloc should use sizeof(unsigned long) as argument instead
of sizeof(unsigned int), otherwise it will cause unexpected result
in 64bit system.

Signed-off-by: Xiaolong Ye &lt;yexl@marvell.com&gt;
Signed-off-by: Kevin Liu &lt;kliu5@marvell.com&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Add devm_devfreq_{register,unregister}_opp_notfier function</title>
<updated>2014-05-24T13:33:41+00:00</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2014-05-09T07:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d5b040d0cab9cae1dc1ad61a07019062235f4878'/>
<id>urn:sha1:d5b040d0cab9cae1dc1ad61a07019062235f4878</id>
<content type='text'>
This patch add resource-managed function for devfreq opp as following
functions. The devm_devfreq_register_opp_notifier() manages automatically
the registration of devfreq opp using device resource management.
- devm_devfreq_register_opp_notifier
- devm_devfreq_unregister_opp_notifier()

Signed-off-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 resource-managed function for devfreq device</title>
<updated>2014-05-24T13:33:38+00:00</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2014-05-09T07:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8cd84092d35e52372da2c3c3c2afb1a719917af2'/>
<id>urn:sha1:8cd84092d35e52372da2c3c3c2afb1a719917af2</id>
<content type='text'>
This patch add resource-managed function for devfreq device as following
functions. The devm_devfreq_add_device() manages automatically the memory
of devfreq device using device resource management.
- devm_devfreq_add_device()
- devm_devfreq_remove_device()

Signed-off-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_remove_device() to improve the sequence of resource free</title>
<updated>2014-05-24T13:33:34+00:00</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2014-05-09T07:43:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=585fc83ece43be63d5775e536f855db33dd752cf'/>
<id>urn:sha1:585fc83ece43be63d5775e536f855db33dd752cf</id>
<content type='text'>
This patch modify devfreq_remove_device() to improve the sequence of resource
free. If executing existing devfreq_remove_device(), this function always
executes _remove_devfreq() twice. In result, second _remove_devfreq() always
return error value. So, This patch resolves complicated function sequence
as following:

[Flow sequence before modification]
devfreq_remove_device()
   _remove_devfreq(devfreq, false)
      kfree(devfreq);  /* Free devfreq */
      if (!skip ...) { /* skip is false */
         device_unregister(&amp;devfreq-&gt;dev)
         put_device(&amp;devfreq-&gt;dev);
            ...
            dev-&gt;release()
               devfreq_dev_release()
                  _remove_devfreq(devfreq, true) &lt;- Recall to free devfreq
                  /*
		   * Always return error without freeing resource because
		   * already _remove_devfreq() frees the memory of devfreq.
		   */
   }

[Flow sequence after modification]
devfreq_remove_device
   device_unregister(&amp;devfreq-&gt;dev)
   put_device(&amp;devfreq-&gt;dev);
      ..
      dev-&gt;release()
         devfreq_dev_release()
            _remove_devfreq()
               kfree(devfreq); /* Free devfreq */

Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
[Merge conflict resolved by MyungJoo]
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Rewrite devfreq_update_status() to fix multiple bugs</title>
<updated>2014-03-21T02:16:30+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>skannan@codeaurora.org</email>
</author>
<published>2014-02-28T03:38:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e35d35a1c0b3a7317d77e03e686a4a205cdd4eed'/>
<id>urn:sha1:e35d35a1c0b3a7317d77e03e686a4a205cdd4eed</id>
<content type='text'>
The current devfreq_update_status() has the following bugs:
- If previous frequency doesn't have a valid level, it does an out of bounds
  access into the trans_table and causes memory corruption.
- When the new frequency doesn't have a valid level, the time spent in the
  new frequency is counted towards the next valid frequency switch instead of
  being ignored.
- The time spent on the previous frequency is added to the new frequency's
  stats instead of the previous frequency's stats.

This patch fixes all of this.

Signed-off-by: Saravana Kannan &lt;skannan@codeaurora.org&gt;
Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pm-devfreq'</title>
<updated>2013-11-07T18:24:20+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-11-07T18:24:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=230b4b376e6b860275dccb1c00e7c213ed7fe311'/>
<id>urn:sha1:230b4b376e6b860275dccb1c00e7c213ed7fe311</id>
<content type='text'>
* pm-devfreq:
  PM / devfreq: create_freezable_workqueue() doesn't return an ERR_PTR
  PM / devfreq: Remove duplicate header file inclusion in exynos5_bus.c
  PM / devfreq: Use devm_* APIs in exynos5_bus.c
  PM / devfreq: Remove redundant platform_set_drvdata() in exynos5_bus.c
  PM / devfreq: Fix incorrect usage of IS_ERR_OR_NULL in exynos5_bus.c
</content>
</entry>
</feed>
