08 Apr, 2014

1 commit


20 Mar, 2014

2 commits

  • * pm-runtime:
    PM / Runtime: Update runtime_idle() documentation for return value meaning

    * pm-sleep:
    PM / sleep: Correct whitespace errors in
    PM: Add missing "freeze" state
    PM / Hibernate: Spelling s/anonymouns/anonymous/
    PM / Runtime: Add missing "it" in comment
    PM / suspend: Remove unnecessary !!
    PCI / PM: Resume runtime-suspended devices later during system suspend
    ACPI / PM: Resume runtime-suspended devices later during system suspend
    PM / sleep: Set pm_generic functions to NULL for !CONFIG_PM_SLEEP
    PM: fix typo in comment
    PM / hibernate: use name_to_dev_t to parse resume
    PM / wakeup: Include appropriate header file in kernel/power/wakelock.c
    PM / sleep: Move prototype declaration to header file kernel/power/power.h
    PM / sleep: Asynchronous threads for suspend_late
    PM / sleep: Asynchronous threads for suspend_noirq
    PM / sleep: Asynchronous threads for resume_early
    PM / sleep: Asynchronous threads for resume_noirq
    PM / sleep: Two flags for async suspend_noirq and suspend_late

    Rafael J. Wysocki
     
  • * pm-qos:
    PM / QoS: Add type to dev_pm_qos_add_ancestor_request() arguments
    ACPI / LPSS: Support for device latency tolerance PM QoS
    ACPI / scan: Add bind/unbind callbacks to struct acpi_scan_handler
    PM / QoS: Introcuce latency tolerance device PM QoS type
    PM / QoS: Add no_constraints_value field to struct pm_qos_constraints
    PM / QoS: Rename device resume latency QoS items

    * pm-domains:
    PM / domains: Turn latency warning into debug message

    * pm-drivers:
    PM: Add pm_runtime_suspend|resume_force functions
    PM / runtime: Fetch runtime PM callbacks using a macro

    Rafael J. Wysocki
     

12 Mar, 2014

2 commits


11 Mar, 2014

1 commit

  • Double ! or !! are normally required to get 0 or 1 out of a expression. A
    comparision always returns 0 or 1 and hence there is no need to apply double !
    over it again.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

01 Mar, 2014

3 commits

  • Use the name_to_dev_t call to parse the device name echo'd to
    to /sys/power/resume. This imitates the method used in hibernate.c
    in software_resume, and allows the resume partition to be specified
    using other equivalent device formats as well. By allowing
    /sys/debug/resume to accept the same syntax as the resume=device
    parameter, we can parse the resume=device in the init script and
    use the resume device directly from the kernel command line.

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

    Sebastian Capella
     
  • Include appropriate header file kernel/power/power.h in
    kernel/power/wakelock.c because it has prototype declaration of function
    defined in kernel/power/wakelock.c.

    This eliminates the following warning in kernel/power/wakelock.c:
    kernel/power/wakelock.c:34:9: warning: no previous prototype for ‘pm_show_wakelocks’ [-Wmissing-prototypes]
    kernel/power/wakelock.c:184:5: warning: no previous prototype for ‘pm_wake_lock’ [-Wmissing-prototypes]
    kernel/power/wakelock.c:232:5: warning: no previous prototype for ‘pm_wake_unlock’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: Rafael J. Wysocki

    Rashika Kheria
     
  • Move prototype declaration of function to header file
    kernel/power/power.h because it is used by more than one file.

    This eliminates the following warning in kernel/power/snapshot.c:

    kernel/power/snapshot.c:1588:16: warning: no previous prototype for ‘swsusp_save’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Rashika Kheria
     

11 Feb, 2014

