20 Apr, 2008

1 commit

  • Modify the PM core to protect its data structures, specifically the
    dpm_active list, from being corrupted if a child of the currently
    suspending device is registered concurrently with its ->suspend()
    callback. In that case, since the new device (the child) is added
    to dpm_active after its parent, the PM core will attempt to
    suspend it after the parent, which is wrong.

    Introduce a new member of struct dev_pm_info, called 'sleeping',
    and use it to check if the parent of the device being added to
    dpm_active has been suspended, in which case the device registration
    fails. Also, use 'sleeping' for checking if the ordering of devices
    on dpm_active is correct.

    Introduce variable 'all_sleeping' that will be set to 'true' once all
    devices have been suspended and make new device registrations fail
    until 'all_sleeping' is reset to 'false', in order to avoid having
    unsuspended devices around while the system is going into a sleep state.

    Remove pm_sleep_rwsem which is not necessary any more.

    Special thanks to Alan Stern for discussions and suggestions that
    lead to the creation of this patch.

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

    Rafael J. Wysocki
     

13 Mar, 2008

1 commit


24 Feb, 2008

1 commit

  • During the last step of hibernation in the "platform" mode (with the
    help of ACPI) we use the suspend code, including the devices'
    ->suspend() methods, to prepare the system for entering the ACPI S4
    system sleep state.

    But at least for some devices the operations performed by the
    ->suspend() callback in that case must be different from its operations
    during regular suspend.

    For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
    pass it to the device drivers' ->suspend() methods during the last phase
    of hibernation, so that they can distinguish this case and handle it as
    appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a
    special way and need to handle PM_EVENT_HIBERNATE in the same way.

    These changes are necessary to fix a hibernation regression related
    to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Tested-by: Jeff Chua
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

07 Feb, 2008

1 commit


02 Feb, 2008

8 commits


20 Oct, 2007

1 commit

  • Most of these fixes were already submitted for old kernel versions, and were
    approved, but for some reason they never made it into the releases.

    Because this is a consolidation of a couple old missed patches, it touches both
    Kconfigs and documentation texts.

    Signed-off-by: Matt LaPlante
    Acked-by: Randy Dunlap
    Signed-off-by: Adrian Bunk

    Matt LaPlante
     

19 Oct, 2007

4 commits

  • Currently, there's a CONFIG_DISABLE_CONSOLE_SUSPEND that allows one to stop
    the serial console from being suspended when the rest of the machine goes
    to sleep. This is incredibly useful for debugging power management-related
    things; however, having it as a compile-time option has proved to be
    incredibly inconvenient for us (OLPC). There are plenty of times that we
    want serial console to not suspend, but for the most part we'd like serial
    console to be suspended.

    This drops CONFIG_DISABLE_CONSOLE_SUSPEND, and replaces it with a kernel
    boot parameter (no_console_suspend). By default, the serial console will
    be suspended along with the rest of the system; by passing
    'no_console_suspend' to the kernel during boot, serial console will remain
    alive during suspend.

    For now, this is pretty serial console specific; further fixes could be
    applied to make this work for things like netconsole.

    Signed-off-by: Andres Salomon
    Acked-by: "Rafael J. Wysocki"
    Acked-by: Pavel Machek
    Cc: Nigel Cunningham
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • The freezer should not send signals to kernel threads, since that may lead to
    subtle problems. In particular, commit
    b74d0deb968e1f85942f17080eace015ce3c332c has changed recalc_sigpending_tsk()
    so that it doesn't clear TIF_SIGPENDING. For this reason, if the freezer
    continues to send fake signals to kernel threads and the freezing of kernel
    threads fails, some of them may be running with TIF_SIGPENDING set forever.

    Accordingly, recalc_sigpending_tsk() shouldn't set the task's TIF_SIGPENDING
    flag if TIF_FREEZE is set.

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

    Rafael J. Wysocki
     
  • One important reason to freeze tasks, which is that we don't want them to
    allocate memory after freeing it for the hibernation image, has not been
    documented. Fix it.

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

    Rafael J. Wysocki
     
  • The name of 'struct pm_ops' suggests that it is related to the power
    management in general, but in fact it is only related to suspend.  Moreover,
    its name should indicate what this structure is used for, so it seems
    reasonable to change it to 'struct platform_suspend_ops'.  In that case, the
    name of the global variable of this type used by the PM core and the names of
    related functions should be changed accordingly.

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

    Rafael J. Wysocki
     

