<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/power, branch v3.13</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/power?h=v3.13</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/power?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-12-21T23:56:35Z</updated>
<entry>
<title>PM / sleep: Fix memory leak in pm_vt_switch_unregister().</title>
<updated>2013-12-21T23:56:35Z</updated>
<author>
<name>Masami Ichikawa</name>
<email>masami256@gmail.com</email>
</author>
<published>2013-12-19T11:00:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c606850407d9096415e226c75a871d0650404446'/>
<id>urn:sha1:c606850407d9096415e226c75a871d0650404446</id>
<content type='text'>
kmemleak reported a memory leak as below.

unreferenced object 0xffff880118f14700 (size 32):
  comm "swapper/0", pid 1, jiffies 4294877401 (age 123.283s)
  hex dump (first 32 bytes):
    00 01 10 00 00 00 ad de 00 02 20 00 00 00 ad de  .......... .....
    00 d4 d2 18 01 88 ff ff 01 00 00 00 00 04 00 00  ................
  backtrace:
    [&lt;ffffffff814edb1e&gt;] kmemleak_alloc+0x4e/0xb0
    [&lt;ffffffff811889dc&gt;] kmem_cache_alloc_trace+0x1ec/0x260
    [&lt;ffffffff810aba66&gt;] pm_vt_switch_required+0x76/0xb0
    [&lt;ffffffff812f39f5&gt;] register_framebuffer+0x195/0x320
    [&lt;ffffffff8130af18&gt;] efifb_probe+0x718/0x780
    [&lt;ffffffff81391495&gt;] platform_drv_probe+0x45/0xb0
    [&lt;ffffffff8138f407&gt;] driver_probe_device+0x87/0x3a0
    [&lt;ffffffff8138f7f3&gt;] __driver_attach+0x93/0xa0
    [&lt;ffffffff8138d413&gt;] bus_for_each_dev+0x63/0xa0
    [&lt;ffffffff8138ee5e&gt;] driver_attach+0x1e/0x20
    [&lt;ffffffff8138ea40&gt;] bus_add_driver+0x180/0x250
    [&lt;ffffffff8138fe74&gt;] driver_register+0x64/0xf0
    [&lt;ffffffff813913ba&gt;] __platform_driver_register+0x4a/0x50
    [&lt;ffffffff8191e028&gt;] efifb_driver_init+0x12/0x14
    [&lt;ffffffff8100214a&gt;] do_one_initcall+0xfa/0x1b0
    [&lt;ffffffff818e40e0&gt;] kernel_init_freeable+0x17b/0x201

In pm_vt_switch_required(), "entry" variable is allocated via kmalloc().
So, in pm_vt_switch_unregister(), it needs to call kfree() when object
is deleted from list.

Signed-off-by: Masami Ichikawa &lt;masami256@gmail.com&gt;
Reviewed-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pm-sleep'</title>
<updated>2013-11-19T00:07:08Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-11-19T00:07:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b38f67c4ae35eb4bcea0bf42a0a18a778a5d04c2'/>
<id>urn:sha1:b38f67c4ae35eb4bcea0bf42a0a18a778a5d04c2</id>
<content type='text'>
* pm-sleep:
  PM / Hibernate: Do not crash kernel in free_basic_memory_bitmaps()
</content>
</entry>
<entry>
<title>PM / Hibernate: Do not crash kernel in free_basic_memory_bitmaps()</title>
<updated>2013-11-14T22:26:58Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-11-14T22:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6a0c7cd33075f6b7f1d80145bb19812beb3fc5c9'/>
<id>urn:sha1:6a0c7cd33075f6b7f1d80145bb19812beb3fc5c9</id>
<content type='text'>
I have received a report about the BUG_ON() in free_basic_memory_bitmaps()
triggering mysteriously during an aborted s2disk hibernation attempt.
The only way I can explain that is that /dev/snapshot was first
opened for writing (resume mode), then closed and then opened again
for reading and closed again without freezing tasks.  In that case
the first invocation of snapshot_open() would set the free_bitmaps
flag in snapshot_state, which is a static variable.  That flag
wouldn't be cleared later and the second invocation of snapshot_open()
would just leave it like that, so the subsequent snapshot_release()
would see data-&gt;frozen set and free_basic_memory_bitmaps() would be
called unnecessarily.

To prevent that from happening clear data-&gt;free_bitmaps in
snapshot_open() when the file is being opened for reading (hibernate
mode).

In addition to that, replace the BUG_ON() in free_basic_memory_bitmaps()
with a WARN_ON() as the kernel can continue just fine if the condition
checked by that macro occurs.

Fixes: aab172891542 (PM / hibernate: Fix user space driven resume regression)
Reported-by: Oliver Lorenz &lt;olli@olorenz.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
</content>
</entry>
<entry>
<title>Merge branch 'pm-sleep'</title>
<updated>2013-11-07T18:26:55Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-11-07T18:26:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=feba070dbac6f7b477570e590a7dc960b7b0f784'/>
<id>urn:sha1:feba070dbac6f7b477570e590a7dc960b7b0f784</id>
<content type='text'>
* pm-sleep:
  PM / hibernate: Avoid overflow in hibernate_preallocate_memory()
