25 May, 2011

2 commits


24 May, 2011

1 commit


18 May, 2011

7 commits

  • If device drivers allocate substantial amounts of memory (above 1 MB)
    in their hibernate .freeze() callbacks (or in their legacy suspend
    callbcks during hibernation), the subsequent creation of hibernate
    image may fail due to the lack of memory. This is the case, because
    the drivers' .freeze() callbacks are executed after the hibernate
    memory preallocation has been carried out and the preallocated amount
    of memory may be too small to cover the new driver allocations.
    Unfortunately, the drivers' .prepare() callbacks also are executed
    after the hibernate memory preallocation has completed, so they are
    not suitable for allocating additional memory either. Thus the only
    way a driver can safely allocate memory during hibernation is to use
    a hibernate/suspend notifier. However, the notifiers are called
    before the freezing of user space and the drivers wanting to use them
    for allocating additional memory may not know how much memory needs
    to be allocated at that point.

    To let device drivers overcome this difficulty rework the hibernation
    sequence so that the memory preallocation is carried out after the
    drivers' .prepare() callbacks have been executed, so that the
    .prepare() callbacks can be used for allocating additional memory
    to be used by the drivers' .freeze() callbacks. Update documentation
    to match the new behavior of the code.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Now that we have CONFIG_DYNAMIC_DEBUG there is no need for yet
    another flag causing dev_dbg() and pr_debug() statements in the
    core PM code to produce output. Moreover, CONFIG_PM_VERBOSE
    causes so much output to be generated that it's not really useful
    and almost no one sets it.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=23182
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • * power-domains:
    PM: Fix build issue in clock_ops.c for CONFIG_PM_RUNTIME unset
    PM: Revert "driver core: platform_bus: allow runtime override of dev_pm_ops"
    OMAP1 / PM: Use generic clock manipulation routines for runtime PM
    PM / Runtime: Generic clock manipulation rountines for runtime PM (v6)
    PM / Runtime: Add subsystem data field to struct dev_pm_info
    OMAP2+ / PM: move runtime PM implementation to use device power domains
    PM / Platform: Use generic runtime PM callbacks directly
    shmobile: Use power domains for platform runtime PM
    PM: Export platform bus type's default PM callbacks
    PM: Make power domain callbacks take precedence over subsystem ones

    Rafael J. Wysocki
     
  • * syscore:
    PM: Remove sysdev suspend, resume and shutdown operations
    PM / PowerPC: Use struct syscore_ops instead of sysdevs for PM
    PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM
    PM / AVR32: Use struct syscore_ops instead of sysdevs for PM
    PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM
    ARM / Samsung: Use struct syscore_ops for "core" power management
    ARM / PXA: Use struct syscore_ops for "core" power management
    ARM / SA1100: Use struct syscore_ops for "core" power management
    ARM / Integrator: Use struct syscore_ops for core PM
    ARM / OMAP: Use struct syscore_ops for "core" power management
    ARM: Use struct syscore_ops instead of sysdevs for PM in common code

    Rafael J. Wysocki
     
  • This reverts commit bea3864fb627d110933cfb8babe048b63c4fc76e
    (PM / Hibernate: Reduce autotuned default image size), because users
    are now able to resolve the issue this commit was supposed to address
    in a different way (i.e. by using the new /sys/power/reserved_size
    interface).

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Martin reports that on his system hibernation occasionally fails due
    to the lack of memory, because the radeon driver apparently allocates
    too much of it during the device freeze stage. It turns out that the
    amount of memory allocated by radeon during hibernation (and
    presumably during system suspend too) depends on the utilization of
    the GPU (e.g. hibernating while there are two KDE 4 sessions with
    compositing enabled causes radeon to allocate more memory than for
    one KDE 4 session).

    In principle it should be possible to use image_size to make the
    memory preallocation mechanism free enough memory for the radeon
    driver, but in practice it is not easy to guess the right value
    because of the way the preallocation code uses image_size. For this
    reason, it seems reasonable to allow users to control the amount of
    memory reserved for driver allocations made after the hibernate
    preallocation, which currently is constant and amounts to 1 MB.

    Introduce a new sysfs file, /sys/power/reserved_size, whose value
    will be used as the amount of memory to reserve for the
    post-preallocation reservations made by device drivers, in bytes.
    For backwards compatibility, set its default (and initial) value to
    the currently used number (1 MB).

    References: https://bugzilla.kernel.org/show_bug.cgi?id=34102
    Reported-and-tested-by: Martin Steigerwald
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The current implementation of suspend-to-RAM returns 0 if there is an
    error from suspend_enter(), because suspend_devices_and_enter() ignores
    the return value from suspend_enter(). This patch addresses this issue
    and properly keep the error return from suspend_enter() and let
    suspend_devices_and_enter relay the error return.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park
    Signed-off-by: Rafael J. Wysocki

    MyungJoo Ham
     

12 May, 2011

4 commits

  • Since suspend, resume and shutdown operations in struct sysdev_class
    and struct sysdev_driver are not used any more, remove them. Also
    drop sysdev_suspend(), sysdev_resume() and sysdev_shutdown() used
    for executing those operations and modify all of their users
    accordingly. This reduces kernel code size quite a bit and reduces
    its complexity.

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

    Rafael J. Wysocki
     
  • The SNAPSHOT_S2RAM ioctl used for implementing the feature allowing
    one to suspend to RAM after creating a hibernation image is currently
    broken, because it doesn't clear the "ready" flag in the struct
    snapshot_data object handled by it. As a result, the
    SNAPSHOT_UNFREEZE doesn't work correctly after SNAPSHOT_S2RAM has
    returned and the user space hibernate task cannot thaw the other
    processes as appropriate. Make SNAPSHOT_S2RAM clear data->ready
    to fix this problem.

    Tested-by: Alexandre Felipe Muller de Souza
    Signed-off-by: Rafael J. Wysocki
    Cc: stable@kernel.org

    Rafael J. Wysocki
     
  • If the process using the hibernate user space interface closes
    /dev/snapshot after creating a hibernation image without thawing
    tasks, snapshot_release() should call pm_restore_gfp_mask() to
    restore the GFP mask used before the creation of the image. Make
    that happen.

    Tested-by: Alexandre Felipe Muller de Souza
    Signed-off-by: Rafael J. Wysocki
    Cc: stable@kernel.org

    Rafael J. Wysocki
     
  • A warning is printed by pm_restrict_gfp_mask() while the
    SNAPSHOT_S2RAM ioctl is being executed after creating a hibernation
    image, because pm_restrict_gfp_mask() has been called once already
    before the image creation and suspend_devices_and_enter() calls it
    once again. This happens after commit 452aa6999e6703ffbddd7f6ea124d3
    (mm/pm: force GFP_NOIO during suspend/hibernation and resume).

    To avoid this issue, move pm_restrict_gfp_mask() and
    pm_restore_gfp_mask() from suspend_devices_and_enter() to its caller
    in kernel/power/suspend.c.

    Reported-by: Alexandre Felipe Muller de Souza
    Signed-off-by: Rafael J. Wysocki
    Cc: stable@kernel.org

    Rafael J. Wysocki
     

30 Apr, 2011

1 commit

  • Many different platforms and subsystems may want to disable device
    clocks during suspend and enable them during resume which is going to
    be done in a very similar way in all those cases. For this reason,
    provide generic routines for the manipulation of device clocks during
    suspend and resume.

    Convert the ARM shmobile platform to using the new routines.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

19 Apr, 2011

1 commit


12 Apr, 2011