17 Oct, 2007

2 commits


22 Jul, 2007

1 commit


20 Jul, 2007

1 commit

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

    Rafael J. Wysocki
     

18 Jul, 2007

1 commit

  • Currently, the freezer treats all tasks as freezable, except for the kernel
    threads that explicitly set the PF_NOFREEZE flag for themselves. This
    approach is problematic, since it requires every kernel thread to either
    set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
    care for the freezing of tasks at all.

    It seems better to only require the kernel threads that want to or need to
    be frozen to use some freezer-related code and to remove any
    freezer-related code from the other (nonfreezable) kernel threads, which is
    done in this patch.

    The patch causes all kernel threads to be nonfreezable by default (ie. to
    have PF_NOFREEZE set by default) and introduces the set_freezable()
    function that should be called by the freezable kernel threads in order to
    unset PF_NOFREEZE. It also makes all of the currently freezable kernel
    threads call set_freezable(), so it shouldn't cause any (intentional)
    change of behaviour to appear. Additionally, it updates documentation to
    describe the freezing of tasks more accurately.

    [akpm@linux-foundation.org: build fixes]
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Nigel Cunningham
    Cc: Pavel Machek
    Cc: Oleg Nesterov
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

13 Jul, 2007

1 commit

  • This patch (as886) adds the controversial USB-persist facility,
    allowing USB devices to persist across a power loss during system
    suspend.

    The facility is controlled by a new Kconfig option (with appropriate
    warnings about the potential dangers); when the option is off the
    behavior will remain the same as it is now. But when the option is
    on, people will be able to use suspend-to-disk and keep their USB
    filesystems intact -- something particularly valuable for small
    machines where the root filesystem is on a USB device!

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

12 Jul, 2007

1 commit

  • Remove pointless and never-called enable_wake() hook from pci_driver and
    from documentation. Evidently this was introduced in the 2.4.6 kernel,
    but there's no evidence it was ever called; and it was rarely implemented.

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

10 May, 2007

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits)
    sound: convert "sound" subdirectory to UTF-8
    MAINTAINERS: Add cxacru website/mailing list
    include files: convert "include" subdirectory to UTF-8
    general: convert "kernel" subdirectory to UTF-8
    documentation: convert the Documentation directory to UTF-8
    Convert the toplevel files CREDITS and MAINTAINERS to UTF-8.
    remove broken URLs from net drivers' output
    Magic number prefix consistency change to Documentation/magic-number.txt
    trivial: s/i_sem /i_mutex/
    fix file specification in comments
    drivers/base/platform.c: fix small typo in doc
    misc doc and kconfig typos
    Remove obsolete fat_cvf help text
    Fix occurrences of "the the "
    Fix minor typoes in kernel/module.c
    Kconfig: Remove reference to external mqueue library
    Kconfig: A couple of grammatical fixes in arch/i386/Kconfig
    Correct comments in genrtc.c to refer to correct /proc file.
    Fix more "deprecated" spellos.
    Fix "deprecated" typoes.
    ...

    Fix trivial comment conflict in kernel/relay.c.

    Linus Torvalds
     
  • [ 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
     

09 May, 2007

2 commits


08 May, 2007

1 commit

  • Change /sys/power/disk to display all valid modes as well as the currently
    selected one in a fashion known from the LED subsystem.

    This changes userspace API, but it is apparently not used much (we asked
    some userspace developers)

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

    Johannes Berg
     

03 May, 2007

1 commit


01 May, 2007

1 commit

  • 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
     

27 Mar, 2007

1 commit


08 Dec, 2006

3 commits


30 Nov, 2006

2 commits


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
     

04 Oct, 2006

2 commits