03 Jul, 2018

1 commit

  • commit 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 upstream.

    The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of
    snooze to deeper idle state") introduced a timeout for the snooze idle
    state so that it could be eventually be promoted to a deeper idle
    state. The snooze timeout value is static and set to the target
    residency of the next idle state, which would train the cpuidle
    governor to pick the next idle state eventually.

    The unfortunate side-effect of this is that if the next idle state(s)
    is disabled, the CPU will forever remain in snooze, despite the fact
    that the system is completely idle, and other deeper idle states are
    available.

    This patch fixes the issue by dynamically setting the snooze timeout
    to the target residency of the next enabled state on the device.

    Before Patch:
    POWER8 : Only nap disabled.
    $ cpupower monitor sleep 30
    sleep took 30.01297 seconds and exited with status 0
    |Idle_Stats
    PKG |CORE|CPU | snoo | Nap | Fast
    0| 8| 0| 96.41| 0.00| 0.00
    0| 8| 1| 96.43| 0.00| 0.00
    0| 8| 2| 96.47| 0.00| 0.00
    0| 8| 3| 96.35| 0.00| 0.00
    0| 8| 4| 96.37| 0.00| 0.00
    0| 8| 5| 96.37| 0.00| 0.00
    0| 8| 6| 96.47| 0.00| 0.00
    0| 8| 7| 96.47| 0.00| 0.00

    POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1,
    stop2) disabled:
    $ cpupower monitor sleep 30
    sleep took 30.05033 seconds and exited with status 0
    |Idle_Stats
    PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop
    0| 16| 0| 89.79| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00
    0| 16| 1| 90.12| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00
    0| 16| 2| 90.21| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00
    0| 16| 3| 90.29| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00

    After Patch:
    POWER8 : Only nap disabled.
    $ cpupower monitor sleep 30
    sleep took 30.01200 seconds and exited with status 0
    |Idle_Stats
    PKG |CORE|CPU | snoo | Nap | Fast
    0| 8| 0| 16.58| 0.00| 77.21
    0| 8| 1| 18.42| 0.00| 75.38
    0| 8| 2| 4.70| 0.00| 94.09
    0| 8| 3| 17.06| 0.00| 81.73
    0| 8| 4| 3.06| 0.00| 95.73
    0| 8| 5| 7.00| 0.00| 96.80
    0| 8| 6| 1.00| 0.00| 98.79
    0| 8| 7| 5.62| 0.00| 94.17

    POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1,
    stop2) disabled:

    $ cpupower monitor sleep 30
    sleep took 30.02110 seconds and exited with status 0
    |Idle_Stats
    PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop
    0| 0| 0| 0.69| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 9.39| 89.70
    0| 0| 1| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.05| 93.21
    0| 0| 2| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 89.93
    0| 0| 3| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 93.26

    Fixes: 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state")
    Cc: stable@vger.kernel.org # v4.2+
    Signed-off-by: Gautham R. Shenoy
    Reviewed-by: Balbir Singh
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Gautham R. Shenoy
     

25 Dec, 2017

1 commit

  • [ Upstream commit f187851b9b4a76952b1158b86434563dd2031103 ]

    When failing to enter broadcast timer mode for an idle state that
    requires it, a new state is selected that does not require broadcast,
    but the broadcast variable remains set. This causes
    tick_broadcast_exit to be called despite not having entered broadcast
    mode.

    This causes the WARN_ON_ONCE(!irqs_disabled()) to trigger in some
    cases. It does not appear to cause problems for code today, but seems
    to violate the interface so should be fixed.

    Signed-off-by: Nicholas Piggin
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Piggin
     

17 Dec, 2017

1 commit

  • [ Upstream commit 8d4e10e9ed9450e18fbbf6a8872be0eac9fd4999 ]

    On PowerNV platforms, firmware provides exit latency and
    target residency for each of the idle states in nano
    seconds. Cpuidle framework expects the values in micro
    seconds. Round up to nearest micro seconds to avoid errors
    in cases where the values are defined as fractional micro
    seconds.

    Default idle state of 'snooze' has exit latency of zero. If
    other states have fractional micro second exit latency, they
    would get rounded down to zero micro second and make cpuidle
    framework choose deeper idle state when snooze loop is the
    right choice.

    Reported-by: Anton Blanchard
    Signed-off-by: Vaidyanathan Srinivasan
    Reviewed-by: Gautham R. Shenoy
    Signed-off-by: Michael Ellerman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Vaidyanathan Srinivasan
     

10 Dec, 2017

1 commit

  • [ Upstream commit 0f87855d969a87f02048ff5ced7503465d5ab2f1 ]

    If cpuidle init fails, the code misses to unregister the driver for
    current CPU. Furthermore, we also need to rollback to cancel all
    previous CPUs registration; but the code retrieves driver handler by
    using function cpuidle_get_driver(), this function returns back
    current CPU driver handler but not previous CPU's handler, which leads
    to the failure handling code cannot unregister previous CPUs driver.

    This commit fixes two mentioned issues, it adds error handling path
    'goto out_unregister_drv' for current CPU driver unregistration; and
    it is to replace cpuidle_get_driver() with cpuidle_get_cpu_driver(),
    the later function can retrieve driver handler for previous CPUs
    according to the CPU device handler so can unregister the driver
    properly.

    This patch also adds extra error handling paths 'goto out_kfree_dev'
    and 'goto out_kfree_drv' and adjusts the freeing sentences for previous
    CPUs; so make the code more readable for freeing 'dev' and 'drv'
    structures.

    Suggested-by: Daniel Lezcano
    Signed-off-by: Leo Yan
    Fixes: d50a7d8acd78 (ARM: cpuidle: Support asymmetric idle definition)
    Acked-by: Daniel Lezcano
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Leo Yan
     

04 Nov, 2017

