15 Oct, 2020

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These rework the collection of cpufreq statistics to allow it to take
    place if fast frequency switching is enabled in the governor, rework
    the frequency invariance handling in the cpufreq core and drivers, add
    new hardware support to a couple of cpufreq drivers, fix a number of
    assorted issues and clean up the code all over.

    Specifics:

    - Rework cpufreq statistics collection to allow it to take place when
    fast frequency switching is enabled in the governor (Viresh Kumar).

    - Make the cpufreq core set the frequency scale on behalf of the
    driver and update several cpufreq drivers accordingly (Ionela
    Voinescu, Valentin Schneider).

    - Add new hardware support to the STI and qcom cpufreq drivers and
    improve them (Alain Volmat, Manivannan Sadhasivam).

    - Fix multiple assorted issues in cpufreq drivers (Jon Hunter,
    Krzysztof Kozlowski, Matthias Kaehlcke, Pali Rohár, Stephan
    Gerhold, Viresh Kumar).

    - Fix several assorted issues in the operating performance points
    (OPP) framework (Stephan Gerhold, Viresh Kumar).

    - Allow devfreq drivers to fetch devfreq instances by DT enumeration
    instead of using explicit phandles and modify the devfreq core code
    to support driver-specific devfreq DT bindings (Leonard Crestez,
    Chanwoo Choi).

    - Improve initial hardware resetting in the tegra30 devfreq driver
    and clean up the tegra cpuidle driver (Dmitry Osipenko).

    - Update the cpuidle core to collect state entry rejection statistics
    and expose them via sysfs (Lina Iyer).

    - Improve the ACPI _CST code handling diagnostics (Chen Yu).

    - Update the PSCI cpuidle driver to allow the PM domain
    initialization to occur in the OSI mode as well as in the PC mode
    (Ulf Hansson).

    - Rework the generic power domains (genpd) core code to allow domain
    power off transition to be aborted in the absence of the "power
    off" domain callback (Ulf Hansson).

    - Fix two suspend-to-idle issues in the ACPI EC driver (Rafael
    Wysocki).

    - Fix the handling of timer_expires in the PM-runtime framework on
    32-bit systems and the handling of device links in it (Grygorii
    Strashko, Xiang Chen).

    - Add IO requests batching support to the hibernate image saving and
    reading code and drop a bogus get_gendisk() from there (Xiaoyi
    Chen, Christoph Hellwig).

    - Allow PCIe ports to be put into the D3cold power state if they are
    power-manageable via ACPI (Lukas Wunner).

    - Add missing header file include to a power capping driver (Pujin
    Shi).

    - Clean up the qcom-cpr AVS driver a bit (Liu Shixin).

    - Kevin Hilman steps down as designated reviwer of adaptive voltage
    scaling (AVS) drivers (Kevin Hilman)"

    * tag 'pm-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits)
    cpufreq: stats: Fix string format specifier mismatch
    arm: disable frequency invariance for CONFIG_BL_SWITCHER
    cpufreq,arm,arm64: restructure definitions of arch_set_freq_scale()
    cpufreq: stats: Add memory barrier to store_reset()
    cpufreq: schedutil: Simplify sugov_fast_switch()
    ACPI: EC: PM: Drop ec_no_wakeup check from acpi_ec_dispatch_gpe()
    ACPI: EC: PM: Flush EC work unconditionally after wakeup
    PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
    PM: hibernate: remove the bogus call to get_gendisk() in software_resume()
    cpufreq: Move traces and update to policy->cur to cpufreq core
    cpufreq: stats: Enable stats for fast-switch as well
    cpufreq: stats: Mark few conditionals with unlikely()
    cpufreq: stats: Remove locking
    cpufreq: stats: Defer stats update to cpufreq_stats_record_transition()
    PM: domains: Allow to abort power off when no ->power_off() callback
    PM: domains: Rename power state enums for genpd
    PM / devfreq: tegra30: Improve initial hardware resetting
    PM / devfreq: event: Change prototype of devfreq_event_get_edev_by_phandle function
    PM / devfreq: Change prototype of devfreq_get_devfreq_by_phandle function
    PM / devfreq: Add devfreq_get_devfreq_by_node function
    ...

    Linus Torvalds
     

06 Oct, 2020

1 commit


01 Sep, 2020

1 commit

  • The current notifiers have the following error handling pattern all
    over the place:

    int err, nr;

    err = __foo_notifier_call_chain(&chain, val_up, v, -1, &nr);
    if (err & NOTIFIER_STOP_MASK)
    __foo_notifier_call_chain(&chain, val_down, v, nr-1, NULL)

    And aside from the endless repetition thereof, it is broken. Consider
    blocking notifiers; both calls take and drop the rwsem, this means
    that the notifier list can change in between the two calls, making @nr
    meaningless.

    Fix this by replacing all the __foo_notifier_call_chain() functions
    with foo_notifier_call_chain_robust() that embeds the above pattern,
    but ensures it is inside a single lock region.

    Note: I switched atomic_notifier_call_chain_robust() to use
    the spinlock, since RCU cannot provide the guarantee
    required for the recovery.

    Note: software_resume() error handling was broken afaict.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Acked-by: Rafael J. Wysocki
    Link: https://lore.kernel.org/r/20200818135804.325626653@infradead.org

    Peter Zijlstra
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