2 commits

  • Add a new latency tolerance device PM QoS type to be use for
    specifying active state (RPM_ACTIVE) memory access (DMA) latency
    tolerance requirements for devices. It may be used to prevent
    hardware from choosing overly aggressive energy-saving operation
    modes (causing too much latency to appear) for the whole platform.

    This feature reqiures hardware support, so it only will be
    available for devices having a new .set_latency_tolerance()
    callback in struct dev_pm_info populated, in which case the
    routine pointed to by it should implement whatever is necessary
    to transfer the effective requirement value to the hardware.

    Whenever the effective latency tolerance changes for the device,
    its .set_latency_tolerance() callback will be executed and the
    effective value will be passed to it. If that value is negative,
    which means that the list of latency tolerance requirements for
    the device is empty, the callback is expected to switch the
    underlying hardware latency tolerance control mechanism to an
    autonomous mode if available. If that value is PM_QOS_LATENCY_ANY,
    in turn, and the hardware supports a special "no requirement"
    setting, the callback is expected to use it. That allows software
    to prevent the hardware from automatically updating the device's
    latency tolerance in response to its power state changes (e.g. during
    transitions from D3cold to D0), which generally may be done in the
    autonomous latency tolerance control mode.

    If .set_latency_tolerance() is present for the device, a new
    pm_qos_latency_tolerance_us attribute will be present in the
    devivce's power directory in sysfs. Then, user space can use
    that attribute to specify its latency tolerance requirement for
    the device, if any. Writing "any" to it means "no requirement, but
    do not let the hardware control latency tolerance" and writing
    "auto" to it allows the hardware to be switched to the autonomous
    mode if there are no other requirements from the kernel side in the
    device's list.

    This changeset includes a fix from Mika Westerberg.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Add a new field, no_constraints_value, to struct pm_qos_constraints
    representing a list of PM QoS constraint requests to be returned by
    pm_qos_get_value() when that list of requests is empty.

    That field will be equal to default_value for all of the existing
    global PM QoS classes and for the resume latency device PM QoS type,
    but it will be different from default_value for the new latency
    tolerance device PM QoS type introduced by the next changeset.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

04 Feb, 2014

1 commit

  • arch/arm/mach-tegra/pm.c, kernel/power/console.c and mm/vmpressure.c
    were somehow getting slab.h indirectly through cgroup.h which in turn
    was getting it indirectly through xattr.h. A scheduled cgroup change
    drops xattr.h inclusion from cgroup.h and breaks compilation of these
    three files. Add explicit slab.h includes to the three files.

    A pending cgroup patch depends on this change and it'd be great if
    this can be routed through cgroup/for-3.14-fixes branch.

    Signed-off-by: Tejun Heo
    Acked-by: Stephen Warren
    Cc: Thierry Reding
    Cc: linux-tegra@vger.kernel.org
    Cc: "Rafael J. Wysocki"
    Cc: linux-pm@vger.kernel.org
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Cc: Balbir Singh
    Cc: KAMEZAWA Hiroyuki
    Cc: cgroups@vger.kernel.org

    Tejun Heo
     

31 Jan, 2014

1 commit

  • Pull core block IO changes from Jens Axboe:
    "The major piece in here is the immutable bio_ve series from Kent, the
    rest is fairly minor. It was supposed to go in last round, but
    various issues pushed it to this release instead. The pull request
    contains:

    - Various smaller blk-mq fixes from different folks. Nothing major
    here, just minor fixes and cleanups.

    - Fix for a memory leak in the error path in the block ioctl code
    from Christian Engelmayer.

    - Header export fix from CaiZhiyong.

    - Finally the immutable biovec changes from Kent Overstreet. This
    enables some nice future work on making arbitrarily sized bios
    possible, and splitting more efficient. Related fixes to immutable
    bio_vecs:

    - dm-cache immutable fixup from Mike Snitzer.
    - btrfs immutable fixup from Muthu Kumar.

    - bio-integrity fix from Nic Bellinger, which is also going to stable"

    * 'for-3.14/core' of git://git.kernel.dk/linux-block: (44 commits)
    xtensa: fixup simdisk driver to work with immutable bio_vecs
    block/blk-mq-cpu.c: use hotcpu_notifier()
    blk-mq: for_each_* macro correctness
    block: Fix memory leak in rw_copy_check_uvector() handling
    bio-integrity: Fix bio_integrity_verify segment start bug
    block: remove unrelated header files and export symbol
    blk-mq: uses page->list incorrectly
    blk-mq: use __smp_call_function_single directly
    btrfs: fix missing increment of bi_remaining
    Revert "block: Warn and free bio if bi_end_io is not set"
    block: Warn and free bio if bi_end_io is not set
    blk-mq: fix initializing request's start time
    block: blk-mq: don't export blk_mq_free_queue()
    block: blk-mq: make blk_sync_queue support mq
    block: blk-mq: support draining mq queue
    dm cache: increment bi_remaining when bi_end_io is restored
    block: fixup for generic bio chaining
    block: Really silence spurious compiler warnings
    block: Silence spurious compiler warnings
    block: Kill bio_pair_split()
    ...

    Linus Torvalds
     

25 Jan, 2014

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "As far as the number of commits goes, the top spot belongs to ACPI
    this time with cpufreq in the second position and a handful of PM
    core, PNP and cpuidle updates. They are fixes and cleanups mostly, as
    usual, with a couple of new features in the mix.

    The most visible change is probably that we will create struct
    acpi_device objects (visible in sysfs) for all devices represented in
    the ACPI tables regardless of their status and there will be a new
    sysfs attribute under those objects allowing user space to check that
    status via _STA.

    Consequently, ACPI device eject or generally hot-removal will not
    delete those objects, unless the table containing the corresponding
    namespace nodes is unloaded, which is extremely rare. Also ACPI
    container hotplug will be handled quite a bit differently and cpufreq
    will support CPU boost ("turbo") generically and not only in the
    acpi-cpufreq driver.

    Specifics:

    - ACPI core changes to make it create a struct acpi_device object for
    every device represented in the ACPI tables during all namespace
    scans regardless of the current status of that device. In
    accordance with this, ACPI hotplug operations will not delete those
    objects, unless the underlying ACPI tables go away.

    - On top of the above, new sysfs attribute for ACPI device objects
    allowing user space to check device status by triggering the
    execution of _STA for its ACPI object. From Srinivas Pandruvada.

    - ACPI core hotplug changes reducing code duplication, integrating
    the PCI root hotplug with the core and reworking container hotplug.

    - ACPI core simplifications making it use ACPI_COMPANION() in the
    code "glueing" ACPI device objects to "physical" devices.

    - ACPICA update to upstream version 20131218. This adds support for
    the DBG2 and PCCT tables to ACPICA, fixes some bugs and improves
    debug facilities. From Bob Moore, Lv Zheng and Betty Dall.

    - Init code change to carry out the early ACPI initialization
    earlier. That should allow us to use ACPI during the timekeeping
    initialization and possibly to simplify the EFI initialization too.
    From Chun-Yi Lee.

    - Clenups of the inclusions of ACPI headers in many places all over
    from Lv Zheng and Rashika Kheria (work in progress).

    - New helper for ACPI _DSM execution and rework of the code in
    drivers that uses _DSM to execute it via the new helper. From
    Jiang Liu.

    - New Win8 OSI blacklist entries from Takashi Iwai.

    - Assorted ACPI fixes and cleanups from Al Stone, Emil Goode, Hanjun
    Guo, Lan Tianyu, Masanari Iida, Oliver Neukum, Prarit Bhargava,
    Rashika Kheria, Tang Chen, Zhang Rui.

    - intel_pstate driver updates, including proper Baytrail support,
    from Dirk Brandewie and intel_pstate documentation from Ramkumar
    Ramachandra.

    - Generic CPU boost ("turbo") support for cpufreq from Lukasz
    Majewski.

    - powernow-k6 cpufreq driver fixes from Mikulas Patocka.

    - cpufreq core fixes and cleanups from Viresh Kumar, Jane Li, Mark
    Brown.

    - Assorted cpufreq drivers fixes and cleanups from Anson Huang, John
    Tobias, Paul Bolle, Paul Walmsley, Sachin Kamat, Shawn Guo, Viresh
    Kumar.

    - cpuidle cleanups from Bartlomiej Zolnierkiewicz.

    - Support for hibernation APM events from Bin Shi.

    - Hibernation fix to avoid bringing up nonboot CPUs with ACPI EC
    disabled during thaw transitions from Bjørn Mork.

    - PM core fixes and cleanups from Ben Dooks, Leonardo Potenza, Ulf
    Hansson.

    - PNP subsystem fixes and cleanups from Dmitry Torokhov, Levente
    Kurusa, Rashika Kheria.

    - New tool for profiling system suspend from Todd E Brandt and a
    cpupower tool cleanup from One Thousand Gnomes"

    * tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (153 commits)
    thermal: exynos: boost: Automatic enable/disable of BOOST feature (at Exynos4412)
    cpufreq: exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ
    Documentation: cpufreq / boost: Update BOOST documentation
    cpufreq: exynos: Extend Exynos cpufreq driver to support boost
    cpufreq / boost: Kconfig: Support for software-managed BOOST
    acpi-cpufreq: Adjust the code to use the common boost attribute
    cpufreq: Add boost frequency support in core
    intel_pstate: Add trace point to report internal state.
    cpufreq: introduce cpufreq_generic_get() routine
    ARM: SA1100: Create dummy clk_get_rate() to avoid build failures
    cpufreq: stats: create sysfs entries when cpufreq_stats is a module
    cpufreq: stats: free table and remove sysfs entry in a single routine
    cpufreq: stats: remove hotplug notifiers
    cpufreq: stats: handle cpufreq_unregister_driver() and suspend/resume properly
    cpufreq: speedstep: remove unused speedstep_get_state
    platform: introduce OF style 'modalias' support for platform bus
    PM / tools: new tool for suspend/resume performance optimization
    ACPI: fix module autoloading for ACPI enumerated devices
    ACPI: add module autoloading support for ACPI enumerated devices
    ACPI: fix create_modalias() return value handling
    ...

    Linus Torvalds
     

22 Jan, 2014

1 commit

  • Switch to memblock interfaces for early memory allocator instead of
    bootmem allocator. No functional change in beahvior than what it is in
    current code from bootmem users points of view.

    Archs already converted to NO_BOOTMEM now directly use memblock
    interfaces instead of bootmem wrappers build on top of memblock. And
    the archs which still uses bootmem, these new apis just fallback to
    exiting bootmem APIs.

    Acked-by: "Rafael J. Wysocki"
    Signed-off-by: Santosh Shilimkar
    Cc: Arnd Bergmann
    Cc: Christoph Lameter
    Cc: Greg Kroah-Hartman
    Cc: Grygorii Strashko
    Cc: H. Peter Anvin
    Cc: Johannes Weiner
    Cc: KAMEZAWA Hiroyuki
    Cc: Konrad Rzeszutek Wilk
    Cc: Michal Hocko
    Cc: Paul Walmsley
    Cc: Pavel Machek
    Cc: Russell King
    Cc: Tejun Heo
    Cc: Tony Lindgren
    Cc: Yinghai Lu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Santosh Shilimkar
     

06 Jan, 2014

1 commit

  • Since create_image() only executes platform_leave() if in_suspend is
    not set, enable_nonboot_cpus() is run by it with EC transactions
    blocked (on ACPI systems) in the image creation code path (that is,
    for in_suspend set), which may cause CPU online to fail for the CPUs
    in question. In particular, this causes the acpi_cpufreq driver's
    initialization to fail for those CPUs on some systems with the
    following dmesg:

    cpufreq: adding CPU 1
    acpi_cpufreq_cpu_init
    cpufreq: FREQ: 1401000 - CPU: 0
    ACPI Exception: AE_BAD_PARAMETER, Returned by Handler for [EmbeddedControl] (20130725/evregion-287)
    ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPC_.EC__.LPMD] (Node ffff88023249ab28), AE_BAD_PARAMETER (20130725/psparse-536)
    ACPI Error: Method parse/execution failed [\_PR_.CPU0._PPC] (Node ffff88023270e3f8), AE_BAD_PARAMETER (20130725/psparse-536)
    ACPI Error: Method parse/execution failed [\_PR_.CPU1._PPC] (Node ffff88023270e290), AE_BAD_PARAMETER (20130725/psparse-536)
    ACPI Exception: AE_BAD_PARAMETER, Evaluating _PPC (20130725/processor_perflib-140)
    cpufreq: initialization failed
    CPU1 is up

    To fix this problem, modify create_image() to execute platform_leave()
    unconditionally. [rjw: This shouldn't lead to any significant side
    effects on ACPI systems.]

    Signed-off-by: Bjørn Mork
    [rjw: Changelog]
    Signed-off-by: Rafael J. Wysocki

    Bjørn Mork
     

01 Jan, 2014

1 commit

  • Needed to bring blk-mq uptodate, since changes have been going in
    since for-3.14/core was established.

    Fixup merge issues related to the immutable biovec changes.

    Signed-off-by: Jens Axboe

    Conflicts:
    block/blk-flush.c
    fs/btrfs/check-integrity.c
    fs/btrfs/extent_io.c
    fs/btrfs/scrub.c
    fs/logfs/dev_bdev.c

    Jens Axboe
     

30 Dec, 2013

1 commit


22 Dec, 2013

1 commit

  • kmemleak reported a memory leak as below.

    unreferenced object 0xffff880118f14700 (size 32):
    comm "swapper/0", pid 1, jiffies 4294877401 (age 123.283s)
    hex dump (first 32 bytes):
    00 01 10 00 00 00 ad de 00 02 20 00 00 00 ad de .......... .....
    00 d4 d2 18 01 88 ff ff 01 00 00 00 00 04 00 00 ................
    backtrace:
    [] kmemleak_alloc+0x4e/0xb0
    [] kmem_cache_alloc_trace+0x1ec/0x260
    [] pm_vt_switch_required+0x76/0xb0
    [] register_framebuffer+0x195/0x320
    [] efifb_probe+0x718/0x780
    [] platform_drv_probe+0x45/0xb0
    [] driver_probe_device+0x87/0x3a0
    [] __driver_attach+0x93/0xa0
    [] bus_for_each_dev+0x63/0xa0
    [] driver_attach+0x1e/0x20
    [] bus_add_driver+0x180/0x250
    [] driver_register+0x64/0xf0
    [] __platform_driver_register+0x4a/0x50
    [] efifb_driver_init+0x12/0x14
    [] do_one_initcall+0xfa/0x1b0
    [] kernel_init_freeable+0x17b/0x201

    In pm_vt_switch_required(), "entry" variable is allocated via kmalloc().
    So, in pm_vt_switch_unregister(), it needs to call kfree() when object
    is deleted from list.

    Signed-off-by: Masami Ichikawa
    Reviewed-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Masami Ichikawa
     

30 Nov, 2013

1 commit

  • To support the ability to implement PM hibernation code as modules
    the hibernation_set_ops function requires to be exported.

    Similar solution already available for suspend_set_ops
    (please refer to commit a5e4fd8783a2bec861ecf1138cdc042269ff59aa).

    Signed-off-by: Leonardo Potenza
    Signed-off-by: Edwin Verplanke
    Reviewed-by: Rafael J. Wysocki
    Signed-off-by: Rafael J. Wysocki

    Leonardo Potenza
     

24 Nov, 2013

1 commit

  • Immutable biovecs are going to require an explicit iterator. To
    implement immutable bvecs, a later patch is going to add a bi_bvec_done
    member to this struct; for now, this patch effectively just renames
    things.

    Signed-off-by: Kent Overstreet
    Cc: Jens Axboe
    Cc: Geert Uytterhoeven
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "Ed L. Cashin"
    Cc: Nick Piggin
    Cc: Lars Ellenberg
    Cc: Jiri Kosina
    Cc: Matthew Wilcox
    Cc: Geoff Levand
    Cc: Yehuda Sadeh
    Cc: Sage Weil
    Cc: Alex Elder
    Cc: ceph-devel@vger.kernel.org
    Cc: Joshua Morris
    Cc: Philip Kelleher
    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: Konrad Rzeszutek Wilk
    Cc: Jeremy Fitzhardinge
    Cc: Neil Brown
    Cc: Alasdair Kergon
    Cc: Mike Snitzer
    Cc: dm-devel@redhat.com
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux390@de.ibm.com
    Cc: Boaz Harrosh
    Cc: Benny Halevy
    Cc: "James E.J. Bottomley"
    Cc: Greg Kroah-Hartman
    Cc: "Nicholas A. Bellinger"
    Cc: Alexander Viro
    Cc: Chris Mason
    Cc: "Theodore Ts'o"
    Cc: Andreas Dilger
    Cc: Jaegeuk Kim
    Cc: Steven Whitehouse
    Cc: Dave Kleikamp
    Cc: Joern Engel
    Cc: Prasad Joshi
    Cc: Trond Myklebust
    Cc: KONISHI Ryusuke
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Ben Myers
    Cc: xfs@oss.sgi.com
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Herton Ronaldo Krzesinski
    Cc: Ben Hutchings
    Cc: Andrew Morton
    Cc: Guo Chao
    Cc: Tejun Heo
    Cc: Asai Thambi S P
    Cc: Selvan Mani
    Cc: Sam Bradshaw
    Cc: Wei Yongjun
    Cc: "Roger Pau Monné"
    Cc: Jan Beulich
    Cc: Stefano Stabellini
    Cc: Ian Campbell
    Cc: Sebastian Ott
    Cc: Christian Borntraeger
    Cc: Minchan Kim
    Cc: Jiang Liu
    Cc: Nitin Gupta
    Cc: Jerome Marchand
    Cc: Joe Perches
    Cc: Peng Tao
    Cc: Andy Adamson
    Cc: fanchaoting
    Cc: Jie Liu
    Cc: Sunil Mushran
    Cc: "Martin K. Petersen"
    Cc: Namjae Jeon
    Cc: Pankaj Kumar
    Cc: Dan Magenheimer
    Cc: Mel Gorman 6

    Kent Overstreet
     

19 Nov, 2013

1 commit


15 Nov, 2013

1 commit

  • I have received a report about the BUG_ON() in free_basic_memory_bitmaps()
    triggering mysteriously during an aborted s2disk hibernation attempt.
    The only way I can explain that is that /dev/snapshot was first
    opened for writing (resume mode), then closed and then opened again
    for reading and closed again without freezing tasks. In that case
    the first invocation of snapshot_open() would set the free_bitmaps
    flag in snapshot_state, which is a static variable. That flag
    wouldn't be cleared later and the second invocation of snapshot_open()
    would just leave it like that, so the subsequent snapshot_release()
    would see data->frozen set and free_basic_memory_bitmaps() would be
    called unnecessarily.

    To prevent that from happening clear data->free_bitmaps in
    snapshot_open() when the file is being opened for reading (hibernate
    mode).

    In addition to that, replace the BUG_ON() in free_basic_memory_bitmaps()
    with a WARN_ON() as the kernel can continue just fine if the condition
    checked by that macro occurs.

    Fixes: aab172891542 (PM / hibernate: Fix user space driven resume regression)
    Reported-by: Oliver Lorenz
    Signed-off-by: Rafael J. Wysocki
    Cc: 3.12+ # 3.12+

    Rafael J. Wysocki
     

08 Nov, 2013

1 commit


07 Nov, 2013

1 commit

  • When system has a lot of highmem (e.g. 16GiB using a 32 bits kernel),
    the code to calculate how much memory we need to preallocate in
    normal zone may cause overflow. As Leon has analysed:

    It looks that during computing 'alloc' variable there is overflow:
    alloc = (3943404 - 1970542) - 1978280 = -5418 (signed)
    And this function goes to err_out.

    Fix this by avoiding that overflow.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=60817
    Reported-and-tested-by: Leon Drugi
    Cc: All applicable
    Signed-off-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Aaron Lu
     

28 Oct, 2013

2 commits


25 Oct, 2013

1 commit

  • software_resume is being called after deferred_probe_initcall in
    drivers base. If the probing of the device that contains the resume
    image is deferred, and the system has been instructed to wait for
    it to show up, this wait will occur in software_resume. This causes
    a deadlock.

    Move software_resume into late_initcall_sync so that it happens
    after all the other late_initcalls.

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

    Russ Dill
     

19 Oct, 2013

1 commit


18 Oct, 2013

2 commits

  • Rather than hard-lock the kernel, dump the suspend/resume thread stack
    and panic() to capture a message in pstore when a driver takes too long
    to suspend/resume. Default suspend/resume watchdog timeout is set to 12
    seconds to be longer than the usbhid 10 second timeout, but could be
    changed at compile time.

    Exclude from the watchdog the time spent waiting for children that
    are resumed asynchronously and time every device, whether or not they
    resumed synchronously.

    This patch is targeted for mobile devices where a suspend/resume lockup
    could cause a system reboot. Information about failing device can be
    retrieved in subsequent boot session by mounting pstore and inspecting
    the log. Laptops with EFI-enabled pstore could also benefit from
    this feature.

    The hardware watchdog timer is likely suspended during this time and
    couldn't be relied upon. The soft-lockup detector would eventually tell
    that tasks are not scheduled, but would provide little context as to why.
    The patch hence uses system timer and assumes it is still active while the
    devices are suspended/resumed.

    This feature can be enabled/disabled during kernel configuration.

    This change is based on earlier work by San Mehat.

    Signed-off-by: Benoit Goby
    Signed-off-by: Zoran Markovic
    Acked-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Benoit Goby
     
  • Let kstrtos32_from_user() do the necessary calls and checks.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     

01 Oct, 2013

1 commit

  • Recent commit 8fd37a4 (PM / hibernate: Create memory bitmaps after
    freezing user space) broke the resume part of the user space driven
    hibernation (s2disk), because I forgot that the resume utility
    loaded the image into memory without freezing user space (it still
    freezes tasks after loading the image). This means that during user
    space driven resume we need to create the memory bitmaps at the
    "device open" time rather than at the "freeze tasks" time, so make
    that happen (that's a special case anyway, so it needs to be treated
    in a special way).

    Reported-and-tested-by: Ronald
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

13 Sep, 2013