1 commit

  • MIPS will soon not be a part of Imagination Technologies, and as such
    many @imgtec.com email addresses will no longer be valid. This patch
    updates the addresses for those who:

    - Have 10 or more patches in mainline authored using an @imgtec.com
    email address, or any patches dated within the past year.

    - Are still with Imagination but leaving as part of the MIPS business
    unit, as determined from an internal email address list.

    - Haven't already updated their email address (ie. JamesH) or expressed
    a desire to be excluded (ie. Maciej).

    - Acked v2 or earlier of this patch, which leaves Deng-Cheng, Matt &
    myself.

    New addresses are of the form firstname.lastname@mips.com, and all
    verified against an internal email address list. An entry is added to
    .mailmap for each person such that get_maintainer.pl will report the new
    addresses rather than @imgtec.com addresses which will soon be dead.

    Instances of the affected addresses throughout the tree are then
    mechanically replaced with the new @mips.com address.

    Signed-off-by: Paul Burton
    Cc: Deng-Cheng Zhu
    Cc: Deng-Cheng Zhu
    Acked-by: Dengcheng Zhu
    Cc: Matt Redfearn
    Cc: Matt Redfearn
    Acked-by: Matt Redfearn
    Cc: Andrew Morton
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: trivial@kernel.org
    Signed-off-by: Linus Torvalds

    Paul Burton
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Sep, 2017

1 commit

  • In case there are no DT idle states defined or
    cpuidle_register_driver() fails, the copy of the idle driver is leaked:

    unreferenced object 0xede0dc00 (size 1024):
    comm "swapper/0", pid 1, jiffies 4294937431 (age 744.510s)
    hex dump (first 32 bytes):
    94 9e 0b c1 00 00 00 00 00 00 00 00 00 00 00 00 ................
    57 46 49 00 00 00 00 00 00 00 00 00 00 00 00 00 WFI.............
    backtrace:
    [] arm_idle_init+0x44/0x1ac
    [] do_one_initcall+0x3c/0x16c
    [] kernel_init_freeable+0x110/0x1d0
    [] kernel_init+0x8/0x114
    [] ret_from_fork+0x14/0x3c

    So fix this by freeing the unregistered copy in error case.

    Signed-off-by: Stefan Wahren
    Fixes: d50a7d8acd78 (ARM: cpuidle: Support asymmetric idle definition)
    Signed-off-by: Rafael J. Wysocki

    Stefan Wahren
     

