14 Jun, 2016

1 commit

  • Kasan causes the compiler to instrument C code and is used at runtime to
    detect accesses to memory that has been freed, or not yet allocated.

    The code in snapshot.c saves and restores memory when hibernating. This will
    access whole pages in the slab cache that have both free and allocated
    areas, resulting in a large number of false positives from Kasan.

    Disable instrumentation of this file.

    Signed-off-by: James Morse
    Acked-by: Catalin Marinas
    Signed-off-by: Rafael J. Wysocki

    James Morse
     

19 May, 2015

1 commit

  • Stop abusing struct page functionality and the swap end_io handler, and
    instead add a modified version of the blk-lib.c bio_batch helpers.

    Also move the block I/O code into swap.c as they are directly tied into
    each other.

    Signed-off-by: Christoph Hellwig
    Tested-by: Pavel Machek
    Tested-by: Ming Lin
    Acked-by: Pavel Machek
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

02 May, 2012

2 commits

  • Android allows user space to manipulate wakelocks using two
    sysfs file located in /sys/power/, wake_lock and wake_unlock.
    Writing a wakelock name and optionally a timeout to the wake_lock
    file causes the wakelock whose name was written to be acquired (it
    is created before is necessary), optionally with the given timeout.
    Writing the name of a wakelock to wake_unlock causes that wakelock
    to be released.

    Implement an analogous interface for user space using wakeup sources.
    Add the /sys/power/wake_lock and /sys/power/wake_unlock files
    allowing user space to create, activate and deactivate wakeup
    sources, such that writing a name and optionally a timeout to
    wake_lock causes the wakeup source of that name to be activated,
    optionally with the given timeout. If that wakeup source doesn't
    exist, it will be created and then activated. Writing a name to
    wake_unlock causes the wakeup source of that name, if there is one,
    to be deactivated. Wakeup sources created with the help of
    wake_lock that haven't been used for more than 5 minutes are garbage
    collected and destroyed. Moreover, there can be only WL_NUMBER_LIMIT
    wakeup sources created with the help of wake_lock present at a time.

    The data type used to track wakeup sources created by user space is
    called "struct wakelock" to indicate the origins of this feature.

    This version of the patch includes an rbtree manipulation fix from John Stultz.

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

    Rafael J. Wysocki
     
  • Introduce a mechanism by which the kernel can trigger global
    transitions to a sleep state chosen by user space if there are no
    active wakeup sources.

    It consists of a new sysfs attribute, /sys/power/autosleep, that
    can be written one of the strings returned by reads from
    /sys/power/state, an ordered workqueue and a work item carrying out
    the "suspend" operations. If a string representing the system's
    sleep state is written to /sys/power/autosleep, the work item
    triggering transitions to that state is queued up and it requeues
    itself after every execution until user space writes "off" to
    /sys/power/autosleep.

    That work item enables the detection of wakeup events using the
    functions already defined in drivers/base/power/wakeup.c (with one
    small modification) and calls either pm_suspend(), or hibernate() to
    put the system into a sleep state. If a wakeup event is reported
    while the transition is in progress, it will abort the transition and
    the "system suspend" work item will be queued up again.

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

    Rafael J. Wysocki
     

13 Feb, 2012

1 commit

  • The PM QoS feature originally didn't depend on CONFIG_PM, which was
    mistakenly changed by commit e8db0be1245de16a6cc6365506abc392c3c212d4

    PM QoS: Move and rename the implementation files

    Later, commit d020283dc694c9ec31b410f522252f7a8397e67d

    PM / QoS: CPU C-state breakage with PM Qos change

    partially fixed that by introducing a static inline definition of
    pm_qos_request(), but that still didn't allow user space to use
    the PM QoS interface if CONFIG_PM was unset (which had been possible
    before). For this reason, remove the dependency of PM QoS on
    CONFIG_PM to make it work (as intended) with CONFIG_PM unset.

    [rjw: Replaced the original changelog with a new one.]

    Signed-off-by: Jean Pihet
    Reported-by: Venkatesh Pallipadi
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     

17 Oct, 2011

