15 Feb, 2020

1 commit

  • commit 1985f8c7f9a42a651a9750d6fcadc74336d182df upstream.

    If we compile tools/acpi target in the top source directory, we'd get a
    compilation error showing as bellow:

    # make tools/acpi
    DESCEND power/acpi
    DESCEND tools/acpidbg
    CC tools/acpidbg/acpidbg.o
    Assembler messages:
    Fatal error: can't create /home/lzy/kernel-upstream/power/acpi/\
    tools/acpidbg/acpidbg.o: No such file or directory
    ../../Makefile.rules:26: recipe for target '/home/lzy/kernel-upstream/\
    power/acpi/tools/acpidbg/acpidbg.o' failed
    make[3]: *** [/home/lzy/kernel-upstream//power/acpi/tools/acpidbg/\
    acpidbg.o] Error 1
    Makefile:19: recipe for target 'acpidbg' failed
    make[2]: *** [acpidbg] Error 2
    Makefile:54: recipe for target 'acpi' failed
    make[1]: *** [acpi] Error 2
    Makefile:1607: recipe for target 'tools/acpi' failed
    make: *** [tools/acpi] Error 2

    Fixes: d5a4b1a540b8 ("tools/power/acpi: Remove direct kernel source include reference")
    Signed-off-by: Zhengyuan Liu
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Zhengyuan Liu
     

11 Feb, 2020

