<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/power/disk.c, branch v2.6.24</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=v2.6.24</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.24'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-11-15T02:45:43Z</updated>
<entry>
<title>hibernate: fix lockdep report</title>
<updated>2007-11-15T02:45:43Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes@sipsolutions.net</email>
</author>
<published>2007-11-15T01:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=60a0d23386eab0559ad32ae50b200cc58545f327'/>
<id>urn:sha1:60a0d23386eab0559ad32ae50b200cc58545f327</id>
<content type='text'>
Lockdep reports a circular locking dependency in the hibernate code
because
 - during system boot hibernate code (from an initcall) locks pm_mutex
   and then a sysfs buffer mutex via name_to_dev_t
 - during regular operation hibernate code locks pm_mutex under a
   sysfs buffer mutex because it's called from sysfs methods.

The deadlock can never happen because during initcall invocation nothing
can write to sysfs yet. This removes the lockdep report by marking the
initcall locking as being in a different class.

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Hibernation: Enter platform hibernation state in a consistent way</title>
<updated>2007-10-18T21:37:20Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-10-18T10:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9cd9a0058dd35268b24fa16795a92c800f4086d4'/>
<id>urn:sha1:9cd9a0058dd35268b24fa16795a92c800f4086d4</id>
<content type='text'>
Make hibernation_platform_enter() execute the enter-a-sleep-state sequence
instead of the mixed shutdown-with-entering-S4 thing.

Replace the shutting down of devices done by kernel_shutdown_prepare(), before
entering the ACPI S4 sleep state, with suspending them and the shutting down
of sysdevs with calling device_power_down(PMSG_SUSPEND) (just like before
entering S1 or S3, but the target state is now S4).   Also, disable the
nonboot CPUs before entering the sleep state (S4), which generally always is a
good idea.

This is known to fix the "double disk spin down during hibernation" on some
machines, eg.  HPC nx6325 (ref.  http://lkml.org/lkml/2007/8/7/316 and the
following thread).   Moreover, it has been reported to make
/sys/class/rtc/rtc0/wakealarm work correctly with hibernation for some users.
It also generally causes the hibernation state (ACPI S4) to be entered faster.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Hibernation: Check if ACPI is enabled during restore in the right place</title>
<updated>2007-10-18T21:37:20Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-10-18T10:04:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7e0831d385d620a58d95b25e4afa9b643f9a411'/>
<id>urn:sha1:c7e0831d385d620a58d95b25e4afa9b643f9a411</id>
<content type='text'>
The following scenario leads to total confusion of the platform firmware on
some boxes (eg. HPC nx6325):
* Hibernate with ACPI enabled
* Resume passing "acpi=off" to the boot kernel

To prevent this from happening it's necessary to check if ACPI is enabled (and
enable it if that's not the case) _right_ _after_ control has been transfered
from the boot kernel to the image kernel, before device_power_up() is called
(ie.  with interrupts disabled).   Enabling ACPI after calling
device_power_up() turns out to be insufficient.