16 Sep, 2017

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for 4.14 for MIPS; below a summary of
    the non-merge commits:

    CM:
    - Rename mips_cm_base to mips_gcr_base
    - Specify register size when generating accessors
    - Use BIT/GENMASK for register fields, order & drop shifts
    - Add cluster & block args to mips_cm_lock_other()

    CPC:
    - Use common CPS accessor generation macros
    - Use BIT/GENMASK for register fields, order & drop shifts
    - Introduce register modify (set/clear/change) accessors
    - Use change_*, set_* & clear_* where appropriate
    - Add CM/CPC 3.5 register definitions
    - Use GlobalNumber macros rather than magic numbers
    - Have asm/mips-cps.h include CM & CPC headers
    - Cluster support for topology functions
    - Detect CPUs in secondary clusters

    CPS:
    - Read GIC_VL_IDENT directly, not via irqchip driver

    DMA:
    - Consolidate coherent and non-coherent dma_alloc code
    - Don't use dma_cache_sync to implement fd_cacheflush

    FPU emulation / FP assist code:
    - Another series of 14 commits fixing corner cases such as NaN
    propgagation and other special input values.
    - Zero bits 32-63 of the result for a CLASS.D instruction.
    - Enhanced statics via debugfs
    - Do not use bools for arithmetic. GCC 7.1 moans about this.
    - Correct user fault_addr type

    Generic MIPS:
    - Enhancement of stack backtraces
    - Cleanup from non-existing options
    - Handle non word sized instructions when examining frame
    - Fix detection and decoding of ADDIUSP instruction
    - Fix decoding of SWSP16 instruction
    - Refactor handling of stack pointer in get_frame_info
    - Remove unreachable code from force_fcr31_sig()
    - Convert to using %pOF instead of full_name
    - Remove the R6000 support.
    - Move FP code from *_switch.S to *_fpu.S
    - Remove unused ST_OFF from r2300_switch.S
    - Allow platform to specify multiple its.S files
    - Add #includes to various files to ensure code builds reliable and
    without warning..
    - Remove __invalidate_kernel_vmap_range
    - Remove plat_timer_setup
    - Declare various variables & functions static
    - Abstract CPU core & VP(E) ID access through accessor functions
    - Store core & VP IDs in GlobalNumber-style variable
    - Unify checks for sibling CPUs
    - Add CPU cluster number accessors
    - Prevent direct use of generic_defconfig
    - Make CONFIG_MIPS_MT_SMP default y
    - Add __ioread64_copy
    - Remove unnecessary inclusions of linux/irqchip/mips-gic.h

    GIC:
    - Introduce asm/mips-gic.h with accessor functions
    - Use new GIC accessor functions in mips-gic-timer
    - Remove counter access functions from irq-mips-gic.c
    - Remove gic_read_local_vp_id() from irq-mips-gic.c
    - Simplify shared interrupt pending/mask reads in irq-mips-gic.c
    - Simplify gic_local_irq_domain_map() in irq-mips-gic.c
    - Drop gic_(re)set_mask() functions in irq-mips-gic.c
    - Remove gic_set_polarity(), gic_set_trigger(), gic_set_dual_edge(),
    gic_map_to_pin() and gic_map_to_vpe() from irq-mips-gic.c.
    - Convert remaining shared reg access, local int mask access and
    remaining local reg access to new accessors
    - Move GIC_LOCAL_INT_* to asm/mips-gic.h
    - Remove GIC_CPU_INT* macros from irq-mips-gic.c
    - Move various definitions to the driver
    - Remove gic_get_usm_range()
    - Remove __gic_irq_dispatch() forward declaration
    - Remove gic_init()
    - Use mips_gic_present() in place of gic_present and remove
    gic_present
    - Move gic_get_c0_*_int() to asm/mips-gic.h
    - Remove linux/irqchip/mips-gic.h
    - Inline __gic_init()
    - Inline gic_basic_init()
    - Make pcpu_masks a per-cpu variable
    - Use pcpu_masks to avoid reading GIC_SH_MASK*
    - Clean up mti, reserved-cpu-vectors handling
    - Use cpumask_first_and() in gic_set_affinity()
    - Let the core set struct irq_common_data affinity

    microMIPS:
    - Fix microMIPS stack unwinding on big endian systems

    MIPS-GIC:
    - SYNC after enabling GIC region

    NUMA:
    - Remove the unused parent_node() macro

    R6:
    - Constify r2_decoder_tables
    - Add accessor & bit definitions for GlobalNumber

    SMP:
    - Constify smp ops
    - Allow boot_secondary SMP op to return errors

    VDSO:
    - Drop gic_get_usm_range() usage
    - Avoid use of linux/irqchip/mips-gic.h

    Platform changes:

    Alchemy:
    - Add devboard machine type to cpuinfo
    - update cpu feature overrides
    - Threaded carddetect irqs for devboards

    AR7:
    - allow NULL clock for clk_get_rate

    BCM63xx:
    - Fix ENETDMA_6345_MAXBURST_REG offset
    - Allow NULL clock for clk_get_rate

    CI20:
    - Enable GPIO and RTC drivers in defconfig
    - Add ethernet and fixed-regulator nodes to DTS

    Generic platform:
    - Move Boston and NI 169445 FIT image source to their own files
    - Include asm/bootinfo.h for plat_fdt_relocated()
    - Include asm/time.h for get_c0_*_int()
    - Include asm/bootinfo.h for plat_fdt_relocated()
    - Include asm/time.h for get_c0_*_int()
    - Allow filtering enabled boards by requirements
    - Don't explicitly disable CONFIG_USB_SUPPORT
    - Bump default NR_CPUS to 16

    JZ4700:
    - Probe the jz4740-rtc driver from devicetree

    Lantiq:
    - Drop check of boot select from the spi-falcon driver.
    - Drop check of boot select from the lantiq-flash MTD driver.
    - Access boot cause register in the watchdog driver through regmap
    - Add device tree binding documentation for the watchdog driver
    - Add docs for the RCU DT bindings.
    - Convert the fpi bus driver to a platform_driver
    - Remove ltq_reset_cause() and ltq_boot_select(
    - Switch to a proper reset driver
    - Switch to a new drivers/soc GPHY driver
    - Add an USB PHY driver for the Lantiq SoCs using the RCU module
    - Use of_platform_default_populate instead of __dt_register_buses
    - Enable MFD_SYSCON to be able to use it for the RCU MFD
    - Replace ltq_boot_select() with dummy implementation.

    Loongson 2F:
    - Allow NULL clock for clk_get_rate

    Malta:
    - Use new GIC accessor functions

    NI 169445:
    - Add support for NI 169445 board.
    - Only include in 32r2el kernels

    Octeon:
    - Add support for watchdog of 78XX SOCs.
    - Add support for watchdog of CN68XX SOCs.
    - Expose support for mips32r1, mips32r2 and mips64r1
    - Enable more drivers in config file
    - Add support for accessing the boot vector.
    - Remove old boot vector code from watchdog driver
    - Define watchdog registers for 70xx, 73xx, 78xx, F75xx.
    - Make CSR functions node aware.
    - Allow access to CIU3 IRQ domains.
    - Misc cleanups in the watchdog driver

    Omega2+:
    - New board, add support and defconfig

    Pistachio:
    - Enable Root FS on NFS in defconfig

    Ralink:
    - Add Mediatek MT7628A SoC
    - Allow NULL clock for clk_get_rate
    - Explicitly request exclusive reset control in the pci-mt7620 PCI driver.

    SEAD3:
    - Only include in 32 bit kernels by default

    VoCore:
    - Add VoCore as a vendor t0 dt-bindings
    - Add defconfig file"

    * '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (167 commits)
    MIPS: Refactor handling of stack pointer in get_frame_info
    MIPS: Stacktrace: Fix microMIPS stack unwinding on big endian systems
    MIPS: microMIPS: Fix decoding of swsp16 instruction
    MIPS: microMIPS: Fix decoding of addiusp instruction
    MIPS: microMIPS: Fix detection of addiusp instruction
    MIPS: Handle non word sized instructions when examining frame
    MIPS: ralink: allow NULL clock for clk_get_rate
    MIPS: Loongson 2F: allow NULL clock for clk_get_rate
    MIPS: BCM63XX: allow NULL clock for clk_get_rate
    MIPS: AR7: allow NULL clock for clk_get_rate
    MIPS: BCM63XX: fix ENETDMA_6345_MAXBURST_REG offset
    mips: Save all registers when saving the frame
    MIPS: Add DWARF unwinding to assembly
    MIPS: Make SAVE_SOME more standard
    MIPS: Fix issues in backtraces
    MIPS: jz4780: DTS: Probe the jz4740-rtc driver from devicetree
    MIPS: Ci20: Enable RTC driver
    watchdog: octeon-wdt: Add support for 78XX SOCs.
    watchdog: octeon-wdt: Add support for cn68XX SOCs.
    watchdog: octeon-wdt: File cleaning.
    ...

    Linus Torvalds
     

06 Sep, 2017

1 commit

  • Pull power management updates from Rafael Wysocki:
    "This time (again) cpufreq gets the majority of changes which mostly
    are driver updates (including a major consolidation of intel_pstate),
    some schedutil governor modifications and core cleanups.

    There also are some changes in the system suspend area, mostly related
    to diagnostics and debug messages plus some renames of things related
    to suspend-to-idle. One major change here is that suspend-to-idle is
    now going to be preferred over S3 on systems where the ACPI tables
    indicate to do so and provide requsite support (the Low Power Idle S0
    _DSM in particular). The system sleep documentation and the tools
    related to it are updated too.

    The rest is a few cpuidle changes (nothing major), devfreq updates,
    generic power domains (genpd) framework updates and a few assorted
    modifications elsewhere.

    Specifics:

    - Drop the P-state selection algorithm based on a PID controller from
    intel_pstate and make it use the same P-state selection method
    (based on the CPU load) for all types of systems in the active mode
    (Rafael Wysocki, Srinivas Pandruvada).

    - Rework the cpufreq core and governors to make it possible to take
    cross-CPU utilization updates into account and modify the schedutil
    governor to actually do so (Viresh Kumar).

    - Clean up the handling of transition latency information in the
    cpufreq core and untangle it from the information on which drivers
    cannot do dynamic frequency switching (Viresh Kumar).

    - Add support for new SoCs (MT2701/MT7623 and MT7622) to the mediatek
    cpufreq driver and update its DT bindings (Sean Wang).

    - Modify the cpufreq dt-platdev driver to autimatically create
    cpufreq devices for the new (v2) Operating Performance Points (OPP)
    DT bindings and update its whitelist of supported systems (Viresh
    Kumar, Shubhrajyoti Datta, Marc Gonzalez, Khiem Nguyen, Finley
    Xiao).

    - Add support for Ux500 to the cpufreq-dt driver and drop the
    obsolete dbx500 cpufreq driver (Linus Walleij, Arnd Bergmann).

    - Add new SoC (R8A7795) support to the cpufreq rcar driver (Khiem
    Nguyen).

    - Fix and clean up assorted issues in the cpufreq drivers and core
    (Arvind Yadav, Christophe Jaillet, Colin Ian King, Gustavo Silva,
    Julia Lawall, Leonard Crestez, Rob Herring, Sudeep Holla).

    - Update the IO-wait boost handling in the schedutil governor to make
    it less aggressive (Joel Fernandes).

    - Rework system suspend diagnostics to make it print fewer messages
    to the kernel log by default, add a sysfs knob to allow more
    suspend-related messages to be printed and add Low Power S0 Idle
    constraints checks to the ACPI suspend-to-idle code (Rafael
    Wysocki, Srinivas Pandruvada).

    - Prefer suspend-to-idle over S3 on ACPI-based systems with the
    ACPI_FADT_LOW_POWER_S0 flag set and the Low Power Idle S0 _DSM
    interface present in the ACPI tables (Rafael Wysocki).

    - Update documentation related to system sleep and rename a number of
    items in the code to make it cleare that they are related to
    suspend-to-idle (Rafael Wysocki).

    - Export a variable allowing device drivers to check the target
    system sleep state from the core system suspend code (Florian
    Fainelli).

    - Clean up the cpuidle subsystem to handle the polling state on x86
    in a more straightforward way and to use %pOF instead of full_name
    (Rafael Wysocki, Rob Herring).

    - Update the devfreq framework to fix and clean up a few minor issues
    (Chanwoo Choi, Rob Herring).

    - Extend diagnostics in the generic power domains (genpd) framework
    and clean it up slightly (Thara Gopinath, Rob Herring).

    - Fix and clean up a couple of issues in the operating performance
    points (OPP) framework (Viresh Kumar, Waldemar Rymarkiewicz).

    - Add support for RV1108 to the rockchip-io Adaptive Voltage Scaling
    (AVS) driver (David Wu).

    - Fix the usage of notifiers in CPU power management on some
    platforms (Alex Shi).

    - Update the pm-graph system suspend/hibernation and boot profiling
    utility (Todd Brandt).

    - Make it possible to run the cpupower utility without CPU0 (Prarit
    Bhargava)"

    * tag 'pm-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (87 commits)
    cpuidle: Make drivers initialize polling state
    cpuidle: Move polling state initialization code to separate file
    cpuidle: Eliminate the CPUIDLE_DRIVER_STATE_START symbol
    cpufreq: imx6q: Fix imx6sx low frequency support
    cpufreq: speedstep-lib: make several arrays static, makes code smaller
    PM: docs: Delete the obsolete states.txt document
    PM: docs: Describe high-level PM strategies and sleep states
    PM / devfreq: Fix memory leak when fail to register device
    PM / devfreq: Add dependency on PM_OPP
    PM / devfreq: Move private devfreq_update_stats() into devfreq
    PM / devfreq: Convert to using %pOF instead of full_name
    PM / AVS: rockchip-io: add io selectors and supplies for RV1108
    cpufreq: ti: Fix 'of_node_put' being called twice in error handling path
    cpufreq: dt-platdev: Drop few entries from whitelist
    cpufreq: dt-platdev: Automatically create cpufreq device with OPP v2
    ARM: ux500: don't select CPUFREQ_DT
    cpuidle: Convert to using %pOF instead of full_name
    cpufreq: Convert to using %pOF instead of full_name
    PM / Domains: Convert to using %pOF instead of full_name
    cpufreq: Cap the default transition delay value to 10 ms
    ...

    Linus Torvalds
     

04 Sep, 2017

1 commit

  • * pm-sleep:
    ACPI / PM: Check low power idle constraints for debug only
    PM / s2idle: Rename platform operations structure
    PM / s2idle: Rename ->enter_freeze to ->enter_s2idle
    PM / s2idle: Rename freeze_state enum and related items
    PM / s2idle: Rename PM_SUSPEND_FREEZE to PM_SUSPEND_TO_IDLE
    ACPI / PM: Prefer suspend-to-idle over S3 on some systems
    platform/x86: intel-hid: Wake up Dell Latitude 7275 from suspend-to-idle
    PM / suspend: Define pr_fmt() in suspend.c
    PM / suspend: Use mem_sleep_labels[] strings in messages
    PM / sleep: Put pm_test under CONFIG_PM_SLEEP_DEBUG
    PM / sleep: Check pm_wakeup_pending() in __device_suspend_noirq()
    PM / core: Add error argument to dpm_show_time()
    PM / core: Split dpm_suspend_noirq() and dpm_resume_noirq()
    PM / s2idle: Rearrange the main suspend-to-idle loop
    PM / timekeeping: Print debug messages when requested
    PM / sleep: Mark suspend/hibernation start and finish
    PM / sleep: Do not print debug messages by default
    PM / suspend: Export pm_suspend_target_state

    Rafael J. Wysocki
     

30 Aug, 2017

5 commits

  • Make the drivers that want to include the polling state into their
    states table initialize it explicitly and drop the initialization of
    it (which in fact is conditional, but that is not obvious from the
    code) from the core.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Sudeep Holla
    Acked-by: Daniel Lezcano

    Rafael J. Wysocki
     
  • Move the polling state initialization code to a separate file built
    conditionally on CONFIG_ARCH_HAS_CPU_RELAX to get rid of the #ifdef
    in driver.c.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Sudeep Holla
    Acked-by: Daniel Lezcano

    Rafael J. Wysocki
     
  • On some architectures the first (index 0) idle state is a polling
    one and it doesn't really save energy, so there is the
    CPUIDLE_DRIVER_STATE_START symbol allowing some pieces of
    cpuidle code to avoid using that state.

    However, this makes the code rather hard to follow. It is better
    to explicitly avoid the polling state, so add a new cpuidle state
    flag CPUIDLE_FLAG_POLLING to mark it and make the relevant code
    check that flag for the first state instead of using the
    CPUIDLE_DRIVER_STATE_START symbol.

    In the ACPI processor driver that cannot always rely on the state
    flags (like before the states table has been set up) define
    a new internal symbol ACPI_IDLE_STATE_START equivalent to the
    CPUIDLE_DRIVER_STATE_START one and drop the latter.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Sudeep Holla
    Acked-by: Daniel Lezcano

    Rafael J. Wysocki
     
  • Up until now we have open-coded checks for whether CPUs are siblings,
    with slight variations on whether we consider the package ID or not.

    This will only get more complex when we introduce cluster support, so in
    preparation for that this patch introduces a cpus_are_siblings()
    function which can be used to check whether or not 2 CPUs are siblings
    in a consistent manner.

    By checking globalnumber with the VP ID masked out this also has the
    neat side effect of being ready for multi-cluster systems already.

    Signed-off-by: Paul Burton
    Acked-by: Rafael J. Wysocki
    Acked-by: Thomas Gleixner
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/17011/
    Signed-off-by: Ralf Baechle

    Paul Burton
     
  • We currently have fields in struct cpuinfo_mips for the core & VP(E) ID
    of a particular CPU, and various pieces of code directly access those
    fields. This patch abstracts such access by introducing accessor
    functions cpu_core(), cpu_set_core(), cpu_vpe_id() & cpu_set_vpe_id()
    and having code that needs to access these values call those functions
    rather than directly accessing the struct cpuinfo_mips fields. This
    prepares us for changes to the way in which those values are stored in
    later patches.

    The cpu_vpe_id() function is introduced even though we already had a
    cpu_vpe_id() macro for a couple of reasons:

    1) It's more consistent with the core, and future cluster, accessors.

    2) It ensures a sensible return type without explicit casts.

    3) It's generally preferable to use functions rather than macros.

    Signed-off-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/17009/
    Signed-off-by: Ralf Baechle

    Paul Burton
     

