<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/base/power, branch v3.10.2</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>PM: Avoid calling kfree() under spinlock in dev_pm_put_subsys_data()</title>
<updated>2013-05-12T12:04:40+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>shuah.kh@samsung.com</email>
</author>
<published>2013-05-07T23:14:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d5e1670afe0c886d6dd92afb7a1f085f88294dc8'/>
<id>d5e1670afe0c886d6dd92afb7a1f085f88294dc8</id>
<content type='text'>
Fix dev_pm_put_subsys_data() so that it doesn't call kfree() under
a spinlock and make it return 1 whenever it leaves NULL
power.subsys_data (regardless of the reason).

Signed-off-by: Shuah Khan &lt;shuah.kh@samsung.com&gt;
Reviewed-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix dev_pm_put_subsys_data() so that it doesn't call kfree() under
a spinlock and make it return 1 whenever it leaves NULL
power.subsys_data (regardless of the reason).

Signed-off-by: Shuah Khan &lt;shuah.kh@samsung.com&gt;
Reviewed-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'pm-assorted'</title>
<updated>2013-04-27T23:54:29+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-04-27T23:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=355c63e5ac963af0ac95e72b74693cfe2527a76b'/>
<id>355c63e5ac963af0ac95e72b74693cfe2527a76b</id>
<content type='text'>
* pm-assorted:
  PM / OPP: add documentation to RCU head in struct opp
  PM / sleep: invalidate TEST_CPUS and TEST_CORE support for freeze state
  PM / sleep: add TEST_PLATFORM support for freeze state
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* pm-assorted:
  PM / OPP: add documentation to RCU head in struct opp
  PM / sleep: invalidate TEST_CPUS and TEST_CORE support for freeze state
  PM / sleep: add TEST_PLATFORM support for freeze state
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / Runtime: Improve prepare handling at system suspend for genpd</title>
<updated>2013-04-12T11:34:57+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2013-04-12T09:41:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=841670351e8e5acbe9f7367f7df661a5d0cfef79'/>
<id>841670351e8e5acbe9f7367f7df661a5d0cfef79</id>
<content type='text'>
When genpd prepares for a system suspend it will fetch a runtime
reference for the device. When returning it we now use the
asyncronous runtime PM API. Thus we don't have to wait for the
device to become idle|suspended before we move on and handle the
next device in queue.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When genpd prepares for a system suspend it will fetch a runtime
reference for the device. When returning it we now use the
asyncronous runtime PM API. Thus we don't have to wait for the
device to become idle|suspended before we move on and handle the
next device in queue.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / Runtime: Asyncronous idle|suspend parent devices at removal</title>
<updated>2013-04-12T11:34:57+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2013-04-12T09:41:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=db28dfac99983e70b5a93b6c81c43d2c74fde20d'/>
<id>db28dfac99983e70b5a93b6c81c43d2c74fde20d</id>
<content type='text'>
For irq safe devices return the runtime reference for the parent
by using the asyncronous runtime PM API. Thus we don't have to
wait for it to become idle|suspended. Instead we can move on and
handle the next device in queue.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For irq safe devices return the runtime reference for the parent
by using the asyncronous runtime PM API. Thus we don't have to
wait for it to become idle|suspended. Instead we can move on and
handle the next device in queue.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / Runtime: Asyncronous idle|suspend devices at system resume</title>
<updated>2013-04-12T11:34:57+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2013-04-12T09:41:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=af93933974d7b4dd1f9003e50bae239760fc7978'/>
<id>af93933974d7b4dd1f9003e50bae239760fc7978</id>
<content type='text'>
Use the asyncronous runtime PM API when returning the runtime
reference for the device after the system resume is completed.

By using the asyncronous runtime PM API we don't have to wait
for each an every device to become idle|suspended. Instead we
can move on and handle the next device in queue.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the asyncronous runtime PM API when returning the runtime
reference for the device after the system resume is completed.

By using the asyncronous runtime PM API we don't have to wait
for each an every device to become idle|suspended. Instead we
can move on and handle the next device in queue.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / OPP: add documentation to RCU head in struct opp</title>
<updated>2013-04-05T12:22:59+00:00</updated>
<author>
<name>Nishanth Menon</name>
<email>nm@ti.com</email>
</author>
<published>2013-03-26T18:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cd787b345e82f7ea9c29d22c50cca29fadc53d76'/>
<id>cd787b345e82f7ea9c29d22c50cca29fadc53d76</id>
<content type='text'>
commit dde8437 (PM / OPP: RCU reclaim) introduced rcu_head for
struct opp. This aids freeing using kfree_rcu. However, we missed
adding documentation for the same. This generates kernel doc warning:
Warning(drivers/base/power/opp.c:70): No description found for
parameter 'head'