2 commits

  • Make XEN_SAVE_RESTORE select HIBERNATE_CALLBACKS.
    Remove XEN_SAVE_RESTORE dependency from PM_SLEEP.

    Signed-off-by: Shriram Rajagopalan
    Acked-by: Ian Campbell
    Signed-off-by: Rafael J. Wysocki

    Shriram Rajagopalan
     
  • Xen save/restore is going to use hibernate device callbacks for
    quiescing devices and putting them back to normal operations and it
    would need to select CONFIG_HIBERNATION for this purpose. However,
    that also would cause the hibernate interfaces for user space to be
    enabled, which might confuse user space, because the Xen kernels
    don't support hibernation. Moreover, it would be wasteful, as it
    would make the Xen kernels include a substantial amount of code that
    they would never use.

    To address this issue introduce new power management Kconfig option
    CONFIG_HIBERNATE_CALLBACKS, such that it will only select the code
    that is necessary for the hibernate device callbacks to work and make
    CONFIG_HIBERNATION select it. Then, Xen save/restore will be able to
    select CONFIG_HIBERNATE_CALLBACKS without dragging the entire
    hibernate code along with it.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Shriram Rajagopalan

    Rafael J. Wysocki
     

31 Mar, 2011

1 commit


25 Mar, 2011

1 commit

  • * 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block: (65 commits)
    Documentation/iostats.txt: bit-size reference etc.
    cfq-iosched: removing unnecessary think time checking
    cfq-iosched: Don't clear queue stats when preempt.
    blk-throttle: Reset group slice when limits are changed
    blk-cgroup: Only give unaccounted_time under debug
    cfq-iosched: Don't set active queue in preempt
    block: fix non-atomic access to genhd inflight structures
    block: attempt to merge with existing requests on plug flush
    block: NULL dereference on error path in __blkdev_get()
    cfq-iosched: Don't update group weights when on service tree
    fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
    block: Require subsystems to explicitly allocate bio_set integrity mempool
    jbd2: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    jbd: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    fs: make fsync_buffers_list() plug
    mm: make generic_writepages() use plugging
    blk-cgroup: Add unaccounted time to timeslice_used.
    block: fixup plugging stubs for !CONFIG_BLOCK
    block: remove obsolete comments for blkdev_issue_zeroout.
    blktrace: Use rq->cmd_flags directly in blk_add_trace_rq.
    ...

    Fix up conflicts in fs/{aio.c,super.c}

    Linus Torvalds
     

21 Mar, 2011

1 commit

  • * 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
    video: change to new flag variable
    scsi: change to new flag variable
    rtc: change to new flag variable
    rapidio: change to new flag variable
    pps: change to new flag variable
    net: change to new flag variable
    misc: change to new flag variable
    message: change to new flag variable
    memstick: change to new flag variable
    isdn: change to new flag variable
    ieee802154: change to new flag variable
    ide: change to new flag variable
    hwmon: change to new flag variable
    dma: change to new flag variable
    char: change to new flag variable
    fs: change to new flag variable
    xtensa: change to new flag variable
    um: change to new flag variables
    s390: change to new flag variable
    mips: change to new flag variable
    ...

    Fix up trivial conflict in drivers/hwmon/Makefile

    Linus Torvalds
     

17 Mar, 2011

1 commit


15 Mar, 2011

