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

    Rafael J. Wysocki
     

20 Jul, 2007

1 commit

  • Introduce the pm_power_off_prepare() callback that can be registered by the
    interested platforms in analogy with pm_idle() and pm_power_off(), used for
    preparing the system to power off (needed by ACPI).

    This allows us to drop acpi_sysclass and device_acpi that are only defined in
    order to register the ACPI power off preparation callback, which is needed by
    pm_power_off() registered in a much different way.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

19 Jul, 2007

1 commit

  • 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

    Alan Stern
     

12 Jul, 2007

3 commits

  • 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

    Rafael J. Wysocki
     
  • The saved_state member of struct dev_pm_info, defined in include/linux/pm.h, is
    not used anywhere, so it can be removed.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • 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

    Rafael J. Wysocki
     

02 Jul, 2007

1 commit

  • Commit 52ade9b3b97fd3bea42842a056fe0786c28d0555 changed the suspend code
    ordering to execute pm_ops->prepare() after the device model per-device
    .suspend() calls in order to fix some ACPI-related issues. Unfortunately, it
    broke the at91 platform which assumed that pm_ops->prepare() would be called
    before suspending devices.

    at91 used pm_ops->prepare() to get notified of the target system sleep state,
    so that it could use this information while suspending devices. However, with
    the current suspend code ordering pm_ops->prepare() is called too late for
    this purpose. Thus, at91 needs an additional method in 'struct pm_ops' that
    will be used for notifying the platform of the target system sleep state.
    Moreover, in the future such a method will also be needed by ACPI.

    This patch adds the .set_target() method to 'struct pm_ops' and makes the
    suspend code call it, if implemented, before executing the device model
    per-device .suspend() calls. It also modifies the at91 code to use
    pm_ops->set_target() instead of pm_ops->prepare().

    Signed-off-by: Rafael J. Wysocki
    Acked-by: David Brownell
    Cc: Pavel Machek
    Cc: Johannes Berg
    Cc: Len Brown
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

10 May, 2007

1 commit

  • [ With Johannes Berg ]

    Separate the hibernation (aka suspend to disk code) from the other suspend
    code. In particular:

    * Remove the definitions related to hibernation from include/linux/pm.h
    * Introduce struct hibernation_ops and a new hibernate() function to hibernate
    the system, defined in include/linux/suspend.h
    * Separate suspend code in kernel/power/main.c from hibernation-related code
    in kernel/power/disk.c and kernel/power/user.c (with the help of
    hibernation_ops)
    * Switch ACPI (the only user of pm_ops.pm_disk_mode) to hibernation_ops

    Signed-off-by: Rafael J. Wysocki
    Cc: Greg KH
    Cc: Pavel Machek
    Cc: Nigel Cunningham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

01 May, 2007