1 commit

  • commit 41ddb7e1f79693d904502ae9bea609837973eff8 upstream.

    Commit ae2917093fb6 ("tools/power/cpupower: Display boost frequency
    separately") modified the library function:

    struct cpufreq_available_frequencies
    *cpufreq_get_available_frequencies(unsigned int cpu)

    to
    struct cpufreq_frequencies
    *cpufreq_get_frequencies(const char *type, unsigned int cpu)

    This patch recovers the old API and implements the new functionality
    in a newly introduce method:
    struct cpufreq_boost_frequencies
    *cpufreq_get_available_frequencies(unsigned int cpu)

    This one should get merged into stable kernels back to 5.0 when
    the above had been introduced.

    Fixes: ae2917093fb6 ("tools/power/cpupower: Display boost frequency separately")

    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Renninger
    Signed-off-by: Shuah Khan
    Signed-off-by: Greg Kroah-Hartman

    Thomas Renninger
     

05 Jan, 2020

2 commits

  • [ Upstream commit 20183ccd3e4d01d23b0a01fe9f3ee73fbae312fa ]

    It is possible that certain config levels are not available, even
    if the max level includes the level. There can be missing levels in
    some platforms. So ignore the level when called for information dump
    for all levels and fail if specifically ask for the missing level.

    Here the changes is to continue reading information about other levels
    even if we fail to get information for the current level. But use the
    "processed" flag to indicate the failure. When the "processed" flag is
    not set, don't dump information about that level.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Sasha Levin

    Srinivas Pandruvada
     
  • [ Upstream commit abd120e3bdf3dd72ba1ed9ac077a861e0e3dc43a ]

    Fix warning for:
    isst-config.c: In function ‘set_cpu_online_offline’:
    isst-config.c:221:3: warning: ignoring return value of ‘write’,
    declared with attribute warn_unused_result [-Wunused-result]
    write(fd, "1\n", 2);

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Sasha Levin

    Srinivas Pandruvada
     

31 Dec, 2019

1 commit

  • [ Upstream commit 7e5705c635ecfccde559ebbbe1eaf05b5cc60529 ]

    When building cpupower with clang, the following warning appears:

    utils/idle_monitor/hsw_ext_idle.c:42:16: warning: initializer overrides
    prior initialization of this subobject [-Winitializer-overrides]
    .desc = N_("Processor Package C2"),
    ^~~~~~~~~~~~~~~~~~~~~~
    ./utils/helpers/helpers.h:25:33: note: expanded from macro 'N_'
    #define N_(String) gettext_noop(String)
    ^~~~~~
    ./utils/helpers/helpers.h:23:30: note: expanded from macro
    'gettext_noop'
    #define gettext_noop(String) String
    ^~~~~~
    utils/idle_monitor/hsw_ext_idle.c:41:16: note: previous initialization
    is here
    .desc = N_("Processor Package C9"),
    ^~~~~~~~~~~~~~~~~~~~~~
    ./utils/helpers/helpers.h:25:33: note: expanded from macro 'N_'
    #define N_(String) gettext_noop(String)
    ^~~~~~
    ./utils/helpers/helpers.h:23:30: note: expanded from macro
    'gettext_noop'
    #define gettext_noop(String) String
    ^~~~~~
    1 warning generated.

    This appears to be a copy and paste or merge mistake because the name
    and id fields both have PC9 in them, not PC2. Remove the second
    assignment to fix the warning.

    Fixes: 7ee767b69b68 ("cpupower: Add Haswell family 0x45 specific idle monitor to show PC8,9,10 states")
    Link: https://github.com/ClangBuiltLinux/linux/issues/718
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Shuah Khan
    Signed-off-by: Sasha Levin

    Nathan Chancellor
     

25 Sep, 2019

1 commit

  • Pull x86 platform-drivers fixes from Andy Shevchenko:

    - Fix compilation error of ASUS WMI driver when CONFIG_ACPI_BATTERY=n

    - Fix I²C multi-instantiate driver to work with several USB PD devices

    - Fix boot issue on Siemens SIMATIC IPC277E when PMC critical clock is
    being disabled

    - Plenty of fixes to Intel Speed-Select Technology tools

    * tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86:
    platform/x86: i2c-multi-instantiate: Derive the device name from parent
    platform/x86: pmc_atom: Add Siemens SIMATIC IPC277E to critclk_systems DMI table
    tools/power/x86/intel-speed-select: Fix perf-profile command output
    tools/power/x86/intel-speed-select: Extend core-power command set
    tools/power/x86/intel-speed-select: Fix some debug prints
    tools/power/x86/intel-speed-select: Format get-assoc information
    tools/power/x86/intel-speed-select: Allow online/offline based on tdp
    tools/power/x86/intel-speed-select: Fix high priority core mask over count
    platform/x86: asus-wmi: Make it depend on ACPI battery API

    Linus Torvalds
     

19 Sep, 2019

6 commits


18 Sep, 2019

2 commits

  • Pull ACPI updates from Rafael Wysocki:
    "These include an ACPICA update (to upstream revision 20190816),
    improvements of support for memory hot-add in the HMAT handling code
    and some assorted fixes and cleanups.

    Specifics:

    - Update the ACPICA code in the kernel to upstream revision 20190816
    including:
    * Internal limits change to support larger systems (Bob Moore).
    * Macros clean up (Bob Moore).
    * printf format string fixes (Bob Moore).
    * Full deployment of the ACPI_PRINTF_LIKE macro (Bob Moore).
    * Tools improvements (Bob Moore, Colin Ian King).
    * Windows _OSI support fixes (Jung-uk Kim).

    - Improve memory hot-add support in the ACPI HMAT handling code (Dan
    Williams, Keith Busch).

    - Fix the ACPI LPSS (Low-Power Subsystem) driver for Intel SoCs to
    save and restore private registers during system-wide suspend and
    resume on systems with the Lynxpoint PCH (Jarkko Nikula).

    - Convert the ACPI documentation related to LEDs to ReST (Sakari
    Ailus).

    - Fix assorted issues and make assorted minor improvements in the
    ACPI-related code (Al Stone, Andy Shevchenko, Jiri Slaby, Kelsey
    Skunberg, Krzysztof Wilczynski, Liguang Zhang, Wenwen Wang,
    YueHaibing)"

    * tag 'acpi-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits)
    ACPI / PCI: fix acpi_pci_irq_enable() memory leak
    ACPI: custom_method: fix memory leaks
    ACPI: thermal: Remove redundant acpi_has_method() calls
    ACPI / CPPC: do not require the _PSD method
    ACPI: SBS: remove unused const variable 'SMBUS_PEC'
    ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
    ACPI/PCI: Remove surplus parentheses from a return statement
    ACPICA: Update version to 20190816.
    ACPICA: Add "Windows 2019" string to _OSI support.
    ACPICA: Differentiate Windows 8.1 from Windows 8.
    ACPICA: Fully deploy ACPI_PRINTF_LIKE macro
    ACPICA: iASL,acpi_dump: Improve y/n query
    ACPICA: Fix issues with arg types within printf format strings
    ACPICA: Macros: remove pointer math on a null pointer
    ACPICA: Increase total number of possible Owner IDs
    ACPICA: Debugger: remove redundant assignment on obj_desc
    Documentation: ACPI: DSD: Convert LED documentation to ReST
    ACPI / APEI: Release resources if gen_pool_add() fails
    HMAT: Skip publishing target info for nodes with no online memory
    HMAT: Register attributes for memory hot add
    ...

    Linus Torvalds
     
  • Pull power management updates from Rafael Wysocki:
    "These include a rework of the main suspend-to-idle code flow (related
    to the handling of spurious wakeups), a switch over of several users
    of cpufreq notifiers to QoS-based limits, a new devfreq driver for
    Tegra20, a new cpuidle driver and governor for virtualized guests, an
    extension of the wakeup sources framework to expose wakeup sources as
    device objects in sysfs, and more.

    Specifics:

    - Rework the main suspend-to-idle control flow to avoid repeating
    "noirq" device resume and suspend operations in case of spurious
    wakeups from the ACPI EC and decouple the ACPI EC wakeups support
    from the LPS0 _DSM support (Rafael Wysocki).

    - Extend the wakeup sources framework to expose wakeup sources as
    device objects in sysfs (Tri Vo, Stephen Boyd).

    - Expose system suspend statistics in sysfs (Kalesh Singh).

    - Introduce a new haltpoll cpuidle driver and a new matching governor
    for virtualized guests wanting to do guest-side polling in the idle
    loop (Marcelo Tosatti, Joao Martins, Wanpeng Li, Stephen Rothwell).

    - Fix the menu and teo cpuidle governors to allow the scheduler tick
    to be stopped if PM QoS is used to limit the CPU idle state exit
    latency in some cases (Rafael Wysocki).

    - Increase the resolution of the play_idle() argument to microseconds
    for more fine-grained injection of CPU idle cycles (Daniel
    Lezcano).

    - Switch over some users of cpuidle notifiers to the new QoS-based
    frequency limits and drop the CPUFREQ_ADJUST and CPUFREQ_NOTIFY
    policy notifier events (Viresh Kumar).

    - Add new cpufreq driver based on nvmem for sun50i (Yangtao Li).

    - Add support for MT8183 and MT8516 to the mediatek cpufreq driver
    (Andrew-sh.Cheng, Fabien Parent).

    - Add i.MX8MN support to the imx-cpufreq-dt cpufreq driver (Anson
    Huang).

    - Add qcs404 to cpufreq-dt-platdev blacklist (Jorge Ramirez-Ortiz).

    - Update the qcom cpufreq driver (among other things, to make it
    easier to extend and to use kryo cpufreq for other nvmem-based
    SoCs) and add qcs404 support to it (Niklas Cassel, Douglas
    RAILLARD, Sibi Sankar, Sricharan R).

    - Fix assorted issues and make assorted minor improvements in the
    cpufreq code (Colin Ian King, Douglas RAILLARD, Florian Fainelli,
    Gustavo Silva, Hariprasad Kelam).

    - Add new devfreq driver for NVidia Tegra20 (Dmitry Osipenko, Arnd
    Bergmann).

    - Add new Exynos PPMU events to devfreq events and extend that
    mechanism (Lukasz Luba).

    - Fix and clean up the exynos-bus devfreq driver (Kamil Konieczny).

    - Improve devfreq documentation and governor code, fix spelling typos
    in devfreq (Ezequiel Garcia, Krzysztof Kozlowski, Leonard Crestez,
    MyungJoo Ham, Gaël PORTAY).

    - Add regulators enable and disable to the OPP (operating performance
    points) framework (Kamil Konieczny).

    - Update the OPP framework to support multiple opp-suspend properties
    (Anson Huang).

    - Fix assorted issues and make assorted minor improvements in the OPP
    code (Niklas Cassel, Viresh Kumar, Yue Hu).

    - Clean up the generic power domains (genpd) framework (Ulf Hansson).

    - Clean up assorted pieces of power management code and documentation
    (Akinobu Mita, Amit Kucheria, Chuhong Yuan).

    - Update the pm-graph tool to version 5.5 including multiple fixes
    and improvements (Todd Brandt).

    - Update the cpupower utility (Benjamin Weis, Geert Uytterhoeven,
    Sébastien Szymanski)"

    * tag 'pm-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (126 commits)
    cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available
    cpuidle-haltpoll: do not set an owner to allow modunload
    cpuidle-haltpoll: return -ENODEV on modinit failure
    cpuidle-haltpoll: set haltpoll as preferred governor
    cpuidle: allow governor switch on cpuidle_register_driver()
    PM: runtime: Documentation: add runtime_status ABI document
    pm-graph: make setVal unbuffered again for python2 and python3
    powercap: idle_inject: Use higher resolution for idle injection
    cpuidle: play_idle: Increase the resolution to usec
    cpuidle-haltpoll: vcpu hotplug support
    cpufreq: Add qcs404 to cpufreq-dt-platdev blacklist
    cpufreq: qcom: Add support for qcs404 on nvmem driver
    cpufreq: qcom: Refactor the driver to make it easier to extend
    cpufreq: qcom: Re-organise kryo cpufreq to use it for other nvmem based qcom socs
    dt-bindings: opp: Add qcom-opp bindings with properties needed for CPR
    dt-bindings: opp: qcom-nvmem: Support pstates provided by a power domain
    Documentation: cpufreq: Update policy notifier documentation
    cpufreq: Remove CPUFREQ_ADJUST and CPUFREQ_NOTIFY policy notifier events
    PM / Domains: Verify PM domain type in dev_pm_genpd_set_performance_state()
    PM / Domains: Simplify genpd_lookup_dev()
    ...

    Linus Torvalds
     