9 commits

  • The hibernate image size autotuning mechanism sets the default
    image size to 5/2 of the total system RAM, but it is reported
    that on some systems device drivers allocate substantial
    amounts of memory during suspend and the creation of the image
    fails as a result (too little memory is preallocated).

    Modify the autotuning mechanism to use 1/3 instead of 2/5 of RAM
    as the default image size, which is reported to be sufficient for
    the affected systems.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=30482
    Reported-and-tested-by: Martin Steigerwald
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Some subsystems need to carry out suspend/resume and shutdown
    operations with one CPU on-line and interrupts disabled. The only
    way to register such operations is to define a sysdev class and
    a sysdev specifically for this purpose which is cumbersome and
    inefficient. Moreover, the arguments taken by sysdev suspend,
    resume and shutdown callbacks are practically never necessary.

    For this reason, introduce a simpler interface allowing subsystems
    to register operations to be executed very late during system suspend
    and shutdown and very early during resume in the form of
    strcut syscore_ops objects.

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

    Rafael J. Wysocki
     
  • 'n' defaults are pretty pointless and actually bogus when used with
    prompt-less config options.

    The "bool"/"default y" pair with no prompt can be expressed more
    compactly using def_bool.

    [rjw: Rebased on top of earlier patches modifying this file.]

    Signed-off-by: Jan Beulich
    Signed-off-by: Rafael J. Wysocki

    Jan Beulich
     
  • The variable pm_flags is used to prevent APM from being enabled
    along with ACPI, which would lead to problems. However, acpi_init()
    is always called before apm_init() and after acpi_init() has
    returned, it is known whether or not ACPI will be used. Namely, if
    acpi_disabled is not set after acpi_init() has returned, this means
    that ACPI is enabled. Thus, it is sufficient to check acpi_disabled
    in apm_init() to prevent APM from being enabled in parallel with
    ACPI.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Len Brown

    Rafael J. Wysocki
     
  • CONFIG_PM_SLEEP_ADVANCED_DEBUG is not used any more, so drop it
    and CONFIG_CAN_PM_TRACE need not depend on EXPERIMENTAL, so remove
    that dependency.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • After redefining CONFIG_PM to depend on (CONFIG_PM_SLEEP ||
    CONFIG_PM_RUNTIME) the CONFIG_PM_OPS option is redundant and can be
    replaced with CONFIG_PM.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Reorder configuration options in kernel/power/Kconfig so that
    the options depended on are at the top of the list.

    This patch doesn't introduce any functional changes.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • From the users' point of view CONFIG_PM is really only used for
    making it possible to set CONFIG_SUSPEND, CONFIG_HIBERNATION,
    CONFIG_PM_RUNTIME and (surprisingly enough) CONFIG_XEN_SAVE_RESTORE
    (CONFIG_PM_OPP also depends on CONFIG_PM, but quite artificially).
    However, both CONFIG_SUSPEND and CONFIG_HIBERNATION require platform
    support (independent of CONFIG_PM) and it is not quite obvious that
    CONFIG_PM has to be set for CONFIG_XEN_SAVE_RESTORE to be available.
    Thus, from the users' point of view, it would be more logical to
    automatically select CONFIG_PM if any of the above options depending
    on it are set.

    Make CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME),
    which will cause it to be selected when any of CONFIG_SUSPEND,
    CONFIG_HIBERNATION, CONFIG_PM_RUNTIME, CONFIG_XEN_SAVE_RESTORE is
    set and will clarify its meaning.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • If direct references to pm_flags are removed from drivers/acpi/bus.c,
    CONFIG_ACPI will not need to depend on CONFIG_PM any more. Make that
    happen.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Len Brown

    Rafael J. Wysocki
     

10 Mar, 2011

1 commit

  • With the plugging now being explicitly controlled by the
    submitter, callers need not pass down unplugging hints
    to the block layer. If they want to unplug, it's because they
    manually plugged on their own - in which case, they should just
    unplug at will.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

19 Feb, 2011

1 commit


17 Feb, 2011

2 commits

  • Currently we return 0 in swsusp_alloc() when alloc_image_page() fails.
    Fix that. Also remove unneeded "error" variable since the only
    useful value of error is -ENOMEM.

    [rjw: Fixed up the changelog and changed subject.]

    Signed-off-by: Stanislaw Gruszka
    Cc: stable@kernel.org
    Signed-off-by: Rafael J. Wysocki

    Stanislaw Gruszka
     
  • There are two spellings in use for 'freeze' + 'able' - 'freezable' and
    'freezeable'. The former is the more prominent one. The latter is
    mostly used by workqueue and in a few other odd places. Unify the
    spelling to 'freezable'.

    Signed-off-by: Tejun Heo
    Reported-by: Alan Stern
    Acked-by: "Rafael J. Wysocki"
    Acked-by: Greg Kroah-Hartman
    Acked-by: Dmitry Torokhov
    Cc: David Woodhouse
    Cc: Alex Dubov
    Cc: "David S. Miller"
    Cc: Steven Whitehouse

    Tejun Heo
     

