13 Oct, 2007
2 commits
-
This patch (as993) merges the suspend.c and resume.c files in
drivers/base/power into main.c, making some public symbols private.Signed-off-by: Alan Stern
Acked-by: Rafael J. Wysocki
Signed-off-by: Greg Kroah-Hartman -
suspend_device() and resume_device() can now become static.
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
30 Jul, 2007
1 commit
-
Introduce CONFIG_SUSPEND representing the ability to enter system sleep
states, such as the ACPI S3 state, and allow the user to choose SUSPEND
and HIBERNATION independently of each other.Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has
been chosen and the kernel is intended for SMP systems.Also, introduce CONFIG_PM_SLEEP which is automatically selected if
CONFIG_SUSPEND or CONFIG_HIBERNATION is set and use it to select the
code needed for both suspend and hibernation.The top-level power management headers and the ACPI code related to
suspend and hibernation are modified to use the new definitions (the
changes in drivers/acpi/sleep/main.c are, mostly, moving code to reduce
the number of ifdefs).There are many other files in which CONFIG_PM can be replaced with
CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in
the future.Signed-off-by: Rafael J. Wysocki
Signed-off-by: Linus Torvalds
27 Jul, 2007
1 commit
-
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
Tested-by: YOSHIFUJI Hideaki / 吉藤英明
Signed-off-by: Linus Torvalds
22 Jul, 2007
1 commit
-
Signed-off-by: Nigel Cunningham
Cc: Randy Dunlap
Cc: "Rafael J. Wysocki"
Cc: Pavel Machek
Acked-by: Linus Torvalds
Signed-off-by: Andrew Morton
Signed-off-by: Andi Kleen
Signed-off-by: Linus Torvalds
20 Jul, 2007
1 commit
-
In order to enable things like PM_TRACE, you're required to enable
PM_DEBUG, which sends a large spew of messages on boot, and often times can
overflow dmesg buffer.Create new PM_VERBOSE and shift that to be the option that enables
drivers/base/power's messages.Signed-off-by: Ben Collins
Cc: "Rafael J. Wysocki"
Cc: Pavel Machek
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
19 Jul, 2007
2 commits
-
This patch (as933) removes the deprecated dpm_runtime_suspend() and
dpm_runtime_resume() routines from the PM core. The only user of
those routines is the PCMCIA ds driver; local replacements are added.Signed-off-by: Alan Stern
CC: Dominik Brodowski
Signed-off-by: Greg Kroah-Hartman -
This patch (as932) removes the deprecated sysfs .../power/state
attribute files.Signed-off-by: Alan Stern
Acked-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman
12 Jul, 2007
6 commits
-
The checks if the device's parent is in the right state done in
drivers/base/power/suspend.c and drivers/base/power/resume.c serve no particular
purpose, since if the parent is in a wrong power state, the device's suspend or
resume callbacks are supposed to return an error anyway. Moreover, they are
also useless from the sanity checking point of view, because they rely on the
code being checked to set dev->parent->power.power_state.event appropriately,
which need not happen if that code is buggy. For these reasons they can be
removed.Signed-off-by: Rafael J. Wysocki
Acked-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
The suspend routines should be called for every device during a system sleep
transition, regardless of the device's state, so that drivers can regard these
method calls as notifications that the system is about to go to sleep, rather
than as directives to put their devices into the 'off' state.This is documented in Documentation/power/devices.txt and is already done in
the core resume code, so it seems reasonable to make the core suspend code
behave accordingly.Signed-off-by: Rafael J. Wysocki
Signed-off-by: Greg Kroah-Hartman -
The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is
only used during a resume to check if the device's state before the suspend was
'off', in which case the device is not resumed. However, in such cases the
decision whether or not to resume the device should be made on the driver level
and the resume callbacks from the device's bus and class should be executed
anyway (the may be needed for some things other than just powering on the
device).Signed-off-by: Rafael J. Wysocki
Signed-off-by: Greg Kroah-Hartman -
Reduce code duplication in drivers/base/suspend.c by introducing a separate
function for printing diagnostic messages.Signed-off-by: Rafael J. Wysocki
Acked-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman -
The pm_parent member of struct dev_pm_info (defined in include/linux/pm.h) is
only used to check if the device's parent is in the right state while the
device is being suspended or resumed. However, this can be done just as well
with the help of the parent pointer in struct device, so pm_parent can be
removed along with some code that handles it.Signed-off-by: Rafael J. Wysocki
Acked-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
The Power Management code uses semaphores as mutexes. Use the mutex API
instead of the (binary) semaphores.Signed-off-by: Matthias Kaehlcke
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
03 May, 2007
1 commit
-
We need to work on cleaning up the relationship between kobjects, ksets and
ktypes. The removal of 'struct subsystem' is the first step of this,
especially as it is not really needed at all.Thanks to Kay for fixing the bugs in this patch.
Signed-off-by: Greg Kroah-Hartman
28 Apr, 2007
3 commits
-
This defines a platform hook to enable/disable a device as a wakeup event
source. It's initially for use with ACPI, but more generally it could be used
whenever enable_irq_wake()/disable_irq_wake() don't suffice.The hook is called -- if available -- inside pci_enable_wake(); and the
semantics of that call are enhanced so that support for PCI PME# is no longer
needed. It can now work for devices with "legacy PCI PM", when platform
support allows it. (That support would use some board-specific signal for for
the same purpose as PME#.)[akpm@linux-foundation.org: Make it compile with CONFIG_PM=n]
Signed-off-by: David Brownell
Signed-off-by: Zhang Rui
Cc: Len Brown
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
This lock is never used by the rest of the driver core, so the fact that
we are grabbing it here means it isn't correct...Signed-off-by: Greg Kroah-Hartman
-
Driver core: add suspend() and resume() to struct device_type
In cases when there are devices of different types in the same class
we can't use class's implementation of suspend and resume methods and
we need to add them to struct device_type instead.Also fix error handling in resume code (we should not try to call
class's resume method iof bus's resume method for the device failed.Signed-off-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman
12 Apr, 2007
1 commit
-
Noone should use kobj.name directly since it may contain garbage.
Objects with longer names have them stored in separately allocated
memory pointed to by kobj->k_name.Signed-off-by: Dmitry Torokhov
Signed-off-by: Linus Torvalds
26 Sep, 2006
8 commits
-
Driver core: fix comments in drivers/base/power/resume.c
Signed-off-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman -
This adds warning when someone tries them from atomic context.
Signed-off-by: Pavel Machek
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
Remove the new suspend_prepare() phase. It doesn't seem very usable,
has never been tested, doesn't address fault cleanup, and would need
a sibling resume_complete(); plus there are no real use cases. It
could be restored later if those issues get resolved.Signed-off-by: David Brownell
Cc: Linus Torvalds
Signed-off-by: Greg Kroah-Hartman -
Add a new PM_SYSFS_DEPRECATED config option to control whether or
not the /sys/devices/.../power/state files are provided. This will
make it easier to get rid of that mechanism when the time comes,
and to verify that userspace tools work right without it.Signed-off-by: David Brownell
Acked-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman -
Updates to match current code:
- Make writes to the /sys/devices/.../power/state files fail cleanly
if the device requires the irqs-off call variants.- Fix comments describing the /sys/devices/.../power/state file writes
to match the code; the last several releases have invalidated the
previous text.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
This patch is the first of this series that should actually change any
behavior ... by issuing the new event, now tha the rest of the kernel is
prepared to receive it.This converts the PM core to issue the new PRETHAW message, which the rest of
the kernel is now ready to receive.Signed-off-by: David Brownell
Cc: "Rafael J. Wysocki"
Cc: Pavel Machek
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
Fix a goof in Linus' recent PM API updates: don't emit any messages in the
typical NOP "already suspended it" late suspend case.Signed-off-by: David Brownell
Acked-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman -
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
Signed-off-by: Greg Kroah-Hartman
01 Jul, 2006
1 commit
-
Signed-off-by: Jörn Engel
Signed-off-by: Adrian Bunk
27 Jun, 2006
1 commit
-
This patch converts the combination of list_del(A) and list_add(A, B) to
list_move(A, B).Cc: Greg Kroah-Hartman
Cc: Ram Pai
Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jun, 2006
2 commits
-
This is the minimal resume trace code to find which device resume (if
any) results in problems. Usually, you'd use the information this
generates as a starting point to adding more fine-grained trace event
points.Signed-off-by: Linus Torvalds
-
Considering that there isn't a lot of hw we can depend on during resume,
this is about as good as it gets.This is x86-only for now, although the basic concept (and most of the
code) will certainly work on almost any platform.Signed-off-by: Linus Torvalds
22 Jun, 2006
2 commits
-
This makes the driver model PM suspend debug messages more useful, by
(a) explaining what event is being sent, since not all suspend()
requests mean the same thing;(b) reporting when a PM_EVENT_SUSPEND call is allowing the device
to issue wakeup events.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
The drivers/base/power PM debug messages should appear when
either PM or driver model debug are enabled.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
01 Jun, 2006
1 commit
-
From: Andrew Morton
Revert commit ff4da2e262d2509fe1bacff70dd00934be569c66.
It broke APM suspend, probably because APM doesn't switch back to a VT
when suspending.Tracked down by Matt Mackall
Rafael sayeth:
"It only fixed the theoretical issue that a quick-handed user could
switch to X after processes have been frozen and before the devices
are suspended.With the current userland suspend tools it shouldn't be necessary."
Cc: Pavel Machek
Cc: "Rafael J. Wysocki"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Apr, 2006
1 commit
-
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 -22Work-in-progress. It needs lots more suspend_report_result() calls sprinkled
everywhere.Cc: Patrick Mochel
Cc: Pavel Machek
Cc: Nigel Cunningham
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
23 Mar, 2006
1 commit
-
It is unsafe to suspend devices if the hardware is controlled by X. Add an
extra check to prevent this from happening.Signed-off-by: Rafael J. Wysocki
Cc: Pavel Machek
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Feb, 2006
2 commits
-
Prevent passing invalid values down to the drivers.
Signed-off-by: Pavel Machek
Signed-off-by: Greg Kroah-Hartman -
This patch contains the following changes:
- move prototypes to base.h
- sys.c should #include "base.h" for getting the prototype of it's
global function system_bus_init()Note that hidden in this patch there's a bugfix:
Caller and callee disagreed regarding the return type of
sysdev_shutdown().Signed-off-by: Adrian Bunk
Signed-off-by: Greg Kroah-Hartman
14 Jan, 2006
2 commits
-
This patch changes device_shutdown() to use the newly introduced safe
reverse list traversal. We experienced loops on system reboot if we had
removed and re-inserted our device from the device list.We noticed this problem on PPC405. Our PCI IDE device comes and goes a lot.
Our hypothesis was that there was a loop caused by the driver->shutdown
freeing memory. It is possible that we do something wrong as well, but
being unable to reboot is kind of nasty.Signed-off-by: Michael Richardson
Cc: Patrick Mochel
Cc: David Howells
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
Add bus_type probe, remove and shutdown methods to replace the
corresponding methods in struct device_driver. This matches
the way we handle the suspend/resume methods.Since the bus methods override the device_driver methods, warn
if a device driver is registered whose methods will not be
called.The long-term idea is to remove the device_driver methods entirely.
Signed-off-by: Russell King
Signed-off-by: Greg Kroah-Hartman