1 commit

  • Pull ACPI and power management fixes from Rafael Wysocki:
    "All of these commits are fixes that have emerged recently and some of
    them fix bugs introduced during this merge window.

    Specifics:

    1) ACPI-based PCI hotplug (ACPIPHP) fixes related to spurious events

    After the recent ACPIPHP changes we've seen some interesting
    breakage on a system that triggers device check notifications
    during boot for non-existing devices. Although those
    notifications are really spurious, we should be able to deal with
    them nevertheless and that shouldn't introduce too much overhead.
    Four commits to make that work properly.

    2) Memory hotplug and hibernation mutual exclusion rework

    This was maent to be a cleanup, but it happens to fix a classical
    ABBA deadlock between system suspend/hibernation and ACPI memory
    hotplug which is possible if they are started roughly at the same
    time. Three commits rework memory hotplug so that it doesn't
    acquire pm_mutex and make hibernation use device_hotplug_lock
    which prevents it from racing with memory hotplug.

    3) ACPI Intel LPSS (Low-Power Subsystem) driver crash fix

    The ACPI LPSS driver crashes during boot on Apple Macbook Air with
    Haswell that has slightly unusual BIOS configuration in which one
    of the LPSS device's _CRS method doesn't return all of the
    information expected by the driver. Fix from Mika Westerberg, for
    stable.

    4) ACPICA fix related to Store->ArgX operation

    AML interpreter fix for obscure breakage that causes AML to be
    executed incorrectly on some machines (observed in practice).
    From Bob Moore.

    5) ACPI core fix for PCI ACPI device objects lookup

    There still are cases in which there is more than one ACPI device
    object matching a given PCI device and we don't choose the one
    that the BIOS expects us to choose, so this makes the lookup take
    more criteria into account in those cases.

    6) Fix to prevent cpuidle from crashing in some rare cases

    If the result of cpuidle_get_driver() is NULL, which can happen on
    some systems, cpuidle_driver_ref() will crash trying to use that
    pointer and the Daniel Fu's fix prevents that from happening.

    7) cpufreq fixes related to CPU hotplug

    Stephen Boyd reported a number of concurrency problems with
    cpufreq related to CPU hotplug which are addressed by a series of
    fixes from Srivatsa S Bhat and Viresh Kumar.

    8) cpufreq fix for time conversion in time_in_state attribute

    Time conversion carried out by cpufreq when user space attempts to
    read /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state
    won't work correcty if cputime_t doesn't map directly to jiffies.
    Fix from Andreas Schwab.

    9) Revert of a troublesome cpufreq commit

    Commit 7c30ed5 (cpufreq: make sure frequency transitions are
    serialized) was intended to address some known concurrency
    problems in cpufreq related to the ordering of transitions, but
    unfortunately it introduced several problems of its own, so I
    decided to revert it now and address the original problems later
    in a more robust way.

    10) Intel Haswell CPU models for intel_pstate from Nell Hardcastle.

    11) cpufreq fixes related to system suspend/resume

    The recent cpufreq changes that made it preserve CPU sysfs
    attributes over suspend/resume cycles introduced a possible NULL
    pointer dereference that caused it to crash during the second
    attempt to suspend. Three commits from Srivatsa S Bhat fix that
    problem and a couple of related issues.

    12) cpufreq locking fix

    cpufreq_policy_restore() should acquire the lock for reading, but
    it acquires it for writing. Fix from Lan Tianyu"

    * tag 'pm+acpi-fixes-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (25 commits)
    cpufreq: Acquire the lock in cpufreq_policy_restore() for reading
    cpufreq: Prevent problems in update_policy_cpu() if last_cpu == new_cpu
    cpufreq: Restructure if/else block to avoid unintended behavior
    cpufreq: Fix crash in cpufreq-stats during suspend/resume
    intel_pstate: Add Haswell CPU models
    Revert "cpufreq: make sure frequency transitions are serialized"
    cpufreq: Use signed type for 'ret' variable, to store negative error values
    cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes
    cpufreq: Synchronize the cpufreq store_*() routines with CPU hotplug
    cpufreq: Invoke __cpufreq_remove_dev_finish() after releasing cpu_hotplug.lock
    cpufreq: Split __cpufreq_remove_dev() into two parts
    cpufreq: Fix wrong time unit conversion
    cpufreq: serialize calls to __cpufreq_governor()
    cpufreq: don't allow governor limits to be changed when it is disabled
    ACPI / bind: Prefer device objects with _STA to those without it
    ACPI / hotplug / PCI: Avoid parent bus rescans on spurious device checks
    ACPI / hotplug / PCI: Use _OST to notify firmware about notify status
    ACPI / hotplug / PCI: Avoid doing too much for spurious notifies
    ACPICA: Fix for a Store->ArgX when ArgX contains a reference to a field.
    ACPI / hotplug / PCI: Don't trim devices before scanning the namespace
    ...

    Linus Torvalds
     