14 Jan, 2011

3 commits

  • * '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
     
  • * 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits)
    block: ensure that completion error gets properly traced
    blktrace: add missing probe argument to block_bio_complete
    block cfq: don't use atomic_t for cfq_group
    block cfq: don't use atomic_t for cfq_queue
    block: trace event block fix unassigned field
    block: add internal hd part table references
    block: fix accounting bug on cross partition merges
    kref: add kref_test_and_get
    bio-integrity: mark kintegrityd_wq highpri and CPU intensive
    block: make kblockd_workqueue smarter
    Revert "sd: implement sd_check_events()"
    block: Clean up exit_io_context() source code.
    Fix compile warnings due to missing removal of a 'ret' variable
    fs/block: type signature of major_to_index(int) to major_to_index(unsigned)
    block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p)
    cfq-iosched: don't check cfqg in choose_service_tree()
    fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors
    cdrom: export cdrom_check_events()
    sd: implement sd_check_events()
    sr: implement sr_check_events()
    ...

    Linus Torvalds
     
  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    Documentation/trace/events.txt: Remove obsolete sched_signal_send.
    writeback: fix global_dirty_limits comment runtime -> real-time
    ppc: fix comment typo singal -> signal
    drivers: fix comment typo diable -> disable.
    m68k: fix comment typo diable -> disable.
    wireless: comment typo fix diable -> disable.
    media: comment typo fix diable -> disable.
    remove doc for obsolete dynamic-printk kernel-parameter
    remove extraneous 'is' from Documentation/iostats.txt
    Fix spelling milisec -> ms in snd_ps3 module parameter description
    Fix spelling mistakes in comments
    Revert conflicting V4L changes
    i7core_edac: fix typos in comments
    mm/rmap.c: fix comment
    sound, ca0106: Fix assignment to 'channel'.
    hrtimer: fix a typo in comment
    init/Kconfig: fix typo
    anon_inodes: fix wrong function name in comment
    fix comment typos concerning "consistent"
    poll: fix a typo in comment
    ...

    Fix up trivial conflicts in:
    - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
    - fs/ext4/ext4.h

    Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.

    Linus Torvalds
     

11 Jan, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    spi / PM: Support dev_pm_ops
    PM: Prototype the pm_generic_ operations
    PM / Runtime: Generic resume shouldn't set RPM_ACTIVE unconditionally
    PM: Use dev_name() in core device suspend and resume routines
    PM: Permit registration of parentless devices during system suspend
    PM: Replace the device power.status field with a bit field
    PM: Remove redundant checks from core device resume routines
    PM: Use a different list of devices for each stage of device suspend
    PM: Avoid compiler warning in pm_noirq_op()
    PM: Use pm_wakeup_pending() in __device_suspend()
    PM / Wakeup: Replace pm_check_wakeup_events() with pm_wakeup_pending()
    PM: Prevent dpm_prepare() from returning errors unnecessarily
    PM: Fix references to basic-pm-debugging.txt in drivers-testing.txt
    PM / Runtime: Add synchronous runtime interface for interrupt handlers (v3)
    PM / Hibernate: When failed, in_suspend should be reset
    PM / Hibernate: hibernation_ops->leave should be checked too
    Freezer: Fix a race during freezing of TASK_STOPPED tasks
    PM: Use proper ccflag flag in kernel/power/Makefile
    PM / Runtime: Fix comments to match runtime callback code

    Linus Torvalds
     

07 Jan, 2011

1 commit