For this reason, introduce new hibernation callback -&gt;leave() that will be
executed before device_power_up() by the restored image kernel.   To make it
work, it also is necessary to move swsusp_suspend() from swsusp.c to disk.c
(it's name is changed to "create_image", which is more up to the point).

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>freezer: do not sync filesystems from freeze_processes</title>
<updated>2007-10-18T21:37:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-10-18T10:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=232b14328050a4639130b0dec185f43968e72035'/>
<id>urn:sha1:232b14328050a4639130b0dec185f43968e72035</id>
<content type='text'>
The syncing of filesystems from within the freezer is generally not needed.
Also, if there's an ext3 filesystem loopback-mounted from a FUSE one, the
syncing results in writes to it and deadlocks.  Similarly, it will deadlock if
FUSE implements sync.

Change freeze_processes() so that it doesn't execute sys_sync() and make the
suspend and hibernation code path sync filesystems independently of the
freezer.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>PM: Rename hibernation_ops to platform_hibernation_ops</title>
<updated>2007-10-18T21:37:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-10-18T10:04:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3dac3b304bdfbb06e92b0d4bba9ecab006795e6'/>
<id>urn:sha1:b3dac3b304bdfbb06e92b0d4bba9ecab006795e6</id>
<content type='text'>
Rename 'struct hibernation_ops' to 'struct platform_hibernation_ops' in
analogy with 'struct platform_suspend_ops'.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Len Brown &lt;lenb@kernel.org&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>
</entry>
<entry>
<title>PM: Rework struct hibernation_ops</title>
<updated>2007-10-18T21:37:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-10-18T10:04:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74f270af0c1ed5b9d4413784256959dcfe3593ce'/>
<id>urn:sha1:74f270af0c1ed5b9d4413784256959dcfe3593ce</id>
<content type='text'>
During hibernation we also need to tell the ACPI core that we're going to put
the system into the S4 sleep state.  For this reason, an additional method in
'struct hibernation_ops' is needed, playing the role of set_target() in
'struct platform_suspend_operations'.  Moreover, the role of the .prepare()
method is now different, so it's better to introduce another method, that in
general may be different from .prepare(), that will be used to prepare the
platform for creating the hibernation image (.prepare() is used anyway to
notify the platform that we're going to enter the low power state after the
image has been saved).

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix ThinkPad T42 poweroff failure introduced by by "PM: Introduce pm_power_off_prepare"</title>
<updated>2007-07-26T19:13:06Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-07-26T14:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=58b3b71dfaaecbf7cff1fe10c049d663f0313e5f'/>
<id>urn:sha1:58b3b71dfaaecbf7cff1fe10c049d663f0313e5f</id>
<content type='text'>
Commit bd804eba1c8597cbb7cd5a5f9fe886aae16a079a ("PM: Introduce
pm_power_off_prepare") caused problems in the poweroff path, as reported by
YOSHIFUJI Hideaki / 吉藤英明.

Generally, sysdev_shutdown() should be called after the ACPI preparation for
powering the system off.  To make it happen, we can separate sysdev_shutdown()
from device_shutdown() and call it directly wherever necessary.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Tested-by: YOSHIFUJI Hideaki / 吉藤英明 &lt;yoshfuji@linux-ipv6.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>PM: introduce hibernation and suspend notifiers</title>
<updated>2007-07-19T17:04:42Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-07-19T08:47:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b10d911749d37dccfa5873d2088aea3f074b9e45'/>
<id>urn:sha1:b10d911749d37dccfa5873d2088aea3f074b9e45</id>
<content type='text'>
Make it possible to register hibernation and suspend notifiers, so that
subsystems can perform hibernation-related or suspend-related operations that
should not be carried out by device drivers' .suspend() and .resume()
routines.

[akpm@linux-foundation.org: build fixes]
[akpm@linux-foundation.org: cleanups]
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Hibernation: prepare to enter the low power state</title>
<updated>2007-07-19T17:04:42Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-07-19T08:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1457bcc3a00a0446c7f6e2f22fd24b6d8d0a309'/>
<id>urn:sha1:b1457bcc3a00a0446c7f6e2f22fd24b6d8d0a309</id>
<content type='text'>
During hibernation we call hibernation_ops-&gt;prepare() before creating the image,
but then, before saving it, we cancel the power transition by calling
hibernation_ops-&gt;finish().  Thus prior to calling hibernation_ops-&gt;enter() we
should let the platform firmware know that we're going to enter the low power
state after all.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Gautham R Shenoy &lt;ego@in.ibm.com&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>swsusp: fix hibernation code ordering</title>
<updated>2007-07-19T17:04:42Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-07-19T08:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10a1803d667e209914eaada9b95525252f23ec78'/>
<id>urn:sha1:10a1803d667e209914eaada9b95525252f23ec78</id>
<content type='text'>
Change the code ordering so that hibernation_ops-&gt;prepare() is called after
device_suspend().  This is needed so that we don't violate the ACPI
specification, which states that the _PTS and _GTS system-control methods,
executed from acpi_sleep_prepare(), ought to be called after devices have been
put in low power states.

The "Finish" label in hibernation_restore() is moved, because device_suspend()
resumes devices if the suspending of them fails and the restore code ordering
should reflect the hibernation code ordering.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