29 Aug, 2017

1 commit

  • struct call_single_data is used in IPIs to transfer information between
    CPUs. Its size is bigger than sizeof(unsigned long) and less than
    cache line size. Currently it is not allocated with any explicit alignment
    requirements. This makes it possible for allocated call_single_data to
    cross two cache lines, which results in double the number of the cache lines
    that need to be transferred among CPUs.

    This can be fixed by requiring call_single_data to be aligned with the
    size of call_single_data. Currently the size of call_single_data is the
    power of 2. If we add new fields to call_single_data, we may need to
    add padding to make sure the size of new definition is the power of 2
    as well.

    Fortunately, this is enforced by GCC, which will report bad sizes.

    To set alignment requirements of call_single_data to the size of
    call_single_data, a struct definition and a typedef is used.

    To test the effect of the patch, I used the vm-scalability multiple
    thread swap test case (swap-w-seq-mt). The test will create multiple
    threads and each thread will eat memory until all RAM and part of swap
    is used, so that huge number of IPIs are triggered when unmapping
    memory. In the test, the throughput of memory writing improves ~5%
    compared with misaligned call_single_data, because of faster IPIs.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Huang, Ying
    [ Add call_single_data_t and align with size of call_single_data. ]
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Aaron Lu
    Cc: Borislav Petkov
    Cc: Eric Dumazet
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Michael Ellerman
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/87bmnqd6lz.fsf@yhuang-mobile.sh.intel.com
    Signed-off-by: Ingo Molnar

    Ying Huang
     