5 commits

  • For backwards compatibility, call_platform_enable_wakeup() can return 0
    instead of -EIO since we aren't guaranteed to have errno defined.

    Cc: David Brownell
    Signed-off-by: David Rientjes
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • This patch changes the docs and behaviour from "all states valid" to "no
    states valid" if no .valid callback is assigned. Users of pm_ops that only
    need mem sleep can assign pm_valid_only_mem without any overhead, others
    will require more elaborate callbacks.

    Now that all users of pm_ops have a .valid callback this is a safe thing to
    do and prevents things from getting messy again as they were before.

    Signed-off-by: Johannes Berg
    Acked-by: Pavel Machek
    Looks-okay-to: Rafael J. Wysocki
    Cc:
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     
  • Almost all users of pm_ops only support mem sleep, don't check in .valid and
    don't reject any others in .prepare so users can be confused if they check
    /sys/power/state, especially when new states are added (these would then
    result in s-t-r although they're supposed to be something different).

    This patch implements a generic pm_valid_only_mem function that is then
    exported for users and puts it to use in almost all existing pm_ops.

    Signed-off-by: Johannes Berg
    Cc: David Brownell
    Acked-by: Pavel Machek
    Cc: linux-pm@lists.linux-foundation.org
    Cc: Len Brown
    Acked-by: Russell King
    Cc: Greg KH
    Cc: "Rafael J. Wysocki"
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     
  • This patch removes the firmware disk suspend mode which is the wrong approach,
    it is supposed to be used for implementing firmware-based disk suspend but
    cannot actually be used for that.

    Signed-off-by: Johannes Berg
    Acked-by: Pavel Machek
    Cc:
    Cc: David Brownell
    Cc: Len Brown
    Acked-by: Russell King
    Cc: Greg KH
    Cc: "Rafael J. Wysocki"
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     
  • This patch series cleans up some misconceptions about pm_ops. Some users of
    the pm_ops structure attempt to use it to stop the user from entering suspend
    to disk, this, however, is not possible since the user can always use
    "shutdown" in /sys/power/disk and then the pm_ops are never invoked. Also,
    platforms that don't support suspend to disk simply should not allow
    configuring SOFTWARE_SUSPEND (read the help text on it, it only selects
    suspend to disk and nothing else, all the other stuff depends on PM).

    The pm_ops structure is actually intended to provide a way to enter
    platform-defined sleep states (currently supported states are "standby" and
    "mem" (suspend to ram)) and additionally (if SOFTWARE_SUSPEND is configured)
    allows a platform to support a platform specific way to enter low-power mode
    once everything has been saved to disk. This is currently only used by ACPI
    (S4).

    This patch:

    The pm_ops.pm_disk_mode is used in totally bogus ways since nobody really
    seems to understand what it actually does.

    This patch clarifies the pm_disk_mode description.

    It also removes all the arm and sh users that think they can veto suspend to
    disk via pm_ops; not so since the user can always do echo shutdown >
    /sys/power/disk, they need to find a better way involving Kconfig or such.

    ACPI is the only user left with a non-zero pm_disk_mode.

    The patch also sets the default mode to shutdown again, but when a new pm_ops
    is registered its pm_disk_mode is selected as default, that way the default
    stays for ACPI where it is apparently required.

    Signed-off-by: Johannes Berg
    Cc: David Brownell
    Acked-by: Pavel Machek
    Cc:
    Cc: Len Brown
    Acked-by: Russell King
    Cc: Greg KH
    Cc: "Rafael J. Wysocki"
    Acked-by: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg
     

28 Apr, 2007

2 commits

  • After some more discussion this patch replaces it:

    From: Johannes Berg
    Subject: suspend: add arch irq disable/enable hooks

    For powermac, we need to do some things between suspending devices and
    device_power_off, for example setting the decrementer. This patch
    allows architectures to define arch_s2ram_{en,dis}able_irqs in their
    asm/suspend.h to have control over this step.

    Signed-off-by: Johannes Berg
    Acked-by: Pavel Machek
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • 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

    David Brownell
     

24 Feb, 2007

1 commit

  • Because the pm ops in powermac are obviously not using them as intended, I
    added documentation for it in kernel-doc format.

    Reordering the fields in struct pm_ops not only makes the output of kernel-doc
    make more sense but also removes a hole from the structure on 64-bit
    platforms.

    Signed-off-by: Johannes Berg
    Cc: "Randy.Dunlap"
    Cc: Rafael J. Wysocki
    Cc: Pavel Macheck
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

04 Nov, 2006

1 commit

  • 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
    Cc: Stefan Seyfried
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

26 Sep, 2006

2 commits

  • 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
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • 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

    Linus Torvalds
     

26 Apr, 2006

1 commit


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 -22

    Work-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

    Andrew Morton
     

23 Mar, 2006

1 commit


14 Nov, 2005

1 commit


31 Oct, 2005

1 commit

  • 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
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shaohua Li
     

29 Oct, 2005

3 commits

  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Andrew Morton
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    drivers/base/power/main.c | 26 +++-----------------------
    include/linux/pm.h | 1 -
    2 files changed, 3 insertions(+), 24 deletions(-)

    David Brownell
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

05 Sep, 2005

1 commit

  • 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
    Signed-off-by: Alexander Nyberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     

13 Jul, 2005

1 commit


12 Jul, 2005

1 commit

  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown

    Alexey Starikovskiy
     

26 Jun, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds