13 Oct, 2007

2 commits


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
     

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

    Rafael J. Wysocki
     

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

    Nigel Cunningham
     

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

    Ben Collins
     

19 Jul, 2007

2 commits


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

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

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

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

    Matthias Kaehlcke
     

03 May, 2007

1 commit


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

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

    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

    Dmitry Torokhov
     

12 Apr, 2007

1 commit


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

    Dmitry Torokhov
     
  • 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

    Pavel Machek
     
  • 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

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

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

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

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

    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
     

01 Jul, 2006

1 commit


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

    Akinobu Mita
     

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

    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

    Linus Torvalds
     

22 Jun, 2006

2 commits


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

    Andrew Morton
     

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


07 Feb, 2006

2 commits


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

    Michael Richardson
     
  • 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

    Russell King