Add documentation as appropriate.

[rjw: Changelog]
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit dde8437 (PM / OPP: RCU reclaim) introduced rcu_head for
struct opp. This aids freeing using kfree_rcu. However, we missed
adding documentation for the same. This generates kernel doc warning:
Warning(drivers/base/power/opp.c:70): No description found for
parameter 'head'

Add documentation as appropriate.

[rjw: Changelog]
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / QoS: Avoid possible deadlock related to sysfs access</title>
<updated>2013-04-01T23:25:24+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-04-01T23:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0f703069296664eb7c649c837cc8bb936c3ef07f'/>
<id>0f703069296664eb7c649c837cc8bb936c3ef07f</id>
<content type='text'>
Commit b81ea1b (PM / QoS: Fix concurrency issues and memory leaks in
device PM QoS) put calls to pm_qos_sysfs_add_latency(),
pm_qos_sysfs_add_flags(), pm_qos_sysfs_remove_latency(), and
pm_qos_sysfs_remove_flags() under dev_pm_qos_mtx, which was a
mistake, because it may lead to deadlocks in some situations.
For example, if pm_qos_remote_wakeup_store() is run in parallel
with dev_pm_qos_constraints_destroy(), they may deadlock in the
following way:

 ======================================================
 [ INFO: possible circular locking dependency detected ]
 3.9.0-rc4-next-20130328-sasha-00014-g91a3267 #319 Tainted: G        W
 -------------------------------------------------------
 trinity-child6/12371 is trying to acquire lock:
  (s_active#54){++++.+}, at: [&lt;ffffffff81301631&gt;] sysfs_addrm_finish+0x31/0x60

 but task is already holding lock:
  (dev_pm_qos_mtx){+.+.+.}, at: [&lt;ffffffff81f07cc3&gt;] dev_pm_qos_constraints_destroy+0x23/0x250

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (dev_pm_qos_mtx){+.+.+.}:
        [&lt;ffffffff811811da&gt;] lock_acquire+0x1aa/0x240
        [&lt;ffffffff83dab809&gt;] __mutex_lock_common+0x59/0x5e0
        [&lt;ffffffff83dabebf&gt;] mutex_lock_nested+0x3f/0x50
        [&lt;ffffffff81f07f2f&gt;] dev_pm_qos_update_flags+0x3f/0xc0
        [&lt;ffffffff81f05f4f&gt;] pm_qos_remote_wakeup_store+0x3f/0x70
        [&lt;ffffffff81efbb43&gt;] dev_attr_store+0x13/0x20
        [&lt;ffffffff812ffdaa&gt;] sysfs_write_file+0xfa/0x150
        [&lt;ffffffff8127f2c1&gt;] __kernel_write+0x81/0x150
        [&lt;ffffffff812afc2d&gt;] write_pipe_buf+0x4d/0x80
        [&lt;ffffffff812af57c&gt;] splice_from_pipe_feed+0x7c/0x120
        [&lt;ffffffff812afa25&gt;] __splice_from_pipe+0x45/0x80
        [&lt;ffffffff812b14fc&gt;] splice_from_pipe+0x4c/0x70
        [&lt;ffffffff812b1538&gt;] default_file_splice_write+0x18/0x30
        [&lt;ffffffff812afae3&gt;] do_splice_from+0x83/0xb0
        [&lt;ffffffff812afb2e&gt;] direct_splice_actor+0x1e/0x20
        [&lt;ffffffff812b0277&gt;] splice_direct_to_actor+0xe7/0x200
        [&lt;ffffffff812b15bc&gt;] do_splice_direct+0x4c/0x70
        [&lt;ffffffff8127eda9&gt;] do_sendfile+0x169/0x300
        [&lt;ffffffff8127ff94&gt;] SyS_sendfile64+0x64/0xb0
        [&lt;ffffffff83db7d18&gt;] tracesys+0xe1/0xe6

 -&gt; #0 (s_active#54){++++.+}:
        [&lt;ffffffff811800cf&gt;] __lock_acquire+0x15bf/0x1e50
        [&lt;ffffffff811811da&gt;] lock_acquire+0x1aa/0x240
        [&lt;ffffffff81300aa2&gt;] sysfs_deactivate+0x122/0x1a0
        [&lt;ffffffff81301631&gt;] sysfs_addrm_finish+0x31/0x60
        [&lt;ffffffff812ff77f&gt;] sysfs_hash_and_remove+0x7f/0xb0
        [&lt;ffffffff813035a1&gt;] sysfs_unmerge_group+0x51/0x70
        [&lt;ffffffff81f068f4&gt;] pm_qos_sysfs_remove_flags+0x14/0x20
        [&lt;ffffffff81f07490&gt;] __dev_pm_qos_hide_flags+0x30/0x70
        [&lt;ffffffff81f07cd5&gt;] dev_pm_qos_constraints_destroy+0x35/0x250
        [&lt;ffffffff81f06931&gt;] dpm_sysfs_remove+0x11/0x50
        [&lt;ffffffff81efcf6f&gt;] device_del+0x3f/0x1b0
        [&lt;ffffffff81efd128&gt;] device_unregister+0x48/0x60
        [&lt;ffffffff82d4083c&gt;] usb_hub_remove_port_device+0x1c/0x20
        [&lt;ffffffff82d2a9cd&gt;] hub_disconnect+0xdd/0x160
        [&lt;ffffffff82d36ab7&gt;] usb_unbind_interface+0x67/0x170
        [&lt;ffffffff81f001a7&gt;] __device_release_driver+0x87/0xe0
        [&lt;ffffffff81f00559&gt;] device_release_driver+0x29/0x40
        [&lt;ffffffff81effc58&gt;] bus_remove_device+0x148/0x160
        [&lt;ffffffff81efd07f&gt;] device_del+0x14f/0x1b0
        [&lt;ffffffff82d344f9&gt;] usb_disable_device+0xf9/0x280
        [&lt;ffffffff82d34ff8&gt;] usb_set_configuration+0x268/0x840
        [&lt;ffffffff82d3a7fc&gt;] usb_remove_store+0x4c/0x80
        [&lt;ffffffff81efbb43&gt;] dev_attr_store+0x13/0x20
        [&lt;ffffffff812ffdaa&gt;] sysfs_write_file+0xfa/0x150
        [&lt;ffffffff8127f71d&gt;] do_loop_readv_writev+0x4d/0x90
        [&lt;ffffffff8127f999&gt;] do_readv_writev+0xf9/0x1e0
        [&lt;ffffffff8127faba&gt;] vfs_writev+0x3a/0x60
        [&lt;ffffffff8127fc60&gt;] SyS_writev+0x50/0xd0
        [&lt;ffffffff83db7d18&gt;] tracesys+0xe1/0xe6

 other info that might help us debug this:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(dev_pm_qos_mtx);
                                lock(s_active#54);
                                lock(dev_pm_qos_mtx);
   lock(s_active#54);

  *** DEADLOCK ***

To avoid that, remove the calls to functions mentioned above from
under dev_pm_qos_mtx and introduce a separate lock to prevent races
between functions that add or remove device PM QoS sysfs attributes
from happening.

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit b81ea1b (PM / QoS: Fix concurrency issues and memory leaks in
device PM QoS) put calls to pm_qos_sysfs_add_latency(),
pm_qos_sysfs_add_flags(), pm_qos_sysfs_remove_latency(), and
pm_qos_sysfs_remove_flags() under dev_pm_qos_mtx, which was a
mistake, because it may lead to deadlocks in some situations.
For example, if pm_qos_remote_wakeup_store() is run in parallel
with dev_pm_qos_constraints_destroy(), they may deadlock in the
following way:

 ======================================================
 [ INFO: possible circular locking dependency detected ]
 3.9.0-rc4-next-20130328-sasha-00014-g91a3267 #319 Tainted: G        W
 -------------------------------------------------------
 trinity-child6/12371 is trying to acquire lock:
  (s_active#54){++++.+}, at: [&lt;ffffffff81301631&gt;] sysfs_addrm_finish+0x31/0x60

 but task is already holding lock:
  (dev_pm_qos_mtx){+.+.+.}, at: [&lt;ffffffff81f07cc3&gt;] dev_pm_qos_constraints_destroy+0x23/0x250

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (dev_pm_qos_mtx){+.+.+.}:
        [&lt;ffffffff811811da&gt;] lock_acquire+0x1aa/0x240
        [&lt;ffffffff83dab809&gt;] __mutex_lock_common+0x59/0x5e0
        [&lt;ffffffff83dabebf&gt;] mutex_lock_nested+0x3f/0x50
        [&lt;ffffffff81f07f2f&gt;] dev_pm_qos_update_flags+0x3f/0xc0
        [&lt;ffffffff81f05f4f&gt;] pm_qos_remote_wakeup_store+0x3f/0x70
        [&lt;ffffffff81efbb43&gt;] dev_attr_store+0x13/0x20
        [&lt;ffffffff812ffdaa&gt;] sysfs_write_file+0xfa/0x150
        [&lt;ffffffff8127f2c1&gt;] __kernel_write+0x81/0x150
        [&lt;ffffffff812afc2d&gt;] write_pipe_buf+0x4d/0x80
        [&lt;ffffffff812af57c&gt;] splice_from_pipe_feed+0x7c/0x120
        [&lt;ffffffff812afa25&gt;] __splice_from_pipe+0x45/0x80
        [&lt;ffffffff812b14fc&gt;] splice_from_pipe+0x4c/0x70
        [&lt;ffffffff812b1538&gt;] default_file_splice_write+0x18/0x30
        [&lt;ffffffff812afae3&gt;] do_splice_from+0x83/0xb0
        [&lt;ffffffff812afb2e&gt;] direct_splice_actor+0x1e/0x20
        [&lt;ffffffff812b0277&gt;] splice_direct_to_actor+0xe7/0x200
        [&lt;ffffffff812b15bc&gt;] do_splice_direct+0x4c/0x70
        [&lt;ffffffff8127eda9&gt;] do_sendfile+0x169/0x300
        [&lt;ffffffff8127ff94&gt;] SyS_sendfile64+0x64/0xb0
        [&lt;ffffffff83db7d18&gt;] tracesys+0xe1/0xe6

 -&gt; #0 (s_active#54){++++.+}:
        [&lt;ffffffff811800cf&gt;] __lock_acquire+0x15bf/0x1e50
        [&lt;ffffffff811811da&gt;] lock_acquire+0x1aa/0x240
        [&lt;ffffffff81300aa2&gt;] sysfs_deactivate+0x122/0x1a0
        [&lt;ffffffff81301631&gt;] sysfs_addrm_finish+0x31/0x60
        [&lt;ffffffff812ff77f&gt;] sysfs_hash_and_remove+0x7f/0xb0
        [&lt;ffffffff813035a1&gt;] sysfs_unmerge_group+0x51/0x70
        [&lt;ffffffff81f068f4&gt;] pm_qos_sysfs_remove_flags+0x14/0x20
        [&lt;ffffffff81f07490&gt;] __dev_pm_qos_hide_flags+0x30/0x70
        [&lt;ffffffff81f07cd5&gt;] dev_pm_qos_constraints_destroy+0x35/0x250
        [&lt;ffffffff81f06931&gt;] dpm_sysfs_remove+0x11/0x50
        [&lt;ffffffff81efcf6f&gt;] device_del+0x3f/0x1b0
        [&lt;ffffffff81efd128&gt;] device_unregister+0x48/0x60
        [&lt;ffffffff82d4083c&gt;] usb_hub_remove_port_device+0x1c/0x20
        [&lt;ffffffff82d2a9cd&gt;] hub_disconnect+0xdd/0x160
        [&lt;ffffffff82d36ab7&gt;] usb_unbind_interface+0x67/0x170
        [&lt;ffffffff81f001a7&gt;] __device_release_driver+0x87/0xe0
        [&lt;ffffffff81f00559&gt;] device_release_driver+0x29/0x40
        [&lt;ffffffff81effc58&gt;] bus_remove_device+0x148/0x160
        [&lt;ffffffff81efd07f&gt;] device_del+0x14f/0x1b0
        [&lt;ffffffff82d344f9&gt;] usb_disable_device+0xf9/0x280
        [&lt;ffffffff82d34ff8&gt;] usb_set_configuration+0x268/0x840
        [&lt;ffffffff82d3a7fc&gt;] usb_remove_store+0x4c/0x80
        [&lt;ffffffff81efbb43&gt;] dev_attr_store+0x13/0x20
        [&lt;ffffffff812ffdaa&gt;] sysfs_write_file+0xfa/0x150
        [&lt;ffffffff8127f71d&gt;] do_loop_readv_writev+0x4d/0x90
        [&lt;ffffffff8127f999&gt;] do_readv_writev+0xf9/0x1e0
        [&lt;ffffffff8127faba&gt;] vfs_writev+0x3a/0x60
        [&lt;ffffffff8127fc60&gt;] SyS_writev+0x50/0xd0
        [&lt;ffffffff83db7d18&gt;] tracesys+0xe1/0xe6

 other info that might help us debug this:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(dev_pm_qos_mtx);
                                lock(s_active#54);
                                lock(dev_pm_qos_mtx);
   lock(s_active#54);

  *** DEADLOCK ***

To avoid that, remove the calls to functions mentioned above from
under dev_pm_qos_mtx and introduce a separate lock to prevent races
between functions that add or remove device PM QoS sysfs attributes
from happening.

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / QoS: Remove device PM QoS sysfs attributes at the right place</title>
<updated>2013-03-04T13:23:12+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-03-04T13:22:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37530f2bda039774bd65aea14cc1d1dd26a82b9e'/>
<id>37530f2bda039774bd65aea14cc1d1dd26a82b9e</id>
<content type='text'>
Device PM QoS sysfs attributes, if present during device removal,
are removed from within device_pm_remove(), which is too late,
since dpm_sysfs_remove() has already removed the whole attribute
group they belonged to.  However, moving the removal of those
attributes to dpm_sysfs_remove() alone is not sufficient, because
in theory they still can be re-added right after being removed by it
(the device's driver is still bound to it at that point).

For this reason, move the entire desctruction of device PM QoS
constraints to dpm_sysfs_remove() and make it prevent any new
constraints from being added after it has run.  Also, move the
initialization of the power.qos field in struct device to
device_pm_init_common() and drop the no longer needed
dev_pm_qos_constraints_init().

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Device PM QoS sysfs attributes, if present during device removal,
are removed from within device_pm_remove(), which is too late,
since dpm_sysfs_remove() has already removed the whole attribute
group they belonged to.  However, moving the removal of those
attributes to dpm_sysfs_remove() alone is not sufficient, because
in theory they still can be re-added right after being removed by it
(the device's driver is still bound to it at that point).

For this reason, move the entire desctruction of device PM QoS
constraints to dpm_sysfs_remove() and make it prevent any new
constraints from being added after it has run.  Also, move the
initialization of the power.qos field in struct device to
device_pm_init_common() and drop the no longer needed
dev_pm_qos_constraints_init().

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM / QoS: Fix concurrency issues and memory leaks in device PM QoS</title>
<updated>2013-03-04T13:23:11+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-03-03T21:48:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b81ea1b5ac4d3c6a628158b736dd4a98c46c29d9'/>
<id>b81ea1b5ac4d3c6a628158b736dd4a98c46c29d9</id>
<content type='text'>
The current device PM QoS code assumes that certain functions will
never be called in parallel with each other (for example, it is
assumed that dev_pm_qos_expose_flags() won't be called in parallel
with dev_pm_qos_hide_flags() for the same device and analogously
for the latency limit), which may be overly optimistic.  Moreover,
dev_pm_qos_expose_flags() and dev_pm_qos_expose_latency_limit()
leak memory in error code paths (req needs to be freed on errors)
and __dev_pm_qos_drop_user_request() forgets to free the request.

To fix the above issues put more things under the device PM QoS
mutex to make them mutually exclusive and add the missing freeing
of memory.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current device PM QoS code assumes that certain functions will
never be called in parallel with each other (for example, it is
assumed that dev_pm_qos_expose_flags() won't be called in parallel
with dev_pm_qos_hide_flags() for the same device and analogously
for the latency limit), which may be overly optimistic.  Moreover,
dev_pm_qos_expose_flags() and dev_pm_qos_expose_latency_limit()
leak memory in error code paths (req needs to be freed on errors)
and __dev_pm_qos_drop_user_request() forgets to free the request.

To fix the above issues put more things under the device PM QoS
mutex to make them mutually exclusive and add the missing freeing
of memory.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pm / runtime: force memory allocation with no I/O during Runtime PM callbcack</title>
<updated>2013-02-24T01:50:16+00:00</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2013-02-23T00:34:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=db88175f41a29c1ffff1a6938a7969d206a47326'/>
<id>db88175f41a29c1ffff1a6938a7969d206a47326</id>
<content type='text'>
Apply the introduced memalloc_noio_save() and memalloc_noio_restore() to
force memory allocation with no I/O during runtime_resume/runtime_suspend
callback on device with the flag of 'memalloc_noio' set.

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: David Decotigny &lt;david.decotigny@google.com&gt;
Cc: Tom Herbert &lt;therbert@google.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Oliver Neukum &lt;oneukum@suse.de&gt;
Cc: Jiri Kosina &lt;jiri.kosina@suse.com&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply the introduced memalloc_noio_save() and memalloc_noio_restore() to
force memory allocation with no I/O during runtime_resume/runtime_suspend
callback on device with the flag of 'memalloc_noio' set.

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: David Decotigny &lt;david.decotigny@google.com&gt;
Cc: Tom Herbert &lt;therbert@google.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Oliver Neukum &lt;oneukum@suse.de&gt;
Cc: Jiri Kosina &lt;jiri.kosina@suse.com&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