12 Aug, 2020

1 commit

  • Pull libnvdimm updayes from Vishal Verma:
    "You'd normally receive this pull request from Dan Williams, but he's
    busy watching a newborn (Congrats Dan!), so I'm watching libnvdimm
    this cycle.

    This adds a new feature in libnvdimm - 'Runtime Firmware Activation',
    and a few small cleanups and fixes in libnvdimm and DAX. I'd
    originally intended to make separate topic-based pull requests - one
    for libnvdimm, and one for DAX, but some of the DAX material fell out
    since it wasn't quite ready.

    Summary:

    - add 'Runtime Firmware Activation' support for NVDIMMs that
    advertise the relevant capability

    - misc libnvdimm and DAX cleanups"

    * tag 'libnvdimm-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
    libnvdimm/security: ensure sysfs poll thread woke up and fetch updated attr
    libnvdimm/security: the 'security' attr never show 'overwrite' state
    libnvdimm/security: fix a typo
    ACPI: NFIT: Fix ARS zero-sized allocation
    dax: Fix incorrect argument passed to xas_set_err()
    ACPI: NFIT: Add runtime firmware activate support
    PM, libnvdimm: Add runtime firmware activation support
    libnvdimm: Convert to DEVICE_ATTR_ADMIN_RO()
    drivers/dax: Expand lock scope to cover the use of addresses
    fs/dax: Remove unused size parameter
    dax: print error message by pr_info() in __generic_fsdax_supported()
    driver-core: Introduce DEVICE_ATTR_ADMIN_{RO,RW}
    tools/testing/nvdimm: Emulate firmware activation commands
    tools/testing/nvdimm: Prepare nfit_ctl_test() for ND_CMD_CALL emulation
    tools/testing/nvdimm: Add command debug messages
    tools/testing/nvdimm: Cleanup dimm index passing
    ACPI: NFIT: Define runtime firmware activation commands
    ACPI: NFIT: Move bus_dsm_mask out of generic nvdimm_bus_descriptor
    libnvdimm: Validate command family indices

    Linus Torvalds
     

29 Jul, 2020

1 commit

  • Abstract platform specific mechanics for nvdimm firmware activation
    behind a handful of generic ops. At the bus level ->activate_state()
    indicates the unified state (idle, busy, armed) of all DIMMs on the bus,
    and ->capability() indicates the system state expectations for activate.
    At the DIMM level ->activate_state() indicates the per-DIMM state,
    ->activate_result() indicates the outcome of the last activation
    attempt, and ->arm() attempts to transition the DIMM from 'idle' to
    'armed'.

    A new hibernate_quiet_exec() facility is added to support firmware
    activation in an OS defined system quiesce state. It leverages the fact
    that the hibernate-freeze state wants to assert that a memory
    hibernation snapshot can be taken. This is in contrast to a platform
    firmware defined quiesce state that may forcefully quiet the memory
    controller independent of whether an individual device-driver properly
    supports hibernate-freeze.

    The libnvdimm sysfs interface is extended to support detection of a
    firmware activate capability. The mechanism supports enumeration and
    triggering of firmware activate, optionally in the
    hibernate_quiet_exec() context.

    [rafael: hibernate_quiet_exec() proposal]
    [vishal: fix up sparse warning, grammar in Documentation/]

    Cc: Pavel Machek
    Cc: Ira Weiny
    Cc: Len Brown
    Cc: Jonathan Corbet
    Cc: Dave Jiang
    Cc: Vishal Verma
    Reported-by: kernel test robot
    Co-developed-by: "Rafael J. Wysocki"
    Signed-off-by: "Rafael J. Wysocki"
    Signed-off-by: Dan Williams
    Signed-off-by: Vishal Verma

    Dan Williams
     

15 Jul, 2020

1 commit


19 May, 2020

1 commit

  • Hibernation concurrency handling is currently delegated to user.c,
    where it's also used for regulating the access to the snapshot device.

    In the prospective of making user.c a separate configuration option,
    such mutual exclusion is brought into hibernate.c and made available
    through accessor helpers hereby introduced.

    Signed-off-by: Domenico Andreoli
    Signed-off-by: Rafael J. Wysocki

    Domenico Andreoli
     

27 Apr, 2020