12 Sep, 2013

1 commit


11 Sep, 2013

1 commit


04 Sep, 2013

1 commit

  • Pull x86/asmlinkage changes from Ingo Molnar:
    "As a preparation for Andi Kleen's LTO patchset (link time
    optimizations using GCC's -flto which build time optimization has
    steadily increased in quality over the past few years and might
    eventually be usable for the kernel too) this tree includes a handful
    of preparatory patches that make function calling convention
    annotations consistent again:

    - Mark every function without arguments (or 64bit only) that is used
    by assembly code with asmlinkage()

    - Mark every function with parameters or variables that is used by
    assembly code as __visible.

    For the vanilla kernel this has documentation, consistency and
    debuggability advantages, for the time being"

    * 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/asmlinkage: Fix warning in xen asmlinkage change
    x86, asmlinkage, vdso: Mark vdso variables __visible
    x86, asmlinkage, power: Make various symbols used by the suspend asm code visible
    x86, asmlinkage: Make dump_stack visible
    x86, asmlinkage: Make 64bit checksum functions visible
    x86, asmlinkage, paravirt: Add __visible/asmlinkage to xen paravirt ops
    x86, asmlinkage, apm: Make APM data structure used from assembler visible
    x86, asmlinkage: Make syscall tables visible
    x86, asmlinkage: Make several variables used from assembler/linker script visible
    x86, asmlinkage: Make kprobes code visible and fix assembler code
    x86, asmlinkage: Make various syscalls asmlinkage
    x86, asmlinkage: Make 32bit/64bit __switch_to visible
    x86, asmlinkage: Make _*_start_kernel visible
    x86, asmlinkage: Make all interrupt handlers asmlinkage / __visible
    x86, asmlinkage: Change dotraplinkage into __visible on 32bit
    x86: Fix sys_call_table type in asm/syscall.h

    Linus Torvalds
     

31 Aug, 2013

2 commits

  • Since all of the memory hotplug operations have to be carried out
    under device_hotplug_lock, they won't need to acquire pm_mutex if
    device_hotplug_lock is held around hibernation.

    For this reason, make the hibernation code acquire
    device_hotplug_lock after freezing user space processes and
    release it before thawing them. At the same tim drop the
    lock_system_sleep() and unlock_system_sleep() calls from
    lock_memory_hotplug() and unlock_memory_hotplug(), respectively.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     
  • The hibernation core uses special memory bitmaps during image
    creation and restoration and traditionally those bitmaps are
    allocated before freezing tasks, because in the past GFP_KERNEL
    allocations might not work after all tasks had been frozen.

    However, this is an anachronism, because hibernation_snapshot()
    now calls hibernate_preallocate_memory() which allocates memory
    for the image upfront anyway, so the memory bitmaps may be
    allocated after freezing user space safely.

    For this reason, move all of the create_basic_memory_bitmaps()
    calls after freeze_processes() and all of the corresponding
    free_basic_memory_bitmaps() calls before thaw_processes().

    This will allow us to hold device_hotplug_lock around hibernation
    without the need to worry about freezing issues with user space
    processes attempting to acquire it via sysfs attributes after the
    creation of memory bitmaps and before the freezing of tasks.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     

27 Aug, 2013

1 commit


14 Aug, 2013

1 commit

  • pm_qos_update_request_timeout() updates a qos and then schedules
    a delayed work item to bring the qos back down to the default
    after the timeout. When the work item runs, pm_qos_work_fn() will
    call pm_qos_update_request() and deadlock because it tries to
    cancel itself via cancel_delayed_work_sync(). Future callers of
    that qos will also hang waiting to cancel the work that is
    canceling itself. Let's extract the little bit of code that does
    the real work of pm_qos_update_request() and call it from the
    work function so that we don't deadlock.

    Before ed1ac6e (PM: don't use [delayed_]work_pending()) this didn't
    happen because the work function wouldn't try to cancel itself.

    Signed-off-by: Stephen Boyd
    Reviewed-by: Tejun Heo
    Cc: 3.9+ # 3.9+
    Signed-off-by: Rafael J. Wysocki

    Stephen Boyd