aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-12-01Merge tag 'platform-drivers-x86-v5.5-1' of git://git.infradead.org/linux-platform-drivers-x86Linus Torvalds4-261/+1090
Pull x86 platform driver updates from Andy Shevchenko: - New bootctl driver for Mellanox BlueField SoC. - New driver to support System76 laptops. - Temperature monitoring and fan control on Acer Aspire 7551 is now supported. - Previously the Huawei driver handled only hotkeys. After the conversion to WMI it has been expanded to support newer laptop models. - Big refactoring of intel-speed-select tools allows to use it on Intel CascadeLake-N systems. - Touchscreen support for ezpad 6 m4 and Schneider SCT101CTM tablets - Miscellaneous clean ups and fixes here and there. * tag 'platform-drivers-x86-v5.5-1' of git://git.infradead.org/linux-platform-drivers-x86: (59 commits) platform/x86: hp-wmi: Fix ACPI errors caused by passing 0 as input size platform/x86: hp-wmi: Fix ACPI errors caused by too small buffer platform/x86: intel_pmc_core: Add Comet Lake (CML) platform support to intel_pmc_core driver platform/x86: intel_pmc_core: Fix the SoC naming inconsistency platform/mellanox: Fix Kconfig indentation tools/power/x86/intel-speed-select: Display TRL buckets for just base config level tools/power/x86/intel-speed-select: Ignore missing config level platform/x86: touchscreen_dmi: Add info for the ezpad 6 m4 tablet tools/power/x86/intel-speed-select: Increment version tools/power/x86/intel-speed-select: Use core count for base-freq mask tools/power/x86/intel-speed-select: Support platform with limited Intel(R) Speed Select tools/power/x86/intel-speed-select: Use Frequency weight for CLOS tools/power/x86/intel-speed-select: Make CLOS frequency in MHz tools/power/x86/intel-speed-select: Use mailbox for CLOS_PM_QOS_CONFIG tools/power/x86/intel-speed-select: Auto mode for CLX tools/power/x86/intel-speed-select: Correct CLX-N frequency units tools/power/x86/intel-speed-select: Change display of "avx" to "avx2" tools/power/x86/intel-speed-select: Extend command set for perf-profile Add touchscreen platform data for the Schneider SCT101CTM tablet platform/x86: intel_int0002_vgpio: Pass irqchip when adding gpiochip ...
2019-11-21tools/power/x86/intel-speed-select: Display TRL buckets for just base config levelSrinivas Pandruvada1-0/+1
When only base config level is present, this tool is displaying TRL (Turbo-ratio-limits) by reading legacy MSR. In this case, also present core count for TRL by reading MSR 0x1AE. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-21tools/power/x86/intel-speed-select: Ignore missing config levelSrinivas Pandruvada2-5/+6
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 <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Increment versionSrinivas Pandruvada1-1/+1
Since the tool now adds support for another Intel SST implementation, increment version number. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Use core count for base-freq maskSrinivas Pandruvada3-3/+28
Some firmware implementation gives error when a command is sent get mask for core count 32-61. So use core count to decide. But there is no function to get core count. So introduce one function to get core count. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Support platform with limited Intel(R) Speed SelectSrinivas Pandruvada4-60/+113
There are some platforms, where there limited support of Intel(R) SST features. Here perf-profile has only one base configuration and limited support of commands. But still has support for discovery of base-freq and turbo-freq features. So it is important to show minimum features to use base-freq and turbo-freq features. Here the change are: - When there is no support of CONFIG_TDP_GET_LEVELS_INFO, then instead of treating this as fatal error, treat this with number of config levels = 0, that means only base level 0 is present. - There is no support of mail box commands to get base frequencies or turbo frequencies. Here present base frequency by reading cpufreq base freq and turbo frequency by reading MSR 0x1AD. - Don't display any field, which has value == 0. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Use Frequency weight for CLOSSrinivas Pandruvada1-6/+6
Use different frequency weights for CLOS 0 and and CLOS1-3, to define relative priority for power budgeting. This will be used for --auto mode to enable base-freq and turbo-freq feature. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Make CLOS frequency in MHzSrinivas Pandruvada2-7/+10
To be consistant with the other frequency units, change the CLOS unit to MHz instead of ratios. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Use mailbox for CLOS_PM_QOS_CONFIGSrinivas Pandruvada1-6/+0
Use mailbox to read/write CLOS_PM_QOS_CONFIG instead of read/write to MMIO offset. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Auto mode for CLXSrinivas Pandruvada1-12/+100
There is an expectation in the CLX platform for SST base-freq feature that Scaling min frequency be different for high and low priority cores. This is the way the firmware will understand the priority. So this change will look at high priority and low priority cores, and set scaling_min_freq to P1High for high priority cores and P1Low to low priority cores. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Correct CLX-N frequency unitsSrinivas Pandruvada1-3/+3
In CLX_N base_frequency is read from cpufreq sysfs, where units are in KHz. The internal units in the code matches the real ratios which are in 100MHz scale. So when storing units for CLX-N frequencies, convert to 100MHz scale. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Change display of "avx" to "avx2"Srinivas Pandruvada1-1/+1
Make the avx level display consistent. Except for "turbo-ratio-limits-avx", everywhere else it is avx2. So change "turbo-ratio-limits-avx" to "turbo-ratio-limits-avx2". Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-07tools/power/x86/intel-speed-select: Extend command set for perf-profileSrinivas Pandruvada2-1/+105
Add support for uncore P0, uncore P1, P1 for base and AVX levels and memory frequency. These commands are optional, so continue on failure. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-11-05cpupower: ToDo: Update ToDo with ideas for per_cpu_schedule handlingJanakarajan Natarajan1-0/+14
Based on Thomas Renninger's feedback/ideas. Re-structure the code to better handle the per_cpu_schedule mechanism which was introduced when adding support for AMD Zen based processors. Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-11-05cpupower: mperf_monitor: Update cpupower to use the RDPRU instructionJanakarajan Natarajan3-0/+25
AMD Zen 2 introduces the RDPRU instruction which can be used to access some processor registers which are typically only accessible in privilege level 0. ECX specifies the register to read and EDX:EAX will contain the value read. ECX: 0 - Register MPERF 1 - Register APERF This has the added advantage of not having to use the msr module, since the userspace to kernel transitions which occur during each read_msr() might cause APERF and MPERF to go out of sync. Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-11-05cpupower: mperf_monitor: Introduce per_cpu_schedule flagJanakarajan Natarajan2-10/+33
The per_cpu_schedule flag is used to move the cpupower process to the cpu on which we are looking to read the APERF/MPERF registers. This prevents IPIs from being generated by read_msr()s as we are already on the cpu of interest. Ex: If cpupower is running on CPU 0 and we execute read_msr(20, MSR_APERF, val) then, read_msr(20, MSR_MPERF, val) the msr module will generate an IPI from CPU 0 to CPU 20 to query for the MSR_APERF and then the MSR_MPERF in separate IPIs. This delay, caused by IPI latency, between reading the APERF and MPERF registers may cause both of them to go out of sync. The use of the per_cpu_schedule flag reduces the probability of this from happening. It comes at the cost of a negligible increase in cpu consumption caused by the migration of cpupower across each of the cpus of the system. Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-11-05cpupower: Move needs_root variable into a sub-structJanakarajan Natarajan8-8/+10
Move the needs_root variable into a sub-struct. This is in preparation for adding a new flag for cpuidle_monitor. Update all uses of the needs_root variable to reflect this change. Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-11-04cpupower : Handle set and info subcommands correctlyAbhishek Goel2-0/+18
Cpupower tool has set and info options which are being used only by x86 machines. This patch removes support for these two subcommands from cpupower utility for POWER. Thus, these two subcommands will now be available only for intel. This removes the ambiguous error message while using set option in case of using non-intel systems. Without this patch on a POWER system: root@ubuntu:~# cpupower info System does not support Intel's performance bias setting root@ubuntu:~# cpupower set -b 10 Error setting perf-bias value on CPU With this patch on a POWER box: root@ubuntu:~# cpupower info Subcommand not supported on POWER Same result for set subcommand. This patch does not affect results on a intel box. Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com> Acked-by: Thomas Renninger <trenn@suse.de> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-10-15tools/power/x86/intel-speed-select: Implement base-freq commands on CascadeLake-NPrarit Bhargava1-4/+47
Add functionality for base-freq info|enable|disable info on CascadeLake-N. Sample output: Intel(R) Speed Select Technology Executing on CPU model:85[0x55] package-0 die-0 cpu-0 speed-select-base-freq high-priority-base-frequency(MHz):2700000 high-priority-cpu-mask:00000000,0000e8c0 high-priority-cpu-list:6,7,11,13,14,15 low-priority-base-frequency(MHz):2100000 package-1 die-0 cpu-20 speed-select-base-freq high-priority-base-frequency(MHz):2700000 high-priority-cpu-mask:0000000e,8c000000 high-priority-cpu-list:26,27,31,33,34,35 low-priority-base-frequency(MHz):2100000 The enable command always returns success, and the disable command always returns failed because SST-BF cannot be enabled or disabled from the OS on CascadeLake-N. Enable command also have support for --auto|-a option, which sets cpufreq scaling_min to max, so that the high priority base frequency can be the required minimum for high priority cores. Disable command with -a/--auto option reset the setting back to the min frequency. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Implement 'perf-profile info' on CascadeLake-NPrarit Bhargava3-7/+173
Add functionality for "perf-profile info" on CascadeLake-N. Sample output: intel-speed-select perf-profile info Intel(R) Speed Select Technology Executing on CPU model:85[0x55] package-0 die-0 cpu-0 perf-profile-level-0 cpu-count:20 enable-cpu-mask:00000000,000fffff enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 thermal-design-power-ratio:23 base-frequency(MHz):2300 speed-select-turbo-freq:unsupported speed-select-base-freq:enabled speed-select-base-freq high-priority-base-frequency(MHz):2700000 high-priority-cpu-mask:00000000,0000e8c0 high-priority-cpu-list:6,7,11,13,14,15 low-priority-base-frequency(MHz):2100000 package-1 die-0 cpu-20 perf-profile-level-0 cpu-count:20 enable-cpu-mask:000000ff,fff00000 enable-cpu-list:20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39 thermal-design-power-ratio:23 base-frequency(MHz):2300 speed-select-turbo-freq:unsupported speed-select-base-freq:enabled speed-select-base-freq high-priority-base-frequency(MHz):2700000 high-priority-cpu-mask:0000000e,8c000000 high-priority-cpu-list:26,27,31,33,34,35 low-priority-base-frequency(MHz):2100000 Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Implement CascadeLake-N help and command functions structuresPrarit Bhargava1-10/+27
CascadeLake-N only supports SST-BF and needs some of the perf-profile commands, and the base-freq commands. Add help functions, and create an empty command structures (the functions will be implemented later in this patchset). Call these functions when running on CascadeLake-N. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Add check for CascadeLake-N modelsPrarit Bhargava1-2/+41
Three CascadeLake-N models (6252N, 6230N, and 5218N) have SST-PBF support. Return an error if the CascadeLake processor is not one of these specific models. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Make process_command genericPrarit Bhargava1-9/+11
Make the process_command take any help command and command list. This will make it easier to help commands and a command list for CascadeLake-N. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Add int argument to command functionsPrarit Bhargava1-127/+86
The current code structure has similar but separate command functions for the enable and disable operations. This can be improved by adding an int argument to the command function structure, and interpreting 1 as enable and 0 as disable. This change results in the removal of the disable command functions. Add int argument to the command function structure. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Refuse to disable core-power when getting usedSrinivas Pandruvada1-0/+21
The turbo-freq feature is dependent on the core-power feature. If the core-power feature is disabled while the turbo-freq feature is enabled, this will break the turbo-freq feature. This is a firmware limitation, where they can't return error under this scenario. So when trying to disable core-power, make sure that the turbo-freq feature is not enabled. If it enabled, return error if user is trying to disable the core-power feature. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Turbo-freq feature auto modeSrinivas Pandruvada1-28/+124
Introduce --auto|-a option to turbo-freq enable feature, so that it does in one step for users who are OK by setting all passed target cores as high priority and set in CLOS 0 and remaining in CLOS 3. In this way, users don't have to take multiple steps to enable turbo-freq feature. For users who want more fine grain control, they can always use core-power feature to set custom CLOS configuration and assignment. While here also print the error to output when clos configuration fails. For example intel-speed-select -c 0-4 turbo-freq enable --auto The above command will enable turbo-freq and core-power feature. Also mark CPU 0 to CPU 4 as high priority. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Base-freq feature auto modeSrinivas Pandruvada1-9/+223
Introduce --auto|-a option to base-freq enable feature, so that it does in one step for users who are OK by setting all cores with higher base frequency to be set in CLOS 0 and remaining in CLOS 3. This option also sets corresponding clos.min to CLOS 0 and CLOS3. In this way, users don't have to take multiple steps to enable base-freq feature. For users who want more fine grain control, they can always use core-power feature to set custom CLOS configuration and assignment. Also adjust cpufreq/scaling_min_freq for higher and lower priority cores. For example user can use: intel-speed-select base-freq enable --auto Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-15tools/power/x86/intel-speed-select: Remove warning for unused resultSrinivas Pandruvada1-3/+6
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 <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-01tools/power/cpupower: Fix initializer override in hsw_ext_cstatesNathan Chancellor1-1/+0
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 <natechancellor@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-09-24Merge tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86Linus Torvalds4-15/+213
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
2019-09-19tools/power/x86/intel-speed-select: Fix perf-profile command outputSrinivas Pandruvada3-3/+24
commit "c016ae8f9fa04d361efc8629de49ad3af12b5262 "tools/power/x86/intel-speed-select: Output success/failed for command output" introduced a regression in perf-profile outputs. With this the result field is changed to string interpreting every non zero value as errors. But these commands display on zero (>0) result. For example before this commit the display was: package-1 die-0 cpu-14 get-config-levels:4 Here the get-config-levels is interpreted as error and displayed as error with the above commit: package-1 die-0 cpu-14 get-config-levels:failed(error 4) Fix this issue by not using isst_display_result() to display such results, but define a new function which formats this data and prints. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-19tools/power/x86/intel-speed-select: Extend core-power command setSrinivas Pandruvada4-1/+95
Add additional command to get the clos enable and priority type. The current info option is actually dumping per clos QOS config, so name the command appropriately to get-config. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-19tools/power/x86/intel-speed-select: Fix some debug printsSrinivas Pandruvada1-2/+1
Fix wrong debug print for cpu, which is displayed as CLOS. Also avoid printing clos id, when user is specify clos as parameter. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-19tools/power/x86/intel-speed-select: Format get-assoc informationSrinivas Pandruvada3-6/+33
Format the get-assoc command output consistant with other commands. For example: Intel(R) Speed Select Technology Executing on CPU model:142[0x8e] package-0 die-0 cpu-0 get-assoc clos:0 Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-19tools/power/x86/intel-speed-select: Allow online/offline based on tdpSrinivas Pandruvada2-4/+58
Using enable core mask, do online offline CPUs. There is a new option --online|-o for set-config-level. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-19tools/power/x86/intel-speed-select: Fix high priority core mask over countYouquan Song1-0/+3
If the CPU package has the less logical CPU than topo_max_cpus, but un-present CPU's punit_cpu_core will be initiated to 0 and they will be count to core 0 Like below, there are only 10 high priority cores (20 logical CPUs) in the CPU package, but it count to 27 logic CPUs. ./intel-speed-select base-freq info -l 0 | grep mask high-priority-cpu-mask:7f000179,f000179f With the fix patch: ./intel-speed-select base-freq info -l 0 high-priority-cpu-mask:00000179,f000179f Signed-off-by: Youquan Song <youquan.song@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-17Merge tag 'acpi-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds1-2/+8
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 ...
2019-09-17Merge tag 'pm-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds8-472/+581
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() ...
2019-09-16Merge tag 'platform-drivers-x86-v5.4-1' of git://git.infradead.org/linux-platform-drivers-x86Linus Torvalds4-48/+126
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 ...
2019-09-09tools/power/x86/intel-speed-select: Display core count for bucketSrinivas Pandruvada3-3/+26
Read the bucket and core count relationship via MSR and display when displaying turbo ratio limits. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07Merge back earlier power management tools updates for v5.4.Rafael J. Wysocki4-300/+391
2019-09-07Merge tag 'linux-cpupower-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linuxRafael J. Wysocki4-172/+190
Pull cpupower utility updates for v5.4 from Shuah Khan: "This cpupower update for Linux 5.4-rc1 consists of bug fixes and German translation updates from Benjamin Weis." * tag 'linux-cpupower-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: update German translation tools/power/cpupower: fix 64bit detection when cross-compiling cpupower: Add missing newline at end of file
2019-09-07tools/power/x86/intel-speed-select: Fix memory leakPrarit Bhargava1-5/+11
cpumasks are allocated by calling the alloc_cpu_mask() function and are never free'd. They should be free'd after the commands have run. Fix the memory leaks by calling free_cpu_set(). Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Output success/failed for command outputPrarit Bhargava2-2/+4
Command output has confusing data, returning "0" on success. For example |# ./intel-speed-select -c 14 turbo-freq enable Intel(R) Speed Select Technology Executing on CPU model:106[0x6a] package-1 die-0 cpu-14 turbo-freq enable:0 To avoid confusion change the command output to 'success' or 'failed'. v2: Remove help output line. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Output human readable CPU listPrarit Bhargava1-0/+39
The intel-speed-select tool currently only outputs a hexidecimal CPU mask, which requires translation for use with kernel parameters such as isolcpus. Along with the CPU mask, output a human readable CPU list. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Change turbo ratio output to maximum turbo frequencyPrarit Bhargava1-6/+12
The intel-speed-select tool currently outputs the turbo ratio for every bucket. Make the output more user-friendly by changing the output to the maximum turbo frequency. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Switch output to MHzPrarit Bhargava1-10/+10
These features are introduced on new processors that will never operate in the KHz range. Save some zeros and switch the output to MHz. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Simplify output for turbo-freq and base-freqPrarit Bhargava1-14/+16
The current output of 'intel-speed-select -c 53 perf-profile info -l 0' shows speed-select-turbo-freq-support:1 speed-select-base-freq-support:1 speed-select-base-freq-enabled:0 speed-select-turbo-freq-enabled:0 Simplify the output to single lines displaying status of disabled, enabled, and unsupported. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Fix cpu-count outputPrarit Bhargava1-1/+1
I have a system with 28 threads/socket but intel-speed-select reports a cpu-count of 29. Fix an off-by-one error in the cpu_count() function. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-09-07tools/power/x86/intel-speed-select: Fix help option typoPrarit Bhargava1-1/+1
Help is -h, not --h. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: David Arcari <darcari@redhat.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>