1 commit

  • Currently the kernel threads are not frozen in software_resume(), so
    between dpm_suspend_start(PMSG_QUIESCE) and resume_target_kernel(),
    system_freezable_power_efficient_wq can still try to submit SCSI
    commands and this can cause a panic since the low level SCSI driver
    (e.g. hv_storvsc) has quiesced the SCSI adapter and can not accept
    any SCSI commands: https://lkml.org/lkml/2020/4/10/47

    At first I posted a fix (https://lkml.org/lkml/2020/4/21/1318) trying
    to resolve the issue from hv_storvsc, but with the help of
    Bart Van Assche, I realized it's better to fix software_resume(),
    since this looks like a generic issue, not only pertaining to SCSI.

    Cc: All applicable
    Signed-off-by: Dexuan Cui
    Signed-off-by: Rafael J. Wysocki

    Dexuan Cui
     

01 Apr, 2020

1 commit


07 Jan, 2020

1 commit


20 Aug, 2019

1 commit

  • There is currently no way to verify the resume image when returning
    from hibernate. This might compromise the signed modules trust model,
    so until we can work with signed hibernate images we disable it when the
    kernel is locked down.

    Signed-off-by: Josh Boyer
    Signed-off-by: David Howells
    Signed-off-by: Matthew Garrett
    Reviewed-by: Kees Cook
    Cc: rjw@rjwysocki.net
    Cc: pavel@ucw.cz
    cc: linux-pm@vger.kernel.org
    Signed-off-by: James Morris

    Josh Boyer
     

09 Jun, 2019

1 commit

  • Pull yet more SPDX updates from Greg KH:
    "Another round of SPDX header file fixes for 5.2-rc4

    These are all more "GPL-2.0-or-later" or "GPL-2.0-only" tags being
    added, based on the text in the files. We are slowly chipping away at
    the 700+ different ways people tried to write the license text. All of
    these were reviewed on the spdx mailing list by a number of different
    people.

    We now have over 60% of the kernel files covered with SPDX tags:
    $ ./scripts/spdxcheck.py -v 2>&1 | grep Files
    Files checked: 64533
    Files with SPDX: 40392
    Files with errors: 0

    I think the majority of the "easy" fixups are now done, it's now the
    start of the longer-tail of crazy variants to wade through"

    * tag 'spdx-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (159 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 450
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 449
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 448
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 446
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 444
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 443
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 442
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 440
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 438
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 437
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 436
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 435
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 434
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 433
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 432
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 431
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 430
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 429
    ...

    Linus Torvalds
     

07 Jun, 2019

1 commit


05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this file is released under the gplv2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 68 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Armijn Hemel
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190114.292346262@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Jun, 2019

1 commit

  • As explained in

    0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once")

    we always, no matter what, have to bring up x86 HT siblings during boot at
    least once in order to avoid first MCE bringing the system to its knees.

    That means that whenever 'nosmt' is supplied on the kernel command-line,
    all the HT siblings are as a result sitting in mwait or cpudile after
    going through the online-offline cycle at least once.

    This causes a serious issue though when a kernel, which saw 'nosmt' on its
    commandline, is going to perform resume from hibernation: if the resume
    from the hibernated image is successful, cr3 is flipped in order to point
    to the address space of the kernel that is being resumed, which in turn
    means that all the HT siblings are all of a sudden mwaiting on address
    which is no longer valid.

    That results in triple fault shortly after cr3 is switched, and machine
    reboots.

    Fix this by always waking up all the SMT siblings before initiating the
    'restore from hibernation' process; this guarantees that all the HT
    siblings will be properly carried over to the resumed kernel waiting in
    resume_play_dead(), and acted upon accordingly afterwards, based on the
    target kernel configuration.

    Symmetricaly, the resumed kernel has to push the SMT siblings to mwait
    again in case it has SMT disabled; this means it has to online all
    the siblings when resuming (so that they come out of hlt) and offline
    them again to let them reach mwait.

    Cc: 4.19+ # v4.19+
    Debugged-by: Thomas Gleixner
    Fixes: 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once")
    Signed-off-by: Jiri Kosina
    Acked-by: Pavel Machek
    Reviewed-by: Thomas Gleixner
    Reviewed-by: Josh Poimboeuf
    Signed-off-by: Rafael J. Wysocki

    Jiri Kosina
     

27 May, 2019

1 commit

  • On systems with ACPI platform firmware the last stage of hibernation
    is analogous to system suspend to S3 (suspend-to-RAM), so it should
    be handled analogously. In particular, pm_suspend_via_firmware()
    should return 'true' in that stage to let the callers of it know that
    control will be passed to the platform firmware going forward, so
    pm_set_suspend_via_firmware() needs to be called then in analogy with
    acpi_suspend_begin().

    However, the platform hibernation ->begin() callback is invoked
    during the "freeze" transition (before creating a snapshot image of
    system memory) as well as during the "hibernate" transition which is
    the last stage of it and pm_set_suspend_via_firmware() should be
    invoked by that callback in the latter stage only.

    In order to implement that redefine the hibernation ->begin()
    callback to take a pm_message_t argument to indicate which stage
    of hibernation is taking place and rework acpi_hibernation_begin()
    and acpi_hibernation_begin_old() to take it into account as needed.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

07 May, 2019

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These fix the (Intel-specific) Performance and Energy Bias Hint (EPB)
    handling and expose it to user space via sysfs, fix and clean up
    several cpufreq drivers, add support for two new chips to the qoriq
    cpufreq driver, fix, simplify and clean up the cpufreq core and the
    schedutil governor, add support for "CPU" domains to the generic power
    domains (genpd) framework and provide low-level PSCI firmware support
    for that feature, fix the exynos cpuidle driver and fix a couple of
    issues in the devfreq subsystem and clean it up.

    Specifics:

    - Fix the handling of Performance and Energy Bias Hint (EPB) on Intel
    processors and expose it to user space via sysfs to avoid having to
    access it through the generic MSR I/F (Rafael Wysocki).

    - Improve the handling of global turbo changes made by the platform
    firmware in the intel_pstate driver (Rafael Wysocki).

    - Convert some slow-path static_cpu_has() callers to boot_cpu_has()
    in cpufreq (Borislav Petkov).

    - Fix the frequency calculation loop in the armada-37xx cpufreq
    driver (Gregory CLEMENT).

    - Fix possible object reference leaks in multuple cpufreq drivers
    (Wen Yang).

    - Fix kerneldoc comment in the centrino cpufreq driver (dongjian).

    - Clean up the ACPI and maple cpufreq drivers (Viresh Kumar, Mohan
    Kumar).

    - Add support for lx2160a and ls1028a to the qoriq cpufreq driver
    (Vabhav Sharma, Yuantian Tang).

    - Fix kobject memory leak in the cpufreq core (Viresh Kumar).

    - Simplify the IOwait boosting in the schedutil cpufreq governor and
    rework the TSC cpufreq notifier on x86 (Rafael Wysocki).

    - Clean up the cpufreq core and statistics code (Yue Hu, Kyle Lin).

    - Improve the cpufreq documentation, add SPDX license tags to some PM
    documentation files and unify copyright notices in them (Rafael
    Wysocki).

    - Add support for "CPU" domains to the generic power domains (genpd)
    framework and provide low-level PSCI firmware support for that
    feature (Ulf Hansson).

    - Rearrange the PSCI firmware support code and add support for
    SYSTEM_RESET2 to it (Ulf Hansson, Sudeep Holla).

    - Improve genpd support for devices in multiple power domains (Ulf
    Hansson).

    - Unify target residency for the AFTR and coupled AFTR states in the
    exynos cpuidle driver (Marek Szyprowski).

    - Introduce new helper routine in the operating performance points
    (OPP) framework (Andrew-sh.Cheng).

    - Add support for passing on-die termination (ODT) and auto power
    down parameters from the kernel to Trusted Firmware-A (TF-A) to the
    rk3399_dmc devfreq driver (Enric Balletbo i Serra).

    - Add tracing to devfreq (Lukasz Luba).

    - Make the exynos-bus devfreq driver suspend all devices on system
    shutdown (Marek Szyprowski).

    - Fix a few minor issues in the devfreq subsystem and clean it up
    somewhat (Enric Balletbo i Serra, MyungJoo Ham, Rob Herring,
    Saravana Kannan, Yangtao Li).

    - Improve system wakeup diagnostics (Stephen Boyd).

    - Rework filesystem sync messages emitted during system suspend and
    hibernation (Harry Pan)"

    * tag 'pm-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (72 commits)
    cpufreq: Fix kobject memleak
    cpufreq: armada-37xx: fix frequency calculation for opp
    cpufreq: centrino: Fix centrino_setpolicy() kerneldoc comment
    cpufreq: qoriq: add support for lx2160a
    x86: tsc: Rework time_cpufreq_notifier()
    PM / Domains: Allow to attach a CPU via genpd_dev_pm_attach_by_id|name()
    PM / Domains: Search for the CPU device outside the genpd lock
    PM / Domains: Drop unused in-parameter to some genpd functions
    PM / Domains: Use the base device for driver_deferred_probe_check_state()
    cpufreq: qoriq: Add ls1028a chip support
    PM / Domains: Enable genpd_dev_pm_attach_by_id|name() for single PM domain
    PM / Domains: Allow OF lookup for multi PM domain case from ->attach_dev()
    PM / Domains: Don't kfree() the virtual device in the error path
    cpufreq: Move ->get callback check outside of __cpufreq_get()
    PM / Domains: remove unnecessary unlikely()
    cpufreq: Remove needless bios_limit check in show_bios_limit()
    drivers/cpufreq/acpi-cpufreq.c: This fixes the following checkpatch warning
    firmware/psci: add support for SYSTEM_RESET2
    PM / devfreq: add tracing for scheduling work
    trace: events: add devfreq trace event file
    ...

    Linus Torvalds
     

04 May, 2019

1 commit

  • This adds a function to disable secondary CPUs for suspend that are
    not necessarily non-zero / non-boot CPUs. Platforms will be able to
    use this to suspend using non-zero CPUs.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Frederic Weisbecker
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rafael J . Wysocki
    Cc: Thomas Gleixner
    Cc: linuxppc-dev@lists.ozlabs.org
    Link: https://lkml.kernel.org/r/20190411033448.20842-3-npiggin@gmail.com
    Signed-off-by: Ingo Molnar

    Nicholas Piggin
     

02 Apr, 2019

1 commit


06 Aug, 2018

2 commits

  • At present, "systemctl suspend" and "shutdown" can run in parrallel. A
    system can suspend after devices_shutdown(), and resume. Then the shutdown
    task goes on to power off. This causes many devices are not really shut
    off. Hence replacing reboot_mutex with system_transition_mutex (renamed
    from pm_mutex) to achieve the exclusion. The renaming of pm_mutex as
    system_transition_mutex can be better to reflect the purpose of the mutex.

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

    Pingfan Liu
     
  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    This addresses Coverity-ID: 114713 ("Missing break in switch").

    Signed-off-by: Gustavo A. R. Silva
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Gustavo A. R. Silva
     

27 May, 2018

1 commit

  • timekeeping suspend/resume calls read_persistent_clock() which takes
    rtc_lock. That results in might sleep warnings because at that point
    we run with interrupts disabled.

    We cannot convert rtc_lock to a raw spinlock as that would trigger
    other might sleep warnings.

    As a workaround we disable the might sleep warnings by setting
    system_state to SYSTEM_SUSPEND before calling sysdev_suspend() and
    restoring it to SYSTEM_RUNNING afer sysdev_resume(). There is no lock
    contention because hibernate / suspend to RAM is single-CPU at this
    point.

    In s2idle's case the system_state is set to SYSTEM_SUSPEND before
    timekeeping_suspend() which is invoked by the last CPU. In the resume
    case it set back to SYSTEM_RUNNING after timekeeping_resume() which is
    invoked by the first CPU in the resume case. The other CPUs will block
    on tick_freeze_lock.

    Signed-off-by: Thomas Gleixner
    [bigeasy: cover s2idle in tick_freeze() / tick_unfreeze()]
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rafael J. Wysocki

    Thomas Gleixner
     

04 Apr, 2018

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These update the cpuidle poll state definition to reduce excessive
    energy usage related to it, add new CPU ID to the RAPL power capping
    driver, update the ACPI system suspend code to handle some special
    cases better, extend the PM core's device links code slightly, add new
    sysfs attribute for better suspend-to-idle diagnostics and easier
    hibernation handling, update power management tools and clean up
    cpufreq quite a bit.

    Specifics:

    - Modify the cpuidle poll state implementation to prevent CPUs from
    staying in the loop in there for excessive times (Rafael Wysocki).

    - Add Intel Cannon Lake chips support to the RAPL power capping
    driver (Joe Konno).

    - Add reference counting to the device links handling code in the PM
    core (Lukas Wunner).

    - Avoid reconfiguring GPEs on suspend-to-idle in the ACPI system
    suspend code (Rafael Wysocki).

    - Allow devices to be put into deeper low-power states via ACPI if
    both _SxD and _SxW are missing (Daniel Drake).

    - Reorganize the core ACPI suspend-to-idle wakeup code to avoid a
    keyboard wakeup issue on Asus UX331UA (Chris Chiu).

    - Prevent the PCMCIA library code from aborting suspend-to-idle due
    to noirq suspend failures resulting from incorrect assumptions
    (Rafael Wysocki).

    - Add coupled cpuidle supprt to the Exynos3250 platform (Marek
    Szyprowski).

    - Add new sysfs file to make it easier to specify the image storage
    location during hibernation (Mario Limonciello).

    - Add sysfs files for collecting suspend-to-idle usage and time
    statistics for CPU idle states (Rafael Wysocki).

    - Update the pm-graph utilities (Todd Brandt).

    - Reduce the kernel log noise related to reporting Low-power Idle
    constraings by the ACPI system suspend code (Rafael Wysocki).

    - Make it easier to distinguish dedicated wakeup IRQs in the
    /proc/interrupts output (Tony Lindgren).

    - Add the frequency table validation in cpufreq to the core and drop
    it from a number of cpufreq drivers (Viresh Kumar).

    - Drop "cooling-{min|max}-level" for CPU nodes from a couple of DT
    bindings (Viresh Kumar).

    - Clean up the CPU online error code path in the cpufreq core (Viresh
    Kumar).

    - Fix assorted issues in the SCPI, CPPC, mediatek and tegra186
    cpufreq drivers (Arnd Bergmann, Chunyu Hu, George Cherian, Viresh
    Kumar).

    - Drop memory allocation error messages from a few places in cpufreq
    and cpuildle drivers (Markus Elfring)"

    * tag 'pm-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (56 commits)
    ACPI / PM: Fix keyboard wakeup from suspend-to-idle on ASUS UX331UA
    cpufreq: CPPC: Use transition_delay_us depending transition_latency
    PM / hibernate: Change message when writing to /sys/power/resume
    PM / hibernate: Make passing hibernate offsets more friendly
    cpuidle: poll_state: Avoid invoking local_clock() too often
    PM: cpuidle/suspend: Add s2idle usage and time state attributes
    cpuidle: Enable coupled cpuidle support on Exynos3250 platform
    cpuidle: poll_state: Add time limit to poll_idle()
    cpufreq: tegra186: Don't validate the frequency table twice
    cpufreq: speedstep: Don't validate the frequency table twice
    cpufreq: sparc: Don't validate the frequency table twice
    cpufreq: sh: Don't validate the frequency table twice
    cpufreq: sfi: Don't validate the frequency table twice
    cpufreq: scpi: Don't validate the frequency table twice
    cpufreq: sc520: Don't validate the frequency table twice
    cpufreq: s3c24xx: Don't validate the frequency table twice
    cpufreq: qoirq: Don't validate the frequency table twice
    cpufreq: pxa: Don't validate the frequency table twice
    cpufreq: ppc_cbe: Don't validate the frequency table twice
    cpufreq: powernow: Don't validate the frequency table twice
    ...

    Linus Torvalds
     

03 Apr, 2018

1 commit

  • Using this helper allows us to avoid the in-kernel calls to the
    sys_sync() syscall. The ksys_ prefix denotes that this function
    is meant as a drop-in replacement for the syscall. In particular, it
    uses the same calling convention as sys_sync().

    This patch is part of a series which removes in-kernel calls to syscalls.
    On this basis, the syscall entry path can be streamlined. For details, see
    http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

    Cc: Alexander Viro
    Signed-off-by: Dominik Brodowski

    Dominik Brodowski
     

30 Mar, 2018

2 commits


22 Jul, 2017

2 commits

  • Regardless of whether or not debug messages from the core system
    suspend/hibernation code are enabled, it is useful to know when
    system-wide transitions start and finish (or fail), so print "info"
    messages at these points.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Mark Salyzyn

    Rafael J. Wysocki
     
  • Debug messages from the system suspend/hibernation infrastructure can
    fill up the entire kernel log buffer in some cases and anyway they
    are only useful for debugging. They depend on CONFIG_PM_DEBUG, but
    that is set as a rule as some generally useful diagnostic facilities
    depend on it too.

    For this reason, avoid printing those messages by default, but make
    it possible to turn them on as needed with the help of a new sysfs
    attribute under /sys/power/.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

30 Jun, 2017

1 commit

  • attribute_groups are not supposed to change at runtime. All functions
    working with attribute_groups provided by work with const
    attribute_group. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    6332 488 308 7128 1bd8 kernel/power/hibernate.o

    File size After adding 'const':
    text data bss dec hex filename
    6396 424 308 7128 1bd8 kernel/power/hibernate.o

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

    Arvind Yadav
     

04 Mar, 2017

1 commit

  • Pull sched.h split-up from Ingo Molnar:
    "The point of these changes is to significantly reduce the
    header footprint, to speed up the kernel build and to
    have a cleaner header structure.

    After these changes the new 's typical preprocessed
    size goes down from a previous ~0.68 MB (~22K lines) to ~0.45 MB (~15K
    lines), which is around 40% faster to build on typical configs.

    Not much changed from the last version (-v2) posted three weeks ago: I
    eliminated quirks, backmerged fixes plus I rebased it to an upstream
    SHA1 from yesterday that includes most changes queued up in -next plus
    all sched.h changes that were pending from Andrew.

    I've re-tested the series both on x86 and on cross-arch defconfigs,
    and did a bisectability test at a number of random points.

    I tried to test as many build configurations as possible, but some
    build breakage is probably still left - but it should be mostly
    limited to architectures that have no cross-compiler binaries
    available on kernel.org, and non-default configurations"

    * 'WIP.sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (146 commits)
    sched/headers: Clean up
    sched/headers: Remove #ifdefs from
    sched/headers: Remove the include from
    sched/headers, hrtimer: Remove the include from
    sched/headers, x86/apic: Remove the header inclusion from
    sched/headers, timers: Remove the include from
    sched/headers: Remove from
    sched/headers: Remove from
    sched/core: Remove unused prefetch_stack()
    sched/headers: Remove from
    sched/headers: Remove the 'init_pid_ns' prototype from
    sched/headers: Remove from
    sched/headers: Remove from
    sched/headers: Remove the runqueue_is_locked() prototype
    sched/headers: Remove from
    sched/headers: Remove from
    sched/headers: Remove from
    sched/headers: Remove from
    sched/headers: Remove the include from
    sched/headers: Remove from
    ...

    Linus Torvalds
     

03 Mar, 2017

1 commit

  • Pull more power management updates deom Rafael Wysocki:
    "These fix two bugs introduced by recent power management updates (in
    the cpuidle menu governor and intel_pstate) and a few other issues,
    clean up things and remove unused code.

    Specifics:

    - Fix for a cpuidle menu governor problem that started to take an
    unnecessary spinlock after one of the recent updates and that did
    not play well with the RT patch (Rafael Wysocki).

    - Fix for the new intel_pstate operation mode switching feature added
    recently that did not reinitialize P-state limits properly when
    switching operation modes (Rafael Wysocki).

    - Removal of unused global notifiers from the PM QoS framework
    (Viresh Kumar).

    - Generic power domains framework update to make it handle
    asynchronous invocations of PM callbacks in the "noirq" phases of
    system suspend/hibernation correctly (Ulf Hansson).

    - Two hibernation core cleanups (Rafael Wysocki).

    - intel_idle cleanup related to the sysfs interface (Len Brown).

    - Off-by-one bug fix in the OPP (Operating Performance Points)
    framework (Andrzej Hajda).

    - OPP framework's documentation fix (Viresh Kumar).

    - cpufreq qoriq driver cleanup (Tang Yuantian).

    - Fixes for typos in comments in the device runtime PM framework
    (Christophe Jaillet)"

    * tag 'pm-extra-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / OPP: Documentation: Fix opp-microvolt in examples
    intel_idle: stop exposing platform acronyms in sysfs
    cpufreq: intel_pstate: Fix limits issue with operation mode switching
    PM / hibernate: Define pr_fmt() and use pr_*() instead of printk()
    PM / hibernate: Untangle power_down()
    cpuidle: menu: Avoid taking spinlock for accessing QoS values
    PM / QoS: Remove global notifiers
    PM / runtime: Fix some typos
    cpufreq: qoriq: clean up unused code
    PM / OPP: fix off-by-one bug in dev_pm_opp_get_max_volt_latency loop
    PM / Domains: Power off masters immediately in the power off sequence
    PM / Domains: Rename is_async to one_dev_on for genpd_power_off()
    PM / Domains: Move genpd_power_off() above genpd_power_on()

    Linus Torvalds
     

02 Mar, 2017

1 commit


27 Feb, 2017

2 commits


08 Feb, 2017

1 commit

  • Both of these options are poorly named. The features they provide are
    necessary for system security and should not be considered debug only.
    Change the names to CONFIG_STRICT_KERNEL_RWX and
    CONFIG_STRICT_MODULE_RWX to better describe what these options do.

    Signed-off-by: Laura Abbott
    Acked-by: Jessica Yu
    Signed-off-by: Kees Cook

    Laura Abbott
     

13 Sep, 2016

1 commit

  • PAGE_POISONING_ZERO disables zeroing new pages on alloc, they are
    poisoned (zeroed) as they become available.
    In the hibernate use case, free pages will appear in the system without
    being cleared, left there by the loading kernel.

    This patch will make sure free pages are cleared on resume when
    PAGE_POISONING_ZERO is enabled. We free the pages just after resume
    because we can't do it later: going through any device resume code might
    allocate some memory and invalidate the free pages bitmap.

    Thus we don't need to disable hibernation when PAGE_POISONING_ZERO is
    enabled.

    Signed-off-by: Anisse Astier
    Reviewed-by: Kees Cook
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Anisse Astier
     

13 Aug, 2016

2 commits

  • * pm-sleep:
    PM / hibernate: Restore processor state before using per-CPU variables
    x86/power/64: Always create temporary identity mapping correctly

    * pm-cpufreq:
    cpufreq: powernv: Fix crash in gpstate_timer_handler()

    Rafael J. Wysocki
     
  • Restore the processor state before calling any other functions to
    ensure per-CPU variables can be used with KASLR memory randomization.

    Tracing functions use per-CPU variables (GS based on x86) and one was
    called just before restoring the processor state fully. It resulted
    in a double fault when both the tracing & the exception handler
    functions tried to use a per-CPU variable.

    Fixes: bb3632c6101b (PM / sleep: trace events for suspend/resume)
    Reported-and-tested-by: Borislav Petkov
    Reported-by: Jiri Kosina
    Tested-by: Rafael J. Wysocki
    Tested-by: Jiri Kosina
    Signed-off-by: Thomas Garnier
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Thomas Garnier
     

27 Jul, 2016

1 commit

  • Pull power management updates from Rafael Wysocki:
    "Again, the majority of changes go into the cpufreq subsystem, but
    there are no big features this time. The cpufreq changes that stand
    out somewhat are the governor interface rework and improvements
    related to the handling of frequency tables. Apart from those, there
    are fixes and new device/CPU IDs in drivers, cleanups and an
    improvement of the new schedutil governor.

    Next, there are some changes in the hibernation core, including a fix
    for a nasty problem related to the MONITOR/MWAIT usage by CPU offline
    during resume from hibernation, a few core improvements related to
    memory management during resume, a couple of additional debug features
    and cleanups.

    Finally, we have some fixes and cleanups in the devfreq subsystem,
    generic power domains framework improvements related to system
    suspend/resume, support for some new chips in intel_idle and in the
    power capping RAPL driver, a new version of the AnalyzeSuspend utility
    and some assorted fixes and cleanups.

    Specifics:

    - Rework the cpufreq governor interface to make it more
    straightforward and modify the conservative governor to avoid using
    transition notifications (Rafael Wysocki).

    - Rework the handling of frequency tables by the cpufreq core to make
    it more efficient (Viresh Kumar).

    - Modify the schedutil governor to reduce the number of wakeups it
    causes to occur in cases when the CPU frequency doesn't need to be
    changed (Steve Muckle, Viresh Kumar).

    - Fix some minor issues and clean up code in the cpufreq core and
    governors (Rafael Wysocki, Viresh Kumar).

    - Add Intel Broxton support to the intel_pstate driver (Srinivas
    Pandruvada).

    - Fix problems related to the config TDP feature and to the validity
    of the MSR_HWP_INTERRUPT register in intel_pstate (Jan Kiszka,
    Srinivas Pandruvada).

    - Make intel_pstate update the cpu_frequency tracepoint even if the
    frequency doesn't change to avoid confusing powertop (Rafael
    Wysocki).

    - Clean up the usage of __init/__initdata in intel_pstate, mark some
    of its internal variables as __read_mostly and drop an unused
    structure element from it (Jisheng Zhang, Carsten Emde).

    - Clean up the usage of some duplicate MSR symbols in intel_pstate
    and turbostat (Srinivas Pandruvada).

    - Update/fix the powernv, s3c24xx and mvebu cpufreq drivers (Akshay
    Adiga, Viresh Kumar, Ben Dooks).

    - Fix a regression (introduced during the 4.5 cycle) in the
    pcc-cpufreq driver by reverting the problematic commit (Andreas
    Herrmann).

    - Add support for Intel Denverton to intel_idle, clean up Broxton
    support in it and make it explicitly non-modular (Jacob Pan, Jan
    Beulich, Paul Gortmaker).

    - Add support for Denverton and Ivy Bridge server to the Intel RAPL
    power capping driver and make it more careful about the handing of
    MSRs that may not be present (Jacob Pan, Xiaolong Wang).

    - Fix resume from hibernation on x86-64 by making the CPU offline
    during resume avoid using MONITOR/MWAIT in the "play dead" loop
    which may lead to an inadvertent "revival" of a "dead" CPU and a
    page fault leading to a kernel crash from it (Rafael Wysocki).

    - Make memory management during resume from hibernation more
    straightforward (Rafael Wysocki).

    - Add debug features that should help to detect problems related to
    hibernation and resume from it (Rafael Wysocki, Chen Yu).

    - Clean up hibernation core somewhat (Rafael Wysocki).

    - Prevent KASAN from instrumenting the hibernation core which leads
    to large numbers of false-positives from it (James Morse).

    - Prevent PM (hibernate and suspend) notifiers from being called
    during the cleanup phase if they have not been called during the
    corresponding preparation phase which is possible if one of the
    other notifiers returns an error at that time (Lianwei Wang).

    - Improve suspend-related debug printout in the tasks freezer and
    clean up suspend-related console handling (Roger Lu, Borislav
    Petkov).

    - Update the AnalyzeSuspend script in the kernel sources to version
    4.2 (Todd Brandt).

    - Modify the generic power domains framework to make it handle system
    suspend/resume better (Ulf Hansson).

    - Make the runtime PM framework avoid resuming devices synchronously
    when user space changes the runtime PM settings for them and
    improve its error reporting (Rafael Wysocki, Linus Walleij).

    - Fix error paths in devfreq drivers (exynos, exynos-ppmu,
    exynos-bus) and in the core, make some devfreq code explicitly
    non-modular and change some of it into tristate (Bartlomiej
    Zolnierkiewicz, Peter Chen, Paul Gortmaker).

    - Add DT support to the generic PM clocks management code and make it
    export some more symbols (Jon Hunter, Paul Gortmaker).

    - Make the PCI PM core code slightly more robust against possible
    driver errors (Andy Shevchenko).

    - Make it possible to change DESTDIR and PREFIX in turbostat (Andy
    Shevchenko)"

    * tag 'pm-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (89 commits)
    Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency"
    PM / hibernate: Introduce test_resume mode for hibernation
    cpufreq: export cpufreq_driver_resolve_freq()
    cpufreq: Disallow ->resolve_freq() for drivers providing ->target_index()
    PCI / PM: check all fields in pci_set_platform_pm()
    cpufreq: acpi-cpufreq: use cached frequency mapping when possible
    cpufreq: schedutil: map raw required frequency to driver frequency
    cpufreq: add cpufreq_driver_resolve_freq()
    cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT
    intel_pstate: Update cpu_frequency tracepoint every time
    cpufreq: intel_pstate: clean remnant struct element
    PM / tools: scripts: AnalyzeSuspend v4.2
    x86 / hibernate: Use hlt_play_dead() when resuming from hibernation
    cpufreq: powernv: Replacing pstate_id with frequency table index
    intel_pstate: Fix MSR_CONFIG_TDP_x addressing in core_get_max_pstate()
    PM / hibernate: Image data protection during restoration
    PM / hibernate: Add missing braces in __register_nosave_region()
    PM / hibernate: Clean up comments in snapshot.c
    PM / hibernate: Clean up function headers in snapshot.c
    PM / hibernate: Add missing braces in hibernate_setup()
    ...

    Linus Torvalds