| Age | Commit message (Collapse) | Author |
|
Add a swsusp debugging mode. This does everything that's needed for a suspend
except for actually suspending. So we can look in the log messages and work
out a) what code is being slow and b) which drivers are misbehaving.
(1)
# echo testproc > /sys/power/disk
# echo disk > /sys/power/state
This should turn off the non-boot CPU, freeze all processes, wait for 5
seconds and then thaw the processes and the CPU.
(2)
# echo test > /sys/power/disk
# echo disk > /sys/power/state
This should turn off the non-boot CPU, freeze all processes, shrink
memory, suspend all devices, wait for 5 seconds, resume the devices etc.
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Stefan Seyfried <seife@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This adds a new pm_message_t event type to use when preparing to restore a
swsusp snapshot. Devices that have been initialized by Linux after resume
(rather than left in power-up-reset state) may need to be reset; this new
event type give drivers the chance to do that.
The drivers that will care about this are those which understand more hardware
states than just "on" and "reset", relying on hardware state during resume()
methods to be either the state left by the preceding suspend(), or a
power-lost reset. The best current example of this class of drivers are USB
host controller drivers, which currently do not work through swsusp when
they're statically linked.
When the swsusp freeze/thaw mechanism kicks in, a troublesome third state
could exist: one state set up by a different kernel instance, before a
snapshot image is resumed. This mechanism lets drivers prevent that state.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Allow devices to participate in the suspend process more intimately,
in particular, allow the final phase (with interrupts disabled) to
also be open to normal devices, not just system devices.
Also, allow classes to participate in device suspend.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|
|
Print more diagnostic info to help identify the source of power management
suspend failures.
Example:
usb_hcd_pci_suspend(): pci_set_power_state+0x0/0x1af() returns -22
pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x11b() returns -22
suspend_device(): pci_device_suspend+0x0/0x34() returns -22
Work-in-progress. It needs lots more suspend_report_result() calls sprinkled
everywhere.
Cc: Patrick Mochel <mochel@digitalimplant.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Nigel Cunningham <nigel@suspend2.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Move externs from C source files to header files.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Since few people need the support anymore, this moves the legacy
pm_xxx functions to CONFIG_PM_LEGACY, and include/linux/pm_legacy.h.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add pm_ops.valid callback, so only the available pm states show in
/sys/power/state. And this also makes an earlier states error report at
enter_state before we do actual suspend/resume.
Signed-off-by: Shaohua Li<shaohua.li@intel.com>
Acked-by: Pavel Machek<pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
With CONFIG_PM=n:
drivers/built-in.o(.text+0x1098c): In function `hub_thread':
drivers/usb/core/hub.c:2673: undefined reference to `.dpm_runtime_resume'
drivers/built-in.o(.text+0x10998):drivers/usb/core/hub.c:2674: undefined reference to `.dpm_runtime_resume'
Please, never ever ever put extern decls into .c files. Use the darn header
files :(
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
This saves a word from "struct device" ... there's a refcounting mechanism
stub that's rather ineffective (the values are never even tested!), which
can safely be deleted. With this patch it uses normal device refcounting,
so any potential users of the pm_parent mechanism will be more correct.
(That mechanism is actually unusable for now though; it does nothing.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/power/main.c | 26 +++-----------------------
include/linux/pm.h | 1 -
2 files changed, 3 insertions(+), 24 deletions(-)
|
|
This is a refresh of an earlier patch to add "wakeup" support to the
PM core model. This provides per-device bus-neutral control of the
use of wakeup events.
* "struct device_pm_info" has two bits that are initialized as
part of setting up the enclosing struct device:
- "can_wakeup", reflecting hardware capabilities
- "may_wakeup", the policy setting (when CONFIG_PM)
* There's a writeable sysfs "wakeup" file, with one of two values:
- "enabled", when the policy is to allow wakeup
- "disabled", when the policy is not to allow it
- "" if the device can't currently issue wakeups
By default, wakeup is enabled on all devices that support it. If its
driver doesn't support it ... treat it as a bug. :)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
This adds type-checking to pm_message_t, so that people can't confuse it
with int or u32. It also allows us to fix "disk yoyo" during suspend (disk
spinning down/up/down).
[We've tried that before; since that cpufreq problems were fixed and I've
tried make allyes config and fixed resulting damage.]
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Alexander Nyberg <alexn@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: Len Brown <len.brown@intel.com>
|
|
Register an "acpi" system device to be notified of shutdown preparation.
This depends on CONFIG_PM
http://bugzilla.kernel.org/show_bug.cgi?id=4041
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
|
|
Without this patch, Linux provokes emergency disk shutdowns and
similar nastiness. It was in SuSE kernels for some time, IIRC.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This is a megarollup of ~60 patches which give various things static scope.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This introduces pm_message_t. For now, it is only good for type-safety and
sparse checking, but plan is to turn pm_message_t into structure soon.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
arch/arm/common/sa1111.c: In function `sa1111_suspend':
arch/arm/common/sa1111.c:816: warning: assignment from incompatible pointer type
This is a rather annoying, and IMHO pointless warning. First question:
what is the reasoning for using an array of unsigned bytes here? Are we
expecting to power manage devices which only have byte wide registers?
In reality, devices have half-word and word sized registers as well, which
means that dev->power.saved_state actually points to device specific data
(or even device driver specific data) for the device. As such, it makes
far more sense for this to be a 'void *'.
I'd rather not go around the ARM kernel tree adding pointless casts to 'u8
*' and back again because the wrong type for this was picked in the
structure definition, so here's a patch which changes this to void *.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This adds typechecking to suspend types and powerdown types. This should
solve at least part of suspend type confusion. There should be no code
changes generated by this one.
Acked-by: Patrick Mochel <mochel@digitalimplant.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
cutting back some unused legacy PM code
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Changes the PM_SUSPEND_MEM (and PM_SUSPEND_DISK) enum values so that
they make sense as PCI device power states.
(a) Fixes bugs whereby PCI drivers are being given bogus values.
This should resolve OSDL bugid 2886 without changing the PCI
API (its PM calls still act as on 2.4 kernels).
(b) Doesn't change the awkward assumption in the 2.6 PMcore that
the /sys/bus/*/devices/power/state, /proc/acpi/sleep,
dev->power.power_state, and dev->detach_state files share
the same numeric codes ... even for busses very unlike PCI,
or systems with several "on" policies as well as STD and STR,
or with device-PM transtions with no system-wide equivalent.
Really we need to move away from "u32" codes that are easily confused
with each other, towards typed values (probably struct pointers), but
that's a long-term change and we need the PCI issue fixed sooner.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
|
|
Attached is a smallish patch for couple trivial sparse warnings in
allnoconfig build and more importantly an "excuses" text file explaining
why the rest have not been fixed.
Basically all of them (with the exception of the one in Andrews tree) need
some serious re-engineering.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
A patch to fix my previous
leave-runtime-suspended-devices-off-at-system-resume patch; the new
changes save a copy of power.power_state in order to know whether to
resume a device, independently of mods to that field by a driver suspend
routine. This fixes 2.6.7-rc1-mm1 in the same fashion as the updated
2.6.6 patch sent previously.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
|
|
- Revert names of functions back to device_{suspend,resume} since at least
APM are still using them.
|
|
Suspend-to-disk can be handled in numerous ways, some we have control over,
and others we don't. The biggest difference is whether or not the firmware
is responsible for entering a low-power state or if the platform driver is.
The two modes are incompatible, so we enable the platform driver tell the
PM core when they register their pm_ops (via the ->pm_disk_mode) field.
If the firmware is responsible, then it will also write memory to disk,
while the kernel is otherwise responsible. However, a user may choose to
use the in-kernel suspend mechanism, even if the system supports only
the firmware mechanism. Instead of entering a low-power state, the system
will turn off (or reboot for testing).
A sysfs file -- /sys/power/disk -- is available to set the mode to one of:
'firmware'
'platform'
'shutdown'
'reboot'
The latter two are settable any time, and assume that one is using swsusp.
The other two are only settable to what the platform supports.
|
|
- Expand pm_power_down() into struct pm_ops, with ->prepare(), ->enter()
and ->finish() methods, so the platform drivers get called to do start
and stop work during suspend sequence.
- Make sure devices are suspended/resumed in enter_state(), and that they
are powered down in pm_suspend_mem() and pm_suspend_standby().
- Call ->prepare() in suspend_prepare() and ->finish() in suspend_finish().
|
|
- Implement pm_suspend(), which is callable from anywhere in the kernel,
and takes one of
PM_SUSPEND_STANDBY
PM_SUSPEND_MEM
PM_SUSPEND_DISK
and enters the appropriate state.
- Change sysfs file to look for
"standby"
"mem"
"disk"
for what state to enter (rather than 'suspend' and 'hibernate' for the
latter two).
- Add pm_sem to block multiple suspend sequences happening at once.
- Allocate a console and stop processes from common code before entering
state.
- Add pm_power_down() callback for platform drivers to implement. Will be
called to actually enter the low-power state.
|
|
|
|
- Add ->pm_users and ->pm_parent fields to struct dev_pm_info.
- Add function device_pm_set_parent()
The default power parent for a device is the device's physical parent, but
a driver may change it to represent a tranversal power dependency.
Though it's not incorporated into the suspend/resume sequences yet, the
core will respect the power tree, rather than the physical/electrical one.
Also added is a power usage count for devices, which indicates how many
devices are dependent on that one for power (how many children it has in
the power tree). The core will use this count to determine whether or not
a device can be put into a low power state or not.
|
|
- Split calls into
- device_pm_suspend() [ Saving device state. ]
- device_pm_power_down() [ Powering devices down. ]
- device_pm_power_up() [ Powering devices up. ]
- device_pm_resume() [ Restoring device state. ]
- Walk local dpm_active list when suspending devices, and move devices to
dpm_suspended list when ->suspend() is called.
- Walk dpm_suspended list to power down devices (with interrrupts enabled.)
- Try to power down devices with IRQs on.
- If they succeed, move them to dpm_off list.
- If they return -EAGAIN, move them to dpm_off_irq list.
- Disable interrupts and suspend devices needed interrupts off.
- Do converse on resume
- power on devices that need interrupts off and move them to
dpm_suspended.
- Enable interrupts.
- Power on all other devices and move them to dpm_suspended.
- Restore state of all devices and move them to dpm_active.
|
|
- struct device_pm_info
- Defined in include/linux/pm.h.
- Statically allocated in struct device (->power)
- Body is empty if CONFIG_PM=n
- deivce_pm_{add,remove}
- Called from device_{add,del} respectively.
- Adds device to internal list of power managed objects and creates
attribute group for device.
(Group currently empty, but placeholder directory is created for now)
- Are defined as empty statc inline's when CONFIG_PM=n.
|
|
- Move kernel/pm.c to kernel/power/pm.c
- Move poweroff sysrq registration to kernel/power/poweroff.c
- Mark pm_* functions deprecated to prevent new uers.
|
|
minor nit, but it seems the tkill() patch added a sys_tkill entry without
removing an ia64_ni_syscall entry.
|
|
- Anton Altaparmakov: NTFS error checking
- Johannes Erdfelt: USB updates
- OGAWA Hirofumi: FAT update
- Alan Cox: driver + s390 update merge
- Richard Henderson: fix alpha sigsuspend error return value
- Marcelo Tosatti: per-zone VM shortage
- Daniel Phillips: generic use-once optimization instead of drop-behind
- Bjorn Wesen: Cris architecture update
- Anton Altaparmakov: support for Windows Dynamic Disks
- James Washer: LDT loading SMP bug fix
|
|
- Patrick Mochel: PCI documentation, and PM cleanups
- mtd: export nand ECC functions
- Jes Sorenson: acenic driver update
- Alan Cox: fix vxfs merge boo-boo
- me: undo page_launder() LRU changes, they have nasty side effects
- wanrouter: fix error code
|
|
|