1 commit

  • Introduce the config option CONFIG_VT_CONSOLE_SLEEP in order to cleanup
    the #if defined ugliness for the vt suspend support functions. Note that
    CONFIG_VT_CONSOLE is already dependant on CONFIG_VT.

    The function pm_set_vt_switch is actually dependant on CONFIG_VT and not
    CONFIG_PM_SLEEP. This fixes a compile error when CONFIG_PM_SLEEP is
    not set:

    drivers/tty/vt/vt_ioctl.c:1794: error: redefinition of 'pm_set_vt_switch'
    include/linux/suspend.h:17: error: previous definition of 'pm_set_vt_switch' was here

    Also, remove the incorrect path from the comment in console.c.

    [rjw: Replaced #if defined() with #ifdef in suspend.h.]

    Signed-off-by: H Hartley Sweeten
    Acked-by: Arnd Bergmann
    Signed-off-by: Rafael J. Wysocki

    H Hartley Sweeten
     

25 Aug, 2011

1 commit


17 Mar, 2011

1 commit


14 Jan, 2011

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (59 commits)
    ACPI / PM: Fix build problems for !CONFIG_ACPI related to NVS rework
    ACPI: fix resource check message
    ACPI / Battery: Update information on info notification and resume
    ACPI: Drop device flag wake_capable
    ACPI: Always check if _PRW is present before trying to evaluate it
    ACPI / PM: Check status of power resources under mutexes
    ACPI / PM: Rename acpi_power_off_device()
    ACPI / PM: Drop acpi_power_nocheck
    ACPI / PM: Drop acpi_bus_get_power()
    Platform / x86: Make fujitsu_laptop use acpi_bus_update_power()
    ACPI / Fan: Rework the handling of power resources
    ACPI / PM: Register power resource devices as soon as they are needed
    ACPI / PM: Register acpi_power_driver early
    ACPI / PM: Add function for updating device power state consistently
    ACPI / PM: Add function for device power state initialization
    ACPI / PM: Introduce __acpi_bus_get_power()
    ACPI / PM: Introduce function for refcounting device power resources
    ACPI / PM: Add functions for manipulating lists of power resources
    ACPI / PM: Prevent acpi_power_get_inferred_state() from making changes
    ACPICA: Update version to 20101209
    ...

    Linus Torvalds
     

07 Jan, 2011

1 commit


24 Dec, 2010

1 commit


10 Jun, 2010

1 commit


11 May, 2010

1 commit


06 Dec, 2009

1 commit


13 Jun, 2009

3 commits

  • The *_nvs_* routines in swsusp.c make use of the io*map()
    functions, which are only provided for HAS_IOMEM, thus
    breaking compilation if HAS_IOMEM is not set. Fix this
    by moving the *_nvs_* routines into hibernate_nvs.c, which
    is only compiled if HAS_IOMEM is set.

    [rjw: Change the name of the new file to hibernate_nvs.c, add the
    license line to the header comment.]

    Signed-off-by: Cornelia Huck
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Cornelia Huck
     
  • Change the name of kernel/power/disk.c to kernel/power/hibernate.c
    in analogy with the file names introduced by the changes that
    separated the suspend to RAM and standby funtionality from the
    common PM functions.

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

    Rafael J. Wysocki
     
  • Move the suspend to RAM and standby code from kernel/power/main.c
    to two separate files, kernel/power/suspend.c containing the basic
    functions and kernel/power/suspend_test.c containing the automatic
    suspend test facility based on the RTC clock alarm.

    There are no changes in functionality related to these modifications.

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

    Rafael J. Wysocki
     

19 Feb, 2009

1 commit

  • Compilation of kprobes.c with CONFIG_PM unset is broken due to some broken
    config dependncies. Fix that.

    Signed-off-by: Rafael J. Wysocki
    Reported-by: Ingo Molnar
    Tested-by: Masami Hiramatsu
    Cc: Len Brown
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

17 Jan, 2009

1 commit

  • Freezer fails to compile if with the following configuration
    settings:

    CONFIG_CGROUPS=y
    CONFIG_CGROUP_FREEZER=y
    CONFIG_MODULES=y
    CONFIG_FREEZER=y
    CONFIG_PM=y
    CONFIG_PM_SLEEP=n

    Fix this by making process.o compilation depend on CONFIG_FREEZER.

    Reported-by: Cheng Renquan
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

15 Apr, 2008

1 commit

  • AFAICT pm_send_all is a nop when noone uses pm_register...

    Hmm.. can we just force CONFIG_PM_LEGACY=n, and see what happens?

    Or maybe this is better idea? It may break build somewhere, but it
    should be easy to fix... (it builds here, i386 and x86-64).

    Signed-off-by: Pavel Machek
    Acked-by: Ralf Baechle
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Pavel Machek
     

30 Jul, 2007

2 commits

  • 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
     
  • Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION to avoid
    confusion (among other things, with CONFIG_SUSPEND introduced in the
    next patch).

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

26 Sep, 2006

1 commit

  • The current suspend code has to be run on one CPU, so we use the CPU
    hotplug to take the non-boot CPUs offline on SMP machines. However, we
    should also make sure that these CPUs will not be enabled by someone else
    after we have disabled them.

    The functions disable_nonboot_cpus() and enable_nonboot_cpus() are moved to
    kernel/cpu.c, because they now refer to some stuff in there that should
    better be static. Also it's better if disable_nonboot_cpus() returns an
    error instead of panicking if something goes wrong, and
    enable_nonboot_cpus() has no reason to panic(), because the CPUs may have
    been enabled by the userland before it tries to take them online.

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

    Rafael J. Wysocki
     

23 Mar, 2006

2 commits

  • This patch introduces a user space interface for swsusp.

    The interface is based on a special character device, called the snapshot
    device, that allows user space processes to perform suspend and resume-related
    operations with the help of some ioctls and the read()/write() functions.
     Additionally it allows these processes to allocate free swap pages from a
    selected swap partition, called the resume partition, so that they know which
    sectors of the resume partition are available to them.

    The interface uses the same low-level system memory snapshot-handling
    functions that are used by the built-it swap-writing/reading code of swsusp.

    The interface documentation is included in the patch.

    The patch assumes that the major and minor numbers of the snapshot device will
    be 10 (ie. misc device) and 231, the registration of which has already been
    requested.

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

    Rafael J. Wysocki
     
  • Move the swap-writing/reading code of swsusp to a separate file.

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

    Rafael J. Wysocki
     

14 Nov, 2005

1 commit


31 Oct, 2005

1 commit

  • The following patch moves the functionality of swsusp related to creating and
    handling the snapshot of memory to a separate file, snapshot.c

    This should enable us to untangle the code in the future and eventually to
    implement some parts of swsusp.c in the user space.

    The patch does not change the code.

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

    Rafael J. Wysocki
     

26 Jun, 2005

1 commit

  • Using CPU hotplug to support suspend/resume SMP. Both S3 and S4 use
    disable/enable_nonboot_cpus API. The S4 part is based on Pavel's original S4
    SMP patch.

    Signed-off-by: Li Shaohua
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Shaohua
     

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