25 Aug, 2017

1 commit


11 Aug, 2017

1 commit


08 Aug, 2017

1 commit

  • Currently, we use the opal call opal_slw_set_reg() to inform the
    Sleep-Winkle Engine (SLW) to restore the contents of some of the
    Hypervisor state on wakeup from deep idle states that lose full
    hypervisor context (characterized by the flag
    OPAL_PM_LOSE_FULL_CONTEXT).

    However, the current code has a bug in that if opal_slw_set_reg()
    fails, we don't disable the use of these deep states (winkle on
    POWER8, stop4 onwards on POWER9).

    This patch fixes this bug by ensuring that if programing the
    sleep-winkle engine to restore the hypervisor states in
    pnv_save_sprs_for_deep_states() fails, then we exclude such states by
    clearing the OPAL_PM_LOSE_FULL_CONTEXT flag from
    supported_cpuidle_states. As a result POWER8 will be prevented from
    using winkle for CPU-Hotplug, and POWER9 will put the offlined CPUs to
    the default stop state when available.

    Further, we ensure in the initialization of the cpuidle-powernv driver
    to only include those states whose flags are present in
    supported_cpuidle_states, thereby skipping OPAL_PM_LOSE_FULL_CONTEXT
    states when they have been disabled due to stop-api failure.

    Fixes: 1e1601b38e6 ("powerpc/powernv/idle: Restore SPRs for deep idle
    states via stop API.")

    Signed-off-by: Gautham R. Shenoy
    Signed-off-by: Michael Ellerman

    Gautham R. Shenoy
     

08 Jul, 2017

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Highlights include:

    - Support for STRICT_KERNEL_RWX on 64-bit server CPUs.

    - Platform support for FSP2 (476fpe) board

    - Enable ZONE_DEVICE on 64-bit server CPUs.

    - Generic & powerpc spin loop primitives to optimise busy waiting

    - Convert VDSO update function to use new update_vsyscall() interface

    - Optimisations to hypercall/syscall/context-switch paths

    - Improvements to the CPU idle code on Power8 and Power9.

    As well as many other fixes and improvements.

    Thanks to: Akshay Adiga, Andrew Donnellan, Andrew Jeffery, Anshuman
    Khandual, Anton Blanchard, Balbir Singh, Benjamin Herrenschmidt,
    Christophe Leroy, Christophe Lombard, Colin Ian King, Dan Carpenter,
    Gautham R. Shenoy, Hari Bathini, Ian Munsie, Ivan Mikhaylov, Javier
    Martinez Canillas, Madhavan Srinivasan, Masahiro Yamada, Matt Brown,
    Michael Neuling, Michal Suchanek, Murilo Opsfelder Araujo, Naveen N.
    Rao, Nicholas Piggin, Oliver O'Halloran, Paul Mackerras, Pavel Machek,
    Russell Currey, Santosh Sivaraj, Stephen Rothwell, Thiago Jung
    Bauermann, Yang Li"

    * tag 'powerpc-4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (158 commits)
    powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs
    powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix
    powerpc/mm/hash: Implement mark_rodata_ro() for hash
    powerpc/vmlinux.lds: Align __init_begin to 16M
    powerpc/lib/code-patching: Use alternate map for patch_instruction()
    powerpc/xmon: Add patch_instruction() support for xmon
    powerpc/kprobes/optprobes: Use patch_instruction()
    powerpc/kprobes: Move kprobes over to patch_instruction()
    powerpc/mm/radix: Fix execute permissions for interrupt_vectors
    powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp()
    powerpc/64s: Blacklist rtas entry/exit from kprobes
    powerpc/64s: Blacklist functions invoked on a trap
    powerpc/64s: Un-blacklist system_call() from kprobes
    powerpc/64s: Move system_call() symbol to just after setting MSR_EE
    powerpc/64s: Blacklist system_call() and system_call_common() from kprobes
    powerpc/64s: Convert .L__replay_interrupt_return to a local label
    powerpc64/elfv1: Only dereference function descriptor for non-text symbols
    cxl: Export library to support IBM XSL
    powerpc/dts: Use #include "..." to include local DT
    powerpc/perf/hv-24x7: Aggregate result elements on POWER9 SMT8
    ...

    Linus Torvalds
     

05 Jul, 2017

1 commit

  • Pull power management updates from Rafael Wysocki:
    "The big ticket items here are the rework of suspend-to-idle in order
    to add proper support for power button wakeup from it on recent Dell
    laptops and the rework of interfaces exporting the current CPU
    frequency on x86.

    In addition to that, support for a few new pieces of hardware is
    added, the PCI/ACPI device wakeup infrastructure is simplified
    significantly and the wakeup IRQ framework is fixed to unbreak the IRQ
    bus locking infrastructure.

    Also, there are some functional improvements for intel_pstate, tools
    updates and small fixes and cleanups all over.

    Specifics:

    - Rework suspend-to-idle to allow it to take wakeup events signaled
    by the EC into account on ACPI-based platforms in order to properly
    support power button wakeup from suspend-to-idle on recent Dell
    laptops (Rafael Wysocki).

    That includes the core suspend-to-idle code rework, support for the
    Low Power S0 _DSM interface, and support for the ACPI INT0002
    Virtual GPIO device from Hans de Goede (required for USB keyboard
    wakeup from suspend-to-idle to work on some machines).

    - Stop trying to export the current CPU frequency via /proc/cpuinfo
    on x86 as that is inaccurate and confusing (Len Brown).

    - Rework the way in which the current CPU frequency is exported by
    the kernel (over the cpufreq sysfs interface) on x86 systems with
    the APERF and MPERF registers by always using values read from
    these registers, when available, to compute the current frequency
    regardless of which cpufreq driver is in use (Len Brown).

    - Rework the PCI/ACPI device wakeup infrastructure to remove the
    questionable and artificial distinction between "devices that can
    wake up the system from sleep states" and "devices that can
    generate wakeup signals in the working state" from it, which allows
    the code to be simplified quite a bit (Rafael Wysocki).

    - Fix the wakeup IRQ framework by making it use SRCU instead of RCU
    which doesn't allow sleeping in the read-side critical sections,
    but which in turn is expected to be allowed by the IRQ bus locking
    infrastructure (Thomas Gleixner).

    - Modify some computations in the intel_pstate driver to avoid
    rounding errors resulting from them (Srinivas Pandruvada).

    - Reduce the overhead of the intel_pstate driver in the HWP
    (hardware-managed P-states) mode and when the "performance" P-state
    selection algorithm is in use by making it avoid registering
    scheduler callbacks in those cases (Len Brown).

    - Rework the energy_performance_preference sysfs knob in intel_pstate
    by changing the values that correspond to different symbolic hint
    names used by it (Len Brown).

    - Make it possible to use more than one cpuidle driver at the same
    time on ARM (Daniel Lezcano).

    - Make it possible to prevent the cpuidle menu governor from using
    the 0 state by disabling it via sysfs (Nicholas Piggin).

    - Add support for FFH (Fixed Functional Hardware) MWAIT in ACPI C1 on
    AMD systems (Yazen Ghannam).

    - Make the CPPC cpufreq driver take the lowest nonlinear performance
    information into account (Prashanth Prakash).

    - Add support for hi3660 to the cpufreq-dt driver, fix the imx6q
    driver and clean up the sfi, exynos5440 and intel_pstate drivers
    (Colin Ian King, Krzysztof Kozlowski, Octavian Purdila, Rafael
    Wysocki, Tao Wang).

    - Fix a few minor issues in the generic power domains (genpd)
    framework and clean it up somewhat (Krzysztof Kozlowski, Mikko
    Perttunen, Viresh Kumar).

    - Fix a couple of minor issues in the operating performance points
    (OPP) framework and clean it up somewhat (Viresh Kumar).

    - Fix a CONFIG dependency in the hibernation core and clean it up
    slightly (Balbir Singh, Arvind Yadav, BaoJun Luo).

    - Add rk3228 support to the rockchip-io adaptive voltage scaling
    (AVS) driver (David Wu).

    - Fix an incorrect bit shift operation in the RAPL power capping
    driver (Adam Lessnau).

    - Add support for the EPP field in the HWP (hardware managed
    P-states) control register, HWP.EPP, to the x86_energy_perf_policy
    tool and update msr-index.h with HWP.EPP values (Len Brown).

    - Fix some minor issues in the turbostat tool (Len Brown).

    - Add support for AMD family 0x17 CPUs to the cpupower tool and fix a
    minor issue in it (Sherry Hurwitz).

    - Assorted cleanups, mostly related to the constification of some
    data structures (Arvind Yadav, Joe Perches, Kees Cook, Krzysztof
    Kozlowski)"

    * tag 'pm-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (69 commits)
    cpufreq: Update scaling_cur_freq documentation
    cpufreq: intel_pstate: Clean up after performance governor changes
    PM: hibernate: constify attribute_group structures.
    cpuidle: menu: allow state 0 to be disabled
    intel_idle: Use more common logging style
    PM / Domains: Fix missing default_power_down_ok comment
    PM / Domains: Fix unsafe iteration over modified list of domains
    PM / Domains: Fix unsafe iteration over modified list of domain providers
    PM / Domains: Fix unsafe iteration over modified list of device links
    PM / Domains: Handle safely genpd_syscore_switch() call on non-genpd device
    PM / Domains: Call driver's noirq callbacks
    PM / core: Drop run_wake flag from struct dev_pm_info
    PCI / PM: Simplify device wakeup settings code
    PCI / PM: Drop pme_interrupt flag from struct pci_dev
    ACPI / PM: Consolidate device wakeup settings code
    ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags
    PM / QoS: constify *_attribute_group.
    PM / AVS: rockchip-io: add io selectors and supplies for rk3228
    powercap/RAPL: prevent overridding bits outside of the mask
    PM / sysfs: Constify attribute groups
    ...

    Linus Torvalds
     

30 Jun, 2017

1 commit

  • The menu driver does not allow state0 to be disabled completely.
    If it is disabled but other enabled states don't meet latency
    requirements, it is still used.

    Fix this by starting with the first enabled idle state. Fall back
    to state 0 if no idle states are enabled (arguably this should be
    -EINVAL if it is attempted, but this is the minimal fix).

    Acked-by: Gautham R. Shenoy
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Rafael J. Wysocki

    Nicholas Piggin
     

28 Jun, 2017

3 commits


24 Jun, 2017

1 commit

  • Some hardware have clusters with different idle states. The current code does
    not support this and fails as it expects all the idle states to be identical.

    Because of this, the Mediatek mtk8173 had to create the same idle state for a
    big.Little system and now the Hisilicon 960 is facing the same situation.

    Solve this by simply assuming the multiple driver will be needed for all the
    platforms using the ARM generic cpuidle driver which makes sense because of the
    different topologies we can support with a single kernel for ARM32 or ARM64.

    Every CPU has its own driver, so every single CPU can specify in the DT the
    idle states.

    This simple approach allows to support the future dynamIQ system, current SMP
    and HMP.

    Tested on:
    - 96boards: Hikey 620
    - 96boards: Hikey 960
    - 96boards: dragonboard410c
    - Mediatek 8173

    Tested-by: Leo Yan
    Signed-off-by: Daniel Lezcano
    Acked-by: Sudeep Holla
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

20 Jun, 2017

1 commit


19 Jun, 2017

1 commit


15 Jun, 2017

1 commit

  • * pm-cpufreq:
    cpufreq: conservative: Allow down_threshold to take values from 1 to 10
    Revert "cpufreq: schedutil: Reduce frequencies slower"

    * pm-cpuidle:
    cpuidle: dt: Add missing 'of_node_put()'

    * pm-devfreq:
    PM / devfreq: exynos-ppmu: Staticize event list
    PM / devfreq: exynos-ppmu: Handle return value of clk_prepare_enable
    PM / devfreq: exynos-nocp: Handle return value of clk_prepare_enable

    Rafael J. Wysocki
     

12 Jun, 2017

1 commit

  • 'of_node_put()' should be called on pointer returned by
    'of_parse_phandle()' when done. In this function this is done in all path
    except this 'continue', so add it.

    Fixes: 97735da074fd (drivers: cpuidle: Add status property to ARM idle states)
    Signed-off-by: Christophe Jaillet
    Signed-off-by: Rafael J. Wysocki

    Christophe Jaillet
     

30 May, 2017

1 commit

  • The current code in the cpuidle-powernv intialization only allows deep
    stop states (indicated by OPAL_PM_STOP_INST_DEEP) which lose timebase
    (indicated by OPAL_PM_TIMEBASE_STOP). This assumption goes back to
    POWER8 time where deep states used to lose the timebase. However, on
    POWER9, we do have stop states that are deep (they lose hypervisor
    state) but retain the timebase.

    Fix the initialization code in the cpuidle-powernv driver to allow
    such deep states.

    Further, there is a bug in cpuidle-powernv driver with
    CONFIG_TICK_ONESHOT=n where we end up incrementing the nr_idle_states
    even if a platform idle state which loses time base was not added to
    the cpuidle table.

    Fix this by ensuring that the nr_idle_states variable gets incremented
    only when the platform idle state was added to the cpuidle table.

    Signed-off-by: Gautham R. Shenoy
    Signed-off-by: Michael Ellerman

    Gautham R. Shenoy
     

15 May, 2017

1 commit

  • Ville reported that on his Core2, which has TSC stop in idle, we would
    always report very short idle durations. He tracked this down to
    commit:

    e93e59ce5b85 ("cpuidle: Replace ktime_get() with local_clock()")

    which replaces ktime_get() with local_clock().

    Add a sched_clock_idle_wakeup_event() call, which will re-sync the
    clock with ktime_get_ns() when TSC is unstable and no-op otherwise.

    Reported-by: Ville Syrjälä
    Tested-by: Ville Syrjälä
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Daniel Lezcano
    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Rafael J . Wysocki
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Fixes: e93e59ce5b85 ("cpuidle: Replace ktime_get() with local_clock()")
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

10 May, 2017

1 commit

  • * pm-domains:
    PM / Domains: Add DT file to MAINTAINERS
    PM / Domains: Fix DT example

    * pm-cpuidle:
    x86/intel_idle: add Gemini Lake support
    cpuidle: check dev before usage in cpuidle_use_deepest_state()

    * pm-sleep:
    ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle
    PM / wakeup: Integrate mechanism to abort transitions in progress

    * powercap:
    powercap: intel_rapl: Add support for Gemini Lake

    Rafael J. Wysocki
     

02 May, 2017

1 commit

  • In case of there is no cpuidle devices registered, dev will be null, and
    panic will be triggered like below;
    In this patch, add checking of dev before usage, like that done in
    cpuidle_idle_call.

    Panic without fix:
    [ 184.961328] BUG: unable to handle kernel NULL pointer dereference at
    (null)
    [ 184.961328] IP: cpuidle_use_deepest_state+0x30/0x60
    ...
    [ 184.961328] play_idle+0x8d/0x210
    [ 184.961328] ? __schedule+0x359/0x8e0
    [ 184.961328] ? _raw_spin_unlock_irqrestore+0x28/0x50
    [ 184.961328] ? kthread_queue_delayed_work+0x41/0x80
    [ 184.961328] clamp_idle_injection_func+0x64/0x1e0

    Fixes: bb8313b603eb8 (cpuidle: Allow enforcing deepest idle state selection)
    Signed-off-by: Li, Fei
    Tested-by: Shi, Feng
    Reviewed-by: Andy Shevchenko
    Cc: 4.10+ # 4.10+
    Signed-off-by: Rafael J. Wysocki

    Li, Fei
     

29 Apr, 2017

1 commit

  • * pm-cpuidle:
    cpuidle: powernv: Avoid a branch in the core snooze_loop() loop
    cpuidle: powernv: Don't continually set thread priority in snooze_loop()
    cpuidle: powernv: Don't bounce between low and very low thread priority
    cpuidle: cpuidle-cps: remove unused variable
    powernv-cpuidle: Validate DT property array size

    * pm-core:
    PM / runtime: Document autosuspend-helper side effects
    PM / runtime: Fix autosuspend documentation

    * pm-domains:
    PM / Domains: Ignore domain-idle-states that are not compatible
    PM / Domains: Don't warn about IRQ safe device for an always on PM domain
    PM / Domains: Respect errors from genpd's ->power_off() callback
    PM / Domains: Enable users of genpd to specify always on PM domains
    PM / Domains: Clean up code validating genpd's status
    PM / Domain: remove conditional from error case

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

    * pm-devfreq:
    PM / devfreq: Move struct devfreq_governor to devfreq directory

    Rafael J. Wysocki
     

20 Apr, 2017

4 commits


30 Mar, 2017

1 commit

  • drv->cpumask defaults to cpu_possible_mask in __cpuidle_driver_init().
    On PowerNV platform cpu_present could be less than cpu_possible in cases
    where firmware detects the cpu, but it is not available to the OS. When
    CONFIG_HOTPLUG_CPU=n, such cpus are not hotplugable at runtime and hence
    we skip creating cpu_device.

    This breaks cpuidle on powernv where register_cpu() is not called for
    cpus in cpu_possible_mask that cannot be hot-added at runtime.

    Trying cpuidle_register_device() on cpu without cpu_device will cause
    crash like this:

    cpu 0xf: Vector: 380 (Data SLB Access) at [c000000ff1503490]
    pc: c00000000022c8bc: string+0x34/0x60
    lr: c00000000022ed78: vsnprintf+0x284/0x42c
    sp: c000000ff1503710
    msr: 9000000000009033
    dar: 6000000060000000
    current = 0xc000000ff1480000
    paca = 0xc00000000fe82d00 softe: 0 irq_happened: 0x01
    pid = 1, comm = swapper/8
    Linux version 4.11.0-rc2 (sv@sagarika) (gcc version 4.9.4
    (Buildroot 2017.02-00004-gc28573e) ) #15 SMP Fri Mar 17 19:32:02 IST 2017
    enter ? for help
    [link register ] c00000000022ed78 vsnprintf+0x284/0x42c
    [c000000ff1503710] c00000000022ebb8 vsnprintf+0xc4/0x42c (unreliable)
    [c000000ff1503800] c00000000022ef40 vscnprintf+0x20/0x44
    [c000000ff1503830] c0000000000ab61c vprintk_emit+0x94/0x2cc
    [c000000ff15038a0] c0000000000acc9c vprintk_func+0x60/0x74
    [c000000ff15038c0] c000000000619694 printk+0x38/0x4c
    [c000000ff15038e0] c000000000224950 kobject_get+0x40/0x60
    [c000000ff1503950] c00000000022507c kobject_add_internal+0x60/0x2c4
    [c000000ff15039e0] c000000000225350 kobject_init_and_add+0x70/0x78
    [c000000ff1503a60] c00000000053c288 cpuidle_add_sysfs+0x9c/0xe0
    [c000000ff1503ae0] c00000000053aeac cpuidle_register_device+0xd4/0x12c
    [c000000ff1503b30] c00000000053b108 cpuidle_register+0x98/0xcc
    [c000000ff1503bc0] c00000000085eaf0 powernv_processor_idle_init+0x140/0x1e0
    [c000000ff1503c60] c00000000000cd60 do_one_initcall+0xc0/0x15c
    [c000000ff1503d20] c000000000833e84 kernel_init_freeable+0x1a0/0x25c
    [c000000ff1503dc0] c00000000000d478 kernel_init+0x24/0x12c
    [c000000ff1503e30] c00000000000b564 ret_from_kernel_thread+0x5c/0x78

    This patch fixes the bug by passing correct cpumask from
    powernv-cpuidle driver.

    Signed-off-by: Vaidyanathan Srinivasan
    Reviewed-by: Gautham R. Shenoy
    Acked-by: Michael Ellerman
    [ rjw: Comment massage ]
    Signed-off-by: Rafael J. Wysocki

    Vaidyanathan Srinivasan