17 Sep, 2019

1 commit

  • Pull x86 platform-drivers updates from Andy Shevchenko:

    - ASUS WMI driver got a couple of updates, i.e. support of FAN is fixed
    for recent products and the charge threshold support has been added

    - Two uknown key events for Dell laptops are being ignored now to avoid
    spamming users with harmless messages

    - HP ZBook 17 G5 and ASUS Zenbook UX430UNR got accelerometer support.

    - Intel CherryTrail platforms had a regression with wake up. Now it's
    fixed

    - Intel PMC driver got fixed in order to work nicely in Xen
    environment

    - Intel Speed Select driver provides bucket vs core count relationship.
    Besides that the tools has been updated for better output

    - The PrivacyGuard is enabled on Lenovo ThinkPad laptops

    - Three tablets - Trekstor Primebook C11B 2-in-1, Irbis TW90 and Chuwi
    Surbook Mini - got touchscreen support

    * tag 'platform-drivers-x86-v5.4-1' of git://git.infradead.org/linux-platform-drivers-x86: (53 commits)
    MAINTAINERS: Switch PDx86 subsystem status to Odd Fixes
    platform/x86: asus-wmi: Refactor charge threshold to use the battery hooking API
    platform/x86: asus-wmi: Rename CHARGE_THRESHOLD to RSOC
    platform/x86: asus-wmi: Reorder ASUS_WMI_CHARGE_THRESHOLD
    tools/power/x86/intel-speed-select: Display core count for bucket
    platform/x86: ISST: Allow additional TRL MSRs
    tools/power/x86/intel-speed-select: Fix memory leak
    tools/power/x86/intel-speed-select: Output success/failed for command output
    tools/power/x86/intel-speed-select: Output human readable CPU list
    tools/power/x86/intel-speed-select: Change turbo ratio output to maximum turbo frequency
    tools/power/x86/intel-speed-select: Switch output to MHz
    tools/power/x86/intel-speed-select: Simplify output for turbo-freq and base-freq
    tools/power/x86/intel-speed-select: Fix cpu-count output
    tools/power/x86/intel-speed-select: Fix help option typo
    tools/power/x86/intel-speed-select: Fix package typo
    tools/power/x86/intel-speed-select: Fix a read overflow in isst_set_tdp_level_msr()
    platform/x86: intel_int0002_vgpio: Use device_init_wakeup
    platform/x86: intel_int0002_vgpio: Fix wakeups not working on Cherry Trail
    platform/x86: compal-laptop: Initialize "value" in ec_read_u8()
    platform/x86: touchscreen_dmi: Add info for the Trekstor Primebook C11B 2-in-1
    ...

    Linus Torvalds
     

