13 Mar, 2019

1 commit

  • Add check for the return value of memblock_alloc*() functions and call
    panic() in case of error. The panic message repeats the one used by
    panicing memblock allocators with adjustment of parameters to include
    only relevant ones.

    The replacement was mostly automated with semantic patches like the one
    below with manual massaging of format strings.

    @@
    expression ptr, size, align;
    @@
    ptr = memblock_alloc(size, align);
    + if (!ptr)
    + panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);

    [anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
    Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
    [rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
    Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
    [rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
    Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
    [akpm@linux-foundation.org: fix xtensa printk warning]
    Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Anders Roxell
    Reviewed-by: Guo Ren [c-sky]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Heiko Carstens [s390]
    Reviewed-by: Juergen Gross [Xen]
    Reviewed-by: Geert Uytterhoeven [m68k]
    Acked-by: Max Filippov [xtensa]
    Cc: Catalin Marinas
    Cc: Christophe Leroy
    Cc: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Dennis Zhou
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Petr Mladek
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Rob Herring
    Cc: Rob Herring
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

07 Mar, 2019

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These are PM-runtime framework changes to use ktime instead of jiffies
    for accounting, new PM core flag to mark devices that don't need any
    form of power management, cpuidle updates including driver API
    documentation and a new governor, cpufreq updates including a new
    driver for Armada 8K, thermal cleanups and more, some energy-aware
    scheduling (EAS) enabling changes, new chips support in the intel_idle
    and RAPL drivers and assorted cleanups in some other places.

    Specifics:

    - Update the PM-runtime framework to use ktime instead of jiffies for
    accounting (Thara Gopinath, Vincent Guittot)

    - Optimize the autosuspend code in the PM-runtime framework somewhat
    (Ladislav Michl)

    - Add a PM core flag to mark devices that don't need any form of
    power management (Sudeep Holla)

    - Introduce driver API documentation for cpuidle and add a new
    cpuidle governor for tickless systems (Rafael Wysocki)

    - Add Jacobsville support to the intel_idle driver (Zhang Rui)

    - Clean up a cpuidle core header file and the cpuidle-dt and ACPI
    processor-idle drivers (Yangtao Li, Joseph Lo, Yazen Ghannam)

    - Add new cpufreq driver for Armada 8K (Gregory Clement)

    - Fix and clean up cpufreq core (Rafael Wysocki, Viresh Kumar, Amit
    Kucheria)

    - Add support for light-weight tear-down and bring-up of CPUs to the
    cpufreq core and use it in the cpufreq-dt driver (Viresh Kumar)

    - Fix cpu_cooling Kconfig dependencies, add support for CPU cooling
    auto-registration to the cpufreq core and use it in multiple
    cpufreq drivers (Amit Kucheria)

    - Fix some minor issues and do some cleanups in the davinci,
    e_powersaver, ap806, s5pv210, qcom and kryo cpufreq drivers
    (Bartosz Golaszewski, Gustavo Silva, Julia Lawall, Paweł Chmiel,
    Taniya Das, Viresh Kumar)

    - Add a Hisilicon CPPC quirk to the cppc_cpufreq driver (Xiongfeng
    Wang)

    - Clean up the intel_pstate and acpi-cpufreq drivers (Erwan Velu,
    Rafael Wysocki)

    - Clean up multiple cpufreq drivers (Yangtao Li)

    - Update cpufreq-related MAINTAINERS entries (Baruch Siach, Lukas
    Bulwahn)

    - Add support for exposing the Energy Model via debugfs and make
    multiple cpufreq drivers register an Energy Model to support
    energy-aware scheduling (Quentin Perret, Dietmar Eggemann, Matthias
    Kaehlcke)

    - Add Ice Lake mobile and Jacobsville support to the Intel RAPL
    power-capping driver (Gayatri Kammela, Zhang Rui)

    - Add a power estimation helper to the operating performance points
    (OPP) framework and clean up a core function in it (Quentin Perret,
    Viresh Kumar)

    - Make minor improvements in the generic power domains (genpd), OPP
    and system suspend frameworks and in the PM core (Aditya Pakki,
    Douglas Anderson, Greg Kroah-Hartman, Rafael Wysocki, Yangtao Li)"

    * tag 'pm-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (80 commits)
    cpufreq: kryo: Release OPP tables on module removal
    cpufreq: ap806: add missing of_node_put after of_device_is_available
    cpufreq: acpi-cpufreq: Report if CPU doesn't support boost technologies
    cpufreq: Pass updated policy to driver ->setpolicy() callback
    cpufreq: Fix two debug messages in cpufreq_set_policy()
    cpufreq: Reorder and simplify cpufreq_update_policy()
    cpufreq: Add kerneldoc comments for two core functions
    PM / core: Add support to skip power management in device/driver model
    cpufreq: intel_pstate: Rework iowait boosting to be less aggressive
    cpufreq: intel_pstate: Eliminate intel_pstate_get_base_pstate()
    cpufreq: intel_pstate: Avoid redundant initialization of local vars
    powercap/intel_rapl: add Ice Lake mobile
    ACPI / processor: Set P_LVL{2,3} idle state descriptions
    cpufreq / cppc: Work around for Hisilicon CPPC cpufreq
    ACPI / CPPC: Add a helper to get desired performance
    cpufreq: davinci: move configuration to include/linux/platform_data
    cpufreq: speedstep: convert BUG() to BUG_ON()
    cpufreq: powernv: fix missing check of return value in init_powernv_pstates()
    cpufreq: longhaul: remove unneeded semicolon
    cpufreq: pcc-cpufreq: remove unneeded semicolon
    ..

    Linus Torvalds
     

06 Mar, 2019

2 commits

  • The content of pages that are marked PG_offline is not of interest (e.g.
    inflated by a balloon driver), let's skip these pages.

    In saveable_highmem_page(), move the PageReserved() check to a new check
    along with the PageOffline() check to separate it from the swsusp
    checks.

    [david@redhat.com: v2]
    Link: http://lkml.kernel.org/r/20181122100627.5189-9-david@redhat.com
    Link: http://lkml.kernel.org/r/20181119101616.8901-9-david@redhat.com
    Signed-off-by: David Hildenbrand
    Acked-by: Pavel Machek
    Acked-by: Rafael J. Wysocki
    Cc: Pavel Machek
    Cc: Len Brown
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: "Michael S. Tsirkin"
    Cc: Alexander Duyck
    Cc: Alexey Dobriyan
    Cc: Arnd Bergmann
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Christian Hansen
    Cc: Dave Young
    Cc: David Rientjes
    Cc: Greg Kroah-Hartman
    Cc: Haiyang Zhang
    Cc: Jonathan Corbet
    Cc: Juergen Gross
    Cc: Julien Freche
    Cc: Kairui Song
    Cc: Kazuhito Hagio
    Cc: "Kirill A. Shutemov"
    Cc: Konstantin Khlebnikov
    Cc: "K. Y. Srinivasan"
    Cc: Lianbo Jiang
    Cc: Michal Hocko
    Cc: Mike Rapoport
    Cc: Miles Chen
    Cc: Nadav Amit
    Cc: Naoya Horiguchi
    Cc: Omar Sandoval
    Cc: Pankaj gupta
    Cc: Pavel Tatashin
    Cc: "Rafael J. Wysocki"
    Cc: Stefano Stabellini
    Cc: Stephen Hemminger
    Cc: Stephen Rothwell
    Cc: Vitaly Kuznetsov
    Cc: Vlastimil Babka
    Cc: Xavier Deguillard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     
  • Let's use pfn_to_online_page() instead of pfn_to_page() when checking
    for saveable pages to not save/restore offline memory sections.

    Link: http://lkml.kernel.org/r/20181119101616.8901-8-david@redhat.com
    Signed-off-by: David Hildenbrand
    Suggested-by: Michal Hocko
    Acked-by: Michal Hocko
    Acked-by: Pavel Machek
    Acked-by: Rafael J. Wysocki
    Cc: Len Brown
    Cc: Matthew Wilcox
    Cc: "Michael S. Tsirkin"
    Cc: Alexander Duyck
    Cc: Alexey Dobriyan
    Cc: Arnd Bergmann
    Cc: Baoquan He
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: Christian Hansen
    Cc: Dave Young
    Cc: David Rientjes
    Cc: Greg Kroah-Hartman
    Cc: Haiyang Zhang
    Cc: Jonathan Corbet
    Cc: Juergen Gross
    Cc: Julien Freche
    Cc: Kairui Song
    Cc: Kazuhito Hagio
    Cc: "Kirill A. Shutemov"
    Cc: Konstantin Khlebnikov
    Cc: "K. Y. Srinivasan"
    Cc: Lianbo Jiang
    Cc: Mike Rapoport
    Cc: Miles Chen
    Cc: Nadav Amit
    Cc: Naoya Horiguchi
    Cc: Omar Sandoval
    Cc: Pankaj gupta
    Cc: Pavel Tatashin
    Cc: "Rafael J. Wysocki"
    Cc: Stefano Stabellini
    Cc: Stephen Hemminger
    Cc: Stephen Rothwell
    Cc: Vitaly Kuznetsov
    Cc: Vlastimil Babka
    Cc: Xavier Deguillard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Hildenbrand
     

04 Mar, 2019

1 commit

  • * pm-core:
    PM / core: Add support to skip power management in device/driver model
    PM / suspend: Print debug messages for device using direct-complete
    PM-runtime: update time accounting only when enabled
    PM-runtime: Switch accounting over to ktime_get_mono_fast_ns()
    PM-runtime: Optimize pm_runtime_autosuspend_expiration()
    PM-runtime: Replace jiffies-based accounting with ktime-based accounting
    PM-runtime: update accounting_timestamp on enable
    PM: clock_ops: fix missing clk_prepare() return value check
    drm/i915: Move on the new pm runtime interface
    PM-runtime: Add new interface to get accounted time

    * pm-sleep:
    PM / wakeup: fix kerneldoc comment for pm_wakeup_dev_event()

    * pm-qos:
    PM: QoS: no need to check return value of debugfs_create functions

    * pm-domains:
    PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()
    PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
    PM: domains: no need to check return value of debugfs_create functions

    * pm-em:
    PM / EM: Expose the Energy Model in debugfs

    Rafael J. Wysocki
     

24 Jan, 2019

1 commit

  • The recently introduced Energy Model (EM) framework manages power cost
    tables of CPUs. These tables are currently only visible from kernel
    space. However, in order to debug the behaviour of subsystems that use
    the EM (EAS for example), it is often required to know what the power
    costs are from userspace.

    For this reason, introduce under /sys/kernel/debug/energy_model a set of
    directories representing the performance domains of the system. Each
    performance domain contains a set of sub-directories representing the
    different capacity states (cs) and their attributes, as well as a file
    exposing the related CPUs.

    The resulting hierarchy is as follows on Arm juno r0 for example:

    /sys/kernel/debug/energy_model
    ├── pd0
    │   ├── cpus
    │   ├── cs:450000
    │   │   ├── cost
    │   │   ├── frequency
    │   │   └── power
    │   ├── cs:575000
    │   │   ├── cost
    │   │   ├── frequency
    │   │   └── power
    │   ├── cs:700000
    │   │   ├── cost
    │   │   ├── frequency
    │   │   └── power
    │   ├── cs:775000
    │   │   ├── cost
    │   │   ├── frequency
    │   │   └── power
    │   └── cs:850000
    │   ├── cost
    │   ├── frequency
    │   └── power
    └── pd1
    ├── cpus
    ├── cs:1100000
    │   ├── cost
    │   ├── frequency
    │   └── power
    ├── cs:450000
    │   ├── cost
    │   ├── frequency
    │   └── power
    ├── cs:625000
    │   ├── cost
    │   ├── frequency
    │   └── power
    ├── cs:800000
    │   ├── cost
    │   ├── frequency
    │   └── power
    └── cs:950000
    ├── cost
    ├── frequency
    └── power

    Signed-off-by: Quentin Perret
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Quentin Perret
     

23 Jan, 2019

1 commit


29 Dec, 2018

1 commit

  • totalram_pages and totalhigh_pages are made static inline function.

    Main motivation was that managed_page_count_lock handling was complicating
    things. It was discussed in length here,
    https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes
    better to remove the lock and convert variables to atomic, with preventing
    poteintial store-to-read tearing as a bonus.

    [akpm@linux-foundation.org: coding style fixes]
    Link: http://lkml.kernel.org/r/1542090790-21750-4-git-send-email-arunks@codeaurora.org
    Signed-off-by: Arun KS
    Suggested-by: Michal Hocko
    Suggested-by: Vlastimil Babka
    Reviewed-by: Konstantin Khlebnikov
    Reviewed-by: Pavel Tatashin
    Acked-by: Michal Hocko
    Acked-by: Vlastimil Babka
    Cc: David Hildenbrand
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun KS
     

27 Dec, 2018

1 commit

  • Pull scheduler updates from Ingo Molnar:
    "The main changes in this cycle were:

    - Introduce "Energy Aware Scheduling" - by Quentin Perret.

    This is a coherent topology description of CPUs in cooperation with
    the PM subsystem, with the goal to schedule more energy-efficiently
    on asymetric SMP platform - such as waking up tasks to the more
    energy-efficient CPUs first, as long as the system isn't
    oversubscribed.

    For details of the design, see:

    https://lore.kernel.org/lkml/20180724122521.22109-1-quentin.perret@arm.com/

    - Misc cleanups and smaller enhancements"

    * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
    sched/fair: Select an energy-efficient CPU on task wake-up
    sched/fair: Introduce an energy estimation helper function
    sched/fair: Add over-utilization/tipping point indicator
    sched/fair: Clean-up update_sg_lb_stats parameters
    sched/toplogy: Introduce the 'sched_energy_present' static key
    sched/topology: Make Energy Aware Scheduling depend on schedutil
    sched/topology: Disable EAS on inappropriate platforms
    sched/topology: Add lowest CPU asymmetry sched_domain level pointer
    sched/topology: Reference the Energy Model of CPUs when available
    PM: Introduce an Energy Model management framework
    sched/cpufreq: Prepare schedutil for Energy Aware Scheduling
    sched/topology: Relocate arch_scale_cpu_capacity() to the internal header
    sched/core: Remove unnecessary unlikely() in push_*_task()
    sched/topology: Remove the ::smt_gain field from 'struct sched_domain'
    sched: Fix various typos in comments
    sched/core: Clean up the #ifdef block in add_nr_running()
    sched/fair: Make some variables static
    sched/core: Create task_has_idle_policy() helper
    sched/fair: Add lsub_positive() and use it consistently
    sched/fair: Mask UTIL_AVG_UNCHANGED usages
    ...

    Linus Torvalds
     

21 Dec, 2018

1 commit


13 Dec, 2018

1 commit


11 Dec, 2018

1 commit

  • Several subsystems in the kernel (task scheduler and/or thermal at the
    time of writing) can benefit from knowing about the energy consumed by
    CPUs. Yet, this information can come from different sources (DT or
    firmware for example), in different formats, hence making it hard to
    exploit without a standard API.

    As an attempt to address this, introduce a centralized Energy Model
    (EM) management framework which aggregates the power values provided
    by drivers into a table for each performance domain in the system. The
    power cost tables are made available to interested clients (e.g. task
    scheduler or thermal) via platform-agnostic APIs. The overall design
    is represented by the diagram below (focused on Arm-related drivers as
    an example, but applicable to any architecture):

    +---------------+ +-----------------+ +-------------+
    | Thermal (IPA) | | Scheduler (EAS) | | Other |
    +---------------+ +-----------------+ +-------------+
    | | em_pd_energy() |
    | | em_cpu_get() |
    +-----------+ | +--------+
    | | |
    v v v
    +---------------------+
    | |
    | Energy Model |
    | |
    | Framework |
    | |
    +---------------------+
    ^ ^ ^
    | | | em_register_perf_domain()
    +----------+ | +---------+
    | | |
    +---------------+ +---------------+ +--------------+
    | cpufreq-dt | | arm_scmi | | Other |
    +---------------+ +---------------+ +--------------+
    ^ ^ ^
    | | |
    +--------------+ +---------------+ +--------------+
    | Device Tree | | Firmware | | ? |
    +--------------+ +---------------+ +--------------+

    Drivers (typically, but not limited to, CPUFreq drivers) can register
    data in the EM framework using the em_register_perf_domain() API. The
    calling driver must provide a callback function with a standardized
    signature that will be used by the EM framework to build the power
    cost tables of the performance domain. This design should offer a lot of
    flexibility to calling drivers which are free of reading information
    from any location and to use any technique to compute power costs.
    Moreover, the capacity states registered by drivers in the EM framework
    are not required to match real performance states of the target. This
    is particularly important on targets where the performance states are
    not known by the OS.

    The power cost coefficients managed by the EM framework are specified in
    milli-watts. Although the two potential users of those coefficients (IPA
    and EAS) only need relative correctness, IPA specifically needs to
    compare the power of CPUs with the power of other components (GPUs, for
    example), which are still expressed in absolute terms in their
    respective subsystems. Hence, specifying the power of CPUs in
    milli-watts should help transitioning IPA to using the EM framework
    without introducing new problems by keeping units comparable across
    sub-systems.
    On the longer term, the EM of other devices than CPUs could also be
    managed by the EM framework, which would enable to remove the absolute
    unit. However, this is not absolutely required as a first step, so this
    extension of the EM framework is left for later.

    On the client side, the EM framework offers APIs to access the power
    cost tables of a CPU (em_cpu_get()), and to estimate the energy
    consumed by the CPUs of a performance domain (em_pd_energy()). Clients
    such as the task scheduler can then use these APIs to access the shared
    data structures holding the Energy Model of CPUs.

    Signed-off-by: Quentin Perret
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: adharmap@codeaurora.org
    Cc: chris.redpath@arm.com
    Cc: currojerez@riseup.net
    Cc: dietmar.eggemann@arm.com
    Cc: edubezval@gmail.com
    Cc: gregkh@linuxfoundation.org
    Cc: javi.merino@kernel.org
    Cc: joel@joelfernandes.org
    Cc: juri.lelli@redhat.com
    Cc: morten.rasmussen@arm.com
    Cc: patrick.bellasi@arm.com
    Cc: pkondeti@codeaurora.org
    Cc: skannan@codeaurora.org
    Cc: smuckle@google.com
    Cc: srinivas.pandruvada@linux.intel.com
    Cc: thara.gopinath@linaro.org
    Cc: tkjos@google.com
    Cc: valentin.schneider@arm.com
    Cc: vincent.guittot@linaro.org
    Cc: viresh.kumar@linaro.org
    Link: https://lkml.kernel.org/r/20181203095628.11858-4-quentin.perret@arm.com
    Signed-off-by: Ingo Molnar

    Quentin Perret
     

30 Nov, 2018

1 commit


31 Oct, 2018

3 commits

  • When a memblock allocation APIs are called with align = 0, the alignment
    is implicitly set to SMP_CACHE_BYTES.

    Implicit alignment is done deep in the memblock allocator and it can
    come as a surprise. Not that such an alignment would be wrong even
    when used incorrectly but it is better to be explicit for the sake of
    clarity and the prinicple of the least surprise.

    Replace all such uses of memblock APIs with the 'align' parameter
    explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment
    in the memblock internal allocation functions.

    For the case when memblock APIs are used via helper functions, e.g. like
    iommu_arena_new_node() in Alpha, the helper functions were detected with
    Coccinelle's help and then manually examined and updated where
    appropriate.

    The direct memblock APIs users were updated using the semantic patch below:

    @@
    expression size, min_addr, max_addr, nid;
    @@
    (
    |
    - memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,
    nid)
    |
    - memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,
    nid)
    |
    - memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
    + memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
    |
    - memblock_alloc(size, 0)
    + memblock_alloc(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_raw(size, 0)
    + memblock_alloc_raw(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_from(size, 0, min_addr)
    + memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
    |
    - memblock_alloc_nopanic(size, 0)
    + memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_low(size, 0)
    + memblock_alloc_low(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_low_nopanic(size, 0)
    + memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
    |
    - memblock_alloc_from_nopanic(size, 0, min_addr)
    + memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
    |
    - memblock_alloc_node(size, 0, nid)
    + memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
    )

    [mhocko@suse.com: changelog update]
    [akpm@linux-foundation.org: coding-style fixes]
    [rppt@linux.ibm.com: fix missed uses of implicit alignment]
    Link: http://lkml.kernel.org/r/20181016133656.GA10925@rapoport-lnx
    Link: http://lkml.kernel.org/r/1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Suggested-by: Michal Hocko
    Acked-by: Paul Burton [MIPS]
    Acked-by: Michael Ellerman [powerpc]
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: Geert Uytterhoeven
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: Matt Turner
    Cc: Michal Simek
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The conversion is done using

    sed -i 's@memblock_virt_alloc@memblock_alloc@g' \
    $(git grep -l memblock_virt_alloc)

    Link: http://lkml.kernel.org/r/1536927045-23536-8-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

18 Oct, 2018

1 commit

  • * acpi-pm:
    ACPI / PM: LPIT: Register sysfs attributes based on FADT

    * pm-sleep:
    x86-32, hibernate: Adjust in_suspend after resumed on 32bit system
    x86-32, hibernate: Set up temporary text mapping for 32bit system
    x86-32, hibernate: Switch to relocated restore code during resume on 32bit system
    x86-32, hibernate: Switch to original page table after resumed
    x86-32, hibernate: Use the page size macro instead of constant value
    x86-32, hibernate: Use temp_pgt as the temporary page table
    x86, hibernate: Rename temp_level4_pgt to temp_pgt
    x86-32, hibernate: Enable CONFIG_ARCH_HIBERNATION_HEADER on 32bit system
    x86, hibernate: Extract the common code of 64/32 bit system
    x86-32/asm/power: Create stack frames in hibernate_asm_32.S
    PM / hibernate: Check the success of generating md5 digest before hibernation
    x86, hibernate: Fix nosave_regions setup for hibernation
    PM / sleep: Show freezing tasks that caused a suspend abort
    PM / hibernate: Documentation: fix image_size default value

    Rafael J. Wysocki
     

12 Oct, 2018

1 commit

  • Dmitry writes:
    "Input updates for v4.19-rc7

    - we added a few scheduling points into various input interfaces to
    ensure that large writes will not cause RCU stalls
    - fixed configuring PS/2 keyboards as wakeup devices on newer
    platforms
    - added a new Xbox gamepad ID."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: uinput - add a schedule point in uinput_inject_events()
    Input: evdev - add a schedule point in evdev_write()
    Input: mousedev - add a schedule point in mousedev_write()
    Input: i8042 - enable keyboard wakeups by default when s2idle is used
    Input: xpad - add support for Xbox1 PDP Camo series gamepad

    Greg Kroah-Hartman
     

02 Oct, 2018

1 commit

  • Previously, on typical consumer laptops, pressing a key on the keyboard
    when the system is in suspend would cause it to wake up (default or
    unconditional behaviour). This happens because the EC generates a SCI
    interrupt in this scenario.

    That is no longer true on modern laptops based on Intel WhiskeyLake,
    including Acer Swift SF314-55G, Asus UX333FA, Asus UX433FN and Asus
    UX533FD. We confirmed with Asus EC engineers that the "Modern Standby"
    design has been modified so that the EC no longer generates a SCI
    in this case; the keyboard controller itself should be used for wakeup.

    In order to retain the standard behaviour of being able to use the
    keyboard to wake up the system, enable serio wakeups by default on
    platforms that are using s2idle.

    Link: https://lkml.kernel.org/r/CAB4CAwfQ0mPMqCLp95TVjw4J0r5zKPWkSvvkK4cpZUGE--w8bQ@mail.gmail.com
    Reviewed-by: Rafael J. Wysocki
    Signed-off-by: Daniel Drake
    Signed-off-by: Dmitry Torokhov

    Daniel Drake
     

10 Sep, 2018

1 commit


15 Aug, 2018

2 commits

  • Commit ea0212f40c6 (power: auto select CONFIG_SRCU) made the code in
    drivers/base/power/wakeup.c use SRCU instead of RCU, but it forgot to
    select CONFIG_SRCU in Kconfig, which leads to the following build
    error if CONFIG_SRCU is not selected somewhere else:

    drivers/built-in.o: In function `wakeup_source_remove':
    (.text+0x3c6fc): undefined reference to `synchronize_srcu'
    drivers/built-in.o: In function `pm_print_active_wakeup_sources':
    (.text+0x3c7a8): undefined reference to `__srcu_read_lock'
    drivers/built-in.o: In function `pm_print_active_wakeup_sources':
    (.text+0x3c84c): undefined reference to `__srcu_read_unlock'
    drivers/built-in.o: In function `device_wakeup_arm_wake_irqs':
    (.text+0x3d1d8): undefined reference to `__srcu_read_lock'
    drivers/built-in.o: In function `device_wakeup_arm_wake_irqs':
    (.text+0x3d228): undefined reference to `__srcu_read_unlock'
    drivers/built-in.o: In function `device_wakeup_disarm_wake_irqs':
    (.text+0x3d24c): undefined reference to `__srcu_read_lock'
    drivers/built-in.o: In function `device_wakeup_disarm_wake_irqs':
    (.text+0x3d29c): undefined reference to `__srcu_read_unlock'
    drivers/built-in.o:(.data+0x4158): undefined reference to `process_srcu'

    Fix this error by selecting CONFIG_SRCU when PM_SLEEP is enabled.

    Fixes: ea0212f40c6 (power: auto select CONFIG_SRCU)
    Cc: 4.2+ # 4.2+
    Signed-off-by: zhangyi (F)
    [ rjw: Minor subject/changelog fixups ]
    Signed-off-by: Rafael J. Wysocki

    zhangyi (F)
     
  • Pull power management updates from Rafael Wysocki:
    "These add a new framework for CPU idle time injection, to be used by
    all of the idle injection code in the kernel in the future, fix some
    issues and add a number of relatively small extensions in multiple
    places.

    Specifics:

    - Add a new framework for CPU idle time injection (Daniel Lezcano).

    - Add AVS support to the armada-37xx cpufreq driver (Gregory
    CLEMENT).

    - Add support for current CPU frequency reporting to the ACPI CPPC
    cpufreq driver (George Cherian).

    - Rework the cooling device registration in the imx6q/thermal driver
    (Bastian Stender).

    - Make the pcc-cpufreq driver refuse to work with dynamic scaling
    governors on systems with many CPUs to avoid scalability issues
    with it (Rafael Wysocki).

    - Fix the intel_pstate driver to report different maximum CPU
    frequencies on systems where they really are different and to
    ignore the turbo active ratio if hardware-managend P-states (HWP)
    are in use; make it use the match_string() helper (Xie Yisheng,
    Srinivas Pandruvada).

    - Fix a minor deferred probe issue in the qcom-kryo cpufreq driver
    (Niklas Cassel).

    - Add a tracepoint for the tracking of frequency limits changes (from
    Andriod) to the cpufreq core (Ruchi Kandoi).

    - Fix a circular lock dependency between CPU hotplug and sysfs
    locking in the cpufreq core reported by lockdep (Waiman Long).

    - Avoid excessive error reports on driver registration failures in
    the ARM cpuidle driver (Sudeep Holla).

    - Add a new device links flag to the driver core to make links go
    away automatically on supplier driver removal (Vivek Gautam).

    - Eliminate potential race condition between system-wide power
    management transitions and system shutdown (Pingfan Liu).

    - Add a quirk to save NVS memory on system suspend for the ASUS 1025C
    laptop (Willy Tarreau).

    - Make more systems use suspend-to-idle (instead of ACPI S3) by
    default (Tristian Celestin).

    - Get rid of stack VLA usage in the low-level hibernation code on
    64-bit x86 (Kees Cook).

    - Fix error handling in the hibernation core and mark an expected
    fall-through switch in it (Chengguang Xu, Gustavo Silva).

    - Extend the generic power domains (genpd) framework to support
    attaching a device to a power domain by name (Ulf Hansson).

    - Fix device reference counting and user limits initialization in the
    devfreq core (Arvind Yadav, Matthias Kaehlcke).

    - Fix a few issues in the rk3399_dmc devfreq driver and improve its
    documentation (Enric Balletbo i Serra, Lin Huang, Nick Milner).

    - Drop a redundant error message from the exynos-ppmu devfreq driver
    (Markus Elfring)"

    * tag 'pm-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (35 commits)
    PM / reboot: Eliminate race between reboot and suspend
    PM / hibernate: Mark expected switch fall-through
    cpufreq: intel_pstate: Ignore turbo active ratio in HWP
    cpufreq: Fix a circular lock dependency problem
    cpu/hotplug: Add a cpus_read_trylock() function
    x86/power/hibernate_64: Remove VLA usage
    cpufreq: trace frequency limits change
    cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP
    cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems
    cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER
    cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC
    cpufreq: armada-37xx: Add AVS support
    dt-bindings: marvell: Add documentation for the Armada 3700 AVS binding
    PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload.
    PM / devfreq: Init user limits from OPP limits, not viceversa
    PM / devfreq: rk3399_dmc: fix spelling mistakes.
    PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer.
    dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional.
    PM / devfreq: rk3399_dmc: remove wait for dcf irq event.
    dt-bindings: clock: add rk3399 DDR3 standard speed bins.
    ...

    Linus Torvalds
     

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
     

02 Jul, 2018

1 commit


20 Jun, 2018

1 commit

  • Since swait basically implemented exclusive waits only, make sure
    the API reflects that.

    $ git grep -l -e "\"
    -e "\" | while read file;
    do
    sed -i -e 's/\/&_one/g'
    -e 's/\/&_exclusive/g' $file;
    done

    With a few manual touch-ups.

    Suggested-by: Linus Torvalds
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Acked-by: Linus Torvalds
    Cc: bigeasy@linutronix.de
    Cc: oleg@redhat.com
    Cc: paulmck@linux.vnet.ibm.com
    Cc: pbonzini@redhat.com
    Link: https://lkml.kernel.org/r/20180612083909.261946548@infradead.org

    Peter Zijlstra
     

16 Jun, 2018

1 commit


13 Jun, 2018

1 commit

  • The vmalloc() function has no 2-factor argument form, so multiplication
    factors need to be wrapped in array_size(). This patch replaces cases of:

    vmalloc(a * b)

    with:
    vmalloc(array_size(a, b))

    as well as handling cases of:

    vmalloc(a * b * c)

    with:

    vmalloc(array3_size(a, b, c))

    This does, however, attempt to ignore constant size factors like:

    vmalloc(4 * 1024)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    vmalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    vmalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    vmalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    vmalloc(
    - sizeof(TYPE) * (COUNT_ID)
    + array_size(COUNT_ID, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT_ID
    + array_size(COUNT_ID, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * (COUNT_CONST)
    + array_size(COUNT_CONST, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT_CONST
    + array_size(COUNT_CONST, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT_ID)
    + array_size(COUNT_ID, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT_ID
    + array_size(COUNT_ID, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT_CONST)
    + array_size(COUNT_CONST, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT_CONST
    + array_size(COUNT_CONST, sizeof(THING))
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    vmalloc(
    - SIZE * COUNT
    + array_size(COUNT, SIZE)
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    vmalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    vmalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    vmalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    vmalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    vmalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    vmalloc(C1 * C2 * C3, ...)
    |
    vmalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants.
    @@
    expression E1, E2;
    constant C1, C2;
    @@

    (
    vmalloc(C1 * C2, ...)
    |
    vmalloc(
    - E1 * E2
    + array_size(E1, E2)
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

06 Jun, 2018

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These include a significant update of the generic power domains
    (genpd) and Operating Performance Points (OPP) frameworks, mostly
    related to the introduction of power domain performance levels,
    cpufreq updates (new driver for Qualcomm Kryo processors, updates of
    the existing drivers, some core fixes, schedutil governor
    improvements), PCI power management fixes, ACPI workaround for
    EC-based wakeup events handling on resume from suspend-to-idle, and
    major updates of the turbostat and pm-graph utilities.

    Specifics:

    - Introduce power domain performance levels into the the generic
    power domains (genpd) and Operating Performance Points (OPP)
    frameworks (Viresh Kumar, Rajendra Nayak, Dan Carpenter).

    - Fix two issues in the runtime PM framework related to the
    initialization and removal of devices using device links (Ulf
    Hansson).

    - Clean up the initialization of drivers for devices in PM domains
    (Ulf Hansson, Geert Uytterhoeven).

    - Fix a cpufreq core issue related to the policy sysfs interface
    causing CPU online to fail for CPUs sharing one cpufreq policy in
    some situations (Tao Wang).

    - Make it possible to use platform-specific suspend/resume hooks in
    the cpufreq-dt driver and make the Armada 37xx DVFS use that
    feature (Viresh Kumar, Miquel Raynal).

    - Optimize policy transition notifications in cpufreq (Viresh Kumar).

    - Improve the iowait boost mechanism in the schedutil cpufreq
    governor (Patrick Bellasi).

    - Improve the handling of deferred frequency updates in the schedutil
    cpufreq governor (Joel Fernandes, Dietmar Eggemann, Rafael Wysocki,
    Viresh Kumar).

    - Add a new cpufreq driver for Qualcomm Kryo (Ilia Lin).

    - Fix and clean up some cpufreq drivers (Colin Ian King, Dmitry
    Osipenko, Doug Smythies, Luc Van Oostenryck, Simon Horman, Viresh
    Kumar).

    - Fix the handling of PCI devices with the DPM_SMART_SUSPEND flag set
    and update stale comments in the PCI core PM code (Rafael Wysocki).

    - Work around an issue related to the handling of EC-based wakeup
    events in the ACPI PM core during resume from suspend-to-idle if
    the EC has been put into the low-power mode (Rafael Wysocki).

    - Improve the handling of wakeup source objects in the PM core (Doug
    Berger, Mahendran Ganesh, Rafael Wysocki).

    - Update the driver core to prevent deferred probe from breaking
    suspend/resume ordering (Feng Kan).

    - Clean up the PM core somewhat (Bjorn Helgaas, Ulf Hansson, Rafael
    Wysocki).

    - Make the core suspend/resume code and cpufreq support the RT patch
    (Sebastian Andrzej Siewior, Thomas Gleixner).

    - Consolidate the PM QoS handling in cpuidle governors (Rafael
    Wysocki).

    - Fix a possible crash in the hibernation core (Tetsuo Handa).

    - Update the rockchip-io Adaptive Voltage Scaling (AVS) driver (David
    Wu).

    - Update the turbostat utility (fixes, cleanups, new CPU IDs, new
    command line options, built-in "Low Power Idle" counters support,
    new POLL and POLL% columns) and add an entry for it to MAINTAINERS
    (Len Brown, Artem Bityutskiy, Chen Yu, Laura Abbott, Matt Turner,
    Prarit Bhargava, Srinivas Pandruvada).

    - Update the pm-graph to version 5.1 (Todd Brandt).

    - Update the intel_pstate_tracer utility (Doug Smythies)"

    * tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (128 commits)
    tools/power turbostat: update version number
    tools/power turbostat: Add Node in output
    tools/power turbostat: add node information into turbostat calculations
    tools/power turbostat: remove num_ from cpu_topology struct
    tools/power turbostat: rename num_cores_per_pkg to num_cores_per_node
    tools/power turbostat: track thread ID in cpu_topology
    tools/power turbostat: Calculate additional node information for a package
    tools/power turbostat: Fix node and siblings lookup data
    tools/power turbostat: set max_num_cpus equal to the cpumask length
    tools/power turbostat: if --num_iterations, print for specific number of iterations
    tools/power turbostat: Add Cannon Lake support
    tools/power turbostat: delete duplicate #defines
    x86: msr-index.h: Correct SNB_C1/C3_AUTO_UNDEMOTE defines
    tools/power turbostat: Correct SNB_C1/C3_AUTO_UNDEMOTE defines
    tools/power turbostat: add POLL and POLL% column
    tools/power turbostat: Fix --hide Pk%pc10
    tools/power turbostat: Build-in "Low Power Idle" counters support
    tools/power turbostat: Don't make man pages executable
    tools/power turbostat: remove blank lines
    tools/power turbostat: a small C-states dump readability immprovement
    ...

    Linus Torvalds
     

04 Jun, 2018

2 commits

  • * pm-pci:
    PCI / PM: Clean up outdated comments in pci_target_state()
    PCI / PM: Do not clear state_saved for devices that remain suspended

    * acpi-pm:
    ACPI: EC: Dispatch the EC GPE directly on s2idle wake
    ACPICA: Introduce acpi_dispatch_gpe()

    * pm-sleep:
    PM / hibernate: Fix oops at snapshot_write()
    PM / wakeup: Make s2idle_lock a RAW_SPINLOCK
    PM / s2idle: Make s2idle_wait_head swait based
    PM / wakeup: Make events_lock a RAW_SPINLOCK
    PM / suspend: Prevent might sleep splats

    * pm-avs:
    PM / AVS: rockchip-io: add io selectors and supplies for PX30

    Rafael J. Wysocki
     
  • * pm-qos:
    PM / QoS: Drop redundant declaration of pm_qos_get_value()

    * pm-core:
    PM / runtime: Drop usage count for suppliers at device link removal
    PM / runtime: Fixup reference counting of device link suppliers at probe
    PM: wakeup: Use pr_debug() for the "aborting suspend" message
    PM / core: Drop unused internal inline functions for sysfs
    PM / core: Drop unused internal functions for pm_qos sysfs
    PM / core: Drop unused internal inline functions for wakeirqs
    PM / core: Drop internal unused inline functions for wakeups
    PM / wakeup: Only update last time for active wakeup sources
    PM / wakeup: Use seq_open() to show wakeup stats
    PM / core: Use dev_printk() and symbols in suspend/resume diagnostics
    PM / core: Simplify initcall_debug_report() timing
    PM / core: Remove unused initcall_debug_report() arguments
    PM / core: fix deferred probe breaking suspend resume order

    Rafael J. Wysocki
     

29 May, 2018

1 commit


27 May, 2018

4 commits

  • syzbot is reporting NULL pointer dereference at snapshot_write() [1].
    This is because data->handle is zero-cleared by ioctl(SNAPSHOT_FREE).
    Fix this by checking data_of(data->handle) != NULL before using it.

    [1] https://syzkaller.appspot.com/bug?id=828a3c71bd344a6de8b6a31233d51a72099f27fd

    Signed-off-by: Tetsuo Handa
    Reported-by: syzbot
    Signed-off-by: Rafael J. Wysocki

    Tetsuo Handa
     
  • The `s2idle_lock' is acquired during suspend while interrupts are
    disabled even on RT. The lock is acquired for short sections only.
    Make it a RAW lock which avoids "sleeping while atomic" warnings on RT.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rafael J. Wysocki

    Sebastian Andrzej Siewior
     
  • s2idle_wait_head is used during s2idle with interrupts disabled even on
    RT. There is no "custom" wake up function so swait could be used instead
    which is also lower weight compared to the wait_queue.
    Make s2idle_wait_head a swait_queue_head.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rafael J. Wysocki

    Sebastian Andrzej Siewior
     
  • 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
     

14 May, 2018

1 commit


10 May, 2018

1 commit

  • When wakelock support was added, the wakeup_source_add() function
    was updated to set the last_time value of the wakeup source. This
    has the unintended side effect of producing confusing output from
    pm_print_active_wakeup_sources() when a wakeup source is added
    prior to a sleep that is blocked by a different wakeup source.

    The function pm_print_active_wakeup_sources() will search for the
    most recently active wakeup source when no active source is found.
    If a wakeup source is added after a different wakeup source blocks
    the system from going to sleep it may have a later last_time value
    than the blocking source and be output as the last active wakeup
    source even if it has never actually been active.

    It looks to me like the change to wakeup_source_add() was made to
    prevent the wakelock garbage collection from accidentally dropping
    a wakelock during the narrow window between adding the wakelock to
    the wakelock list in wakelock_lookup_add() and the activation of
    the wakeup source in pm_wake_lock().

    This commit changes the behavior so that only the last_time of the
    wakeup source used by a wakelock is initialized prior to adding it
    to the wakeup source list. This preserves the meaning of the
    last_time value as the last time the wakeup source was active and
    allows a wakeup source that has never been active to have a
    last_time value of 0.

    Fixes: b86ff9820fd5 (PM / Sleep: Add user space interface for manipulating wakeup sources, v3)
    Signed-off-by: Doug Berger
    Signed-off-by: Rafael J. Wysocki

    Doug Berger
     

09 Apr, 2018

1 commit


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