</content>
</entry>
<entry>
<title>PM / hibernate: Avoid overflow in hibernate_preallocate_memory()</title>
<updated>2013-11-07T00:58:39Z</updated>
<author>
<name>Aaron Lu</name>
<email>aaron.lu@intel.com</email>
</author>
<published>2013-11-06T00:41:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fd432b9f8c7c88428a4635b9f5a9c6e174df6e36'/>
<id>urn:sha1:fd432b9f8c7c88428a4635b9f5a9c6e174df6e36</id>
<content type='text'>
When system has a lot of highmem (e.g. 16GiB using a 32 bits kernel),
the code to calculate how much memory we need to preallocate in
normal zone may cause overflow. As Leon has analysed:

 It looks that during computing 'alloc' variable there is overflow:
 alloc = (3943404 - 1970542) - 1978280 = -5418 (signed)
 And this function goes to err_out.

Fix this by avoiding that overflow.

References: https://bugzilla.kernel.org/show_bug.cgi?id=60817
Reported-and-tested-by: Leon Drugi &lt;eyak@wp.pl&gt;
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Aaron Lu &lt;aaron.lu@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pm-sleep'</title>
<updated>2013-10-28T00:28:07Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-10-28T00:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e0ca95aa3c83c47d13f9f400bfaaa853d0b224b'/>
<id>urn:sha1:6e0ca95aa3c83c47d13f9f400bfaaa853d0b224b</id>
<content type='text'>
* pm-sleep:
  PM / Hibernate: Use bool for boolean fields of struct snapshot_data
  PM / Sleep: Detect device suspend/resume lockup and log event
</content>
</entry>
<entry>
<title>Merge branch 'pm-qos'</title>
<updated>2013-10-28T00:27:21Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-10-28T00:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=400fc45273d53837390bf1a24f5930c1ad9de61e'/>
<id>urn:sha1:400fc45273d53837390bf1a24f5930c1ad9de61e</id>
<content type='text'>
* pm-qos:
  PM / QoS: simplify pm_qos_power_write()
</content>
</entry>
<entry>
<title>PM / hibernate: Move software_resume to late_initcall_sync</title>
<updated>2013-10-24T23:58:49Z</updated>
<author>
<name>Russ Dill</name>
<email>Russ.Dill@ti.com</email>
</author>
<published>2013-10-24T13:25:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d3c345dbc7c083414ef74eb22ff26ba2bd100759'/>
<id>urn:sha1:d3c345dbc7c083414ef74eb22ff26ba2bd100759</id>
<content type='text'>
software_resume is being called after deferred_probe_initcall in
drivers base. If the probing of the device that contains the resume
image is deferred, and the system has been instructed to wait for
it to show up, this wait will occur in software_resume. This causes
a deadlock.

Move software_resume into late_initcall_sync so that it happens
after all the other late_initcalls.

Signed-off-by: Russ Dill &lt;Russ.Dill@ti.com&gt;
Acked-by: Pavel Machek &lt;Pavel@ucw.cz&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / Hibernate: Use bool for boolean fields of struct snapshot_data</title>
<updated>2013-10-18T20:20:40Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-10-18T20:20:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7bc9b1cffc95675a957e870d258e95d43dcbba0b'/>
<id>urn:sha1:7bc9b1cffc95675a957e870d258e95d43dcbba0b</id>
<content type='text'>
The snapshot_data structure used internally by the hibernate user
space interface code in user.c has three char fields that are used
to store boolean values.  Change their data type to bool and use
true and false instead of 1 and 0, respectively, in assignments
involving those fields.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / Sleep: Detect device suspend/resume lockup and log event</title>
<updated>2013-10-18T11:33:08Z</updated>
<author>
<name>Benoit Goby</name>
<email>benoit@android.com</email>
</author>
<published>2013-10-17T17:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=70fea60d888d472ac044910fd0dc46b304419705'/>
<id>urn:sha1:70fea60d888d472ac044910fd0dc46b304419705</id>
<content type='text'>
Rather than hard-lock the kernel, dump the suspend/resume thread stack
and panic() to capture a message in pstore when a driver takes too long
to suspend/resume. Default suspend/resume watchdog timeout is set to 12
seconds to be longer than the usbhid 10 second timeout, but could be
changed at compile time.

Exclude from the watchdog the time spent waiting for children that
are resumed asynchronously and time every device, whether or not they
resumed synchronously.

This patch is targeted for mobile devices where a suspend/resume lockup
could cause a system reboot. Information about failing device can be
retrieved in subsequent boot session by mounting pstore and inspecting
the log. Laptops with EFI-enabled pstore could also benefit from
this feature.

The hardware watchdog timer is likely suspended during this time and
couldn't be relied upon. The soft-lockup detector would eventually tell
that tasks are not scheduled, but would provide little context as to why.
The patch hence uses system timer and assumes it is still active while the
devices are suspended/resumed.

This feature can be enabled/disabled during kernel configuration.

This change is based on earlier work by San Mehat.

Signed-off-by: Benoit Goby &lt;benoit@android.com&gt;
Signed-off-by: Zoran Markovic &lt;zoran.markovic@linaro.org&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