09 Sep, 2019

1 commit


08 Sep, 2019

12 commits


05 Sep, 2019

1 commit


02 Sep, 2019

1 commit


01 Sep, 2019

10 commits

  • Today is 19.08.31, at least in some parts of the world.

    Signed-off-by: Len Brown

    Len Brown
     
  • Commit 9392bd98bba760be96ee ("tools/power turbostat: Add support for AMD
    Fam 17h (Zen) RAPL") and the commit 3316f99a9f1b68c578c5 ("tools/power
    turbostat: Also read package power on AMD F17h (Zen)") add AMD Fam 17h
    RAPL support.

    Hygon Family 18h(Dhyana) support RAPL in bit 14 of CPUID 0x80000007 EDX,
    and has MSRs RAPL_PWR_UNIT/CORE_ENERGY_STAT/PKG_ENERGY_STAT. So add Hygon
    Dhyana Family 18h support for RAPL.

    Already tested on Hygon multi-node systems and it shows correct per-core
    energy usage and the total package power.

    Signed-off-by: Pu Wen
    Reviewed-by: Calvin Walton
    Signed-off-by: Len Brown

    Pu Wen
     
  • Commit 9392bd98bba760be96ee ("tools/power turbostat: Add support for AMD
    Fam 17h (Zen) RAPL") add a function get_tdp_amd(), the parameter is CPU
    family. But the rapl_probe_amd() function use wrong model parameter.
    Fix the wrong caller parameter of get_tdp_amd() to use family.

    Cc: # v5.1+
    Signed-off-by: Pu Wen
    Reviewed-by: Calvin Walton
    Signed-off-by: Len Brown

    Pu Wen
     
  • In some case C1% will be wrong value, when platform doesn't have MSR for
    C1 residency.

    For example:
    Core CPU CPU%c1
    - - 100.00
    0 0 100.00
    0 2 100.00
    1 1 100.00
    1 3 100.00

    But adding Busy% will fix this
    Core CPU Busy% CPU%c1
    - - 99.77 0.23
    0 0 99.77 0.23
    0 2 99.77 0.23
    1 1 99.77 0.23
    1 3 99.77 0.23

    This issue can be reproduced on most of the recent systems including
    Broadwell, Skylake and later.

    This is because if we don't select Busy% or Avg_MHz or Bzy_MHz then
    mperf value will not be read from MSR, so it will be 0. But this
    is required for C1% calculation when MSR for C1 residency is not present.
    Same is true for C3, C6 and C7 column selection.

    So add another define DO_BIC_READ(), which doesn't depend on user
    column selection and use for mperf, C3, C6 and C7 related counters.
    So when there is no platform support for C1 residency counters,
    we still read these counters, if the CPU has support and user selected
    display of CPU%c1.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Len Brown

    Srinivas Pandruvada
     
  • Turbostat works by taking a snapshot of counters, sleeping, taking another
    snapshot, calculating deltas, and printing out the table.

    The sleep time is controlled via -i option or by user sending a signal or a
    character to stdin. In the latter case, turbostat always adds 1 ms
    sleep before it reads the counters, in order to avoid larger imprecisions
    in the results in prints.

    While the 1 ms delay may be a good idea for a "dumb" user, it is a
    problem for an "aware" user. I do thousands and thousands of measurements
    over a short period of time (like 2ms), and turbostat unconditionally adds
    a 1ms to my interval, so I cannot get what I really need.

    This patch removes the unconditional 1ms sleep. This is an expert user
    tool, after all, and non-experts will unlikely ever use it in the non-fixed
    interval mode anyway, so I think it is OK to remove the 1ms delay.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Len Brown

    Artem Bityutskiy
     
  • Commit '47936f944e78 tools/power turbostat: fix printing on input' make
    a valid fix, but it completely disabled piped stdin support, which is
    a valuable use-case. Indeed, if stdin is a pipe, turbostat won't read
    anything from it, so it becomes impossible to get turbostat output at
    user-defined moments, instead of the regular intervals.

    There is no reason why this should works for terminals, but not for
    pipes. This patch improves the situation. Instead of ignoring pipes, we
    read data from them but gracefully handle the EOF case.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Len Brown

    Artem Bityutskiy
     
  • This enables turbostat utility on Ice Lake NNPI SoC.

    Link: https://lkml.org/lkml/2019/6/5/1034
    Signed-off-by: Rajneesh Bhardwaj
    Signed-off-by: Len Brown

    Rajneesh Bhardwaj
     
  • Perhaps if this more descriptive name had been used,
    then we wouldn't have had the HSW ULT vs HSW CORE bug,
    fixed by the previous commit.

    Signed-off-by: Len Brown

    Len Brown
     
  • turbostat: cpu0: msr offset 0x630 read failed: Input/output error

    because Haswell Core does not have C8-C10.

    Output C8-C10 only on Haswell ULT.

    Fixes: f5a4c76ad7de ("tools/power turbostat: consolidate duplicate model numbers")

    Reported-by: Prarit Bhargava
    Suggested-by: Kosuke Tatsukawa
    Signed-off-by: Len Brown

    Len Brown
     
  • Jacobsville behaves like Denverton.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui