Commit graph

1110 commits

Author SHA1 Message Date
Huang Rui
8382dce5e4 cpupower: Add "perf" option to print AMD P-State information
Add "-c --perf" option in cpupower-frequency-info to get the performance
and frequency values for AMD P-State.

Commit message amended:
Shuah Khan <skhan@linuxfoundation.org>

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-23 17:46:21 -07:00
Huang Rui
d8363e2917 cpupower: Add function to print AMD P-State performance capabilities
AMD P-State kernel module is using the fine grain frequency instead of
acpi hardware pstate. So add a function to print performance and
frequency values.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:37:12 -07:00
Huang Rui
35fdf42d90 cpupower: Move print_speed function into misc helper
The print_speed can be as a common function, and expose it into misc
helper header. Then it can be used on other helper files as well.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:37:07 -07:00
Huang Rui
bf9801baa8 cpupower: Enable boost state support for AMD P-State module
The legacy ACPI hardware P-States function has 3 P-States on ACPI table,
the CPU frequency only can be switched between the 3 P-States. While the
processor supports the boost state, it will have another boost state
that the frequency can be higher than P0 state, and the state can be
decoded by the function of decode_pstates() and read by
amd_pci_get_num_boost_states().

However, the new AMD P-State function is different than legacy ACPI
hardware P-State on AMD processors. That has a finer grain frequency
range between the highest and lowest frequency. And boost frequency is
actually the frequency which is mapped on highest performance ratio. The
similar previous P0 frequency is mapped on nominal performance ratio.
If the highest performance on the processor is higher than nominal
performance, then we think the current processor supports the boost
state. And it uses amd_pstate_boost_init() to initialize boost for AMD
P-State function.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:37:01 -07:00
Huang Rui
33e43f3636 cpupower: Add AMD P-State sysfs definition and access helper
Introduce the marco definitions and access helper function for
AMD P-State sysfs interfaces such as each performance goals and frequency
levels in amd helper file. They will be used to read the sysfs attribute
from AMD P-State cpufreq driver for cpupower utilities.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:36:55 -07:00
Huang Rui
4a06806e5d cpupower: Introduce ACPI CPPC library
Kernel ACPI subsytem introduced the sysfs attributes for acpi cppc
library in below path:

/sys/devices/system/cpu/cpuX/acpi_cppc/

And these attributes will be used for AMD P-State driver to provide some
performance and frequency values.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:36:50 -07:00
Huang Rui
e3ede97657 cpupower: Add the function to get the sysfs value from specific table
Expose the helper into cpufreq header, then cpufreq driver can use this
function to get the sysfs value if it has any specific sysfs interfaces.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:36:44 -07:00
Huang Rui
083792f368 cpupower: Initial AMD P-State capability
If kernel starts the AMD P-State module, the cpupower will initial the
capability flag as CPUPOWER_CAP_AMD_PSTATE. And once AMD P-State
capability is set, it won't need to set legacy ACPI relative
capabilities anymore.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:36:39 -07:00
Huang Rui
46c273a095 cpupower: Add the function to check AMD P-State enabled
The processor with AMD P-State function also supports legacy ACPI
hardware P-States feature as well. Once driver sets AMD P-State eanbled,
the processor will respond the finer grain AMD P-State feature instead of
legacy ACPI P-States. So it introduces the cpupower_amd_pstate_enabled()
to check whether the current kernel enables AMD P-State or AMD CPUFreq
module.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:36:32 -07:00
Huang Rui
c8be60c120 cpupower: Add AMD P-State capability flag
Add AMD P-State capability flag in cpupower to indicate AMD new P-State
kernel module support on Ryzen processors.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-02-22 18:36:16 -07:00
Srinivas Pandruvada
f3874e96fa tools/power/x86/intel-speed-select: v1.12 release
This version allows out of band SST support, where some remote agent
changes SST profiles via some Board Management Controller.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2022-02-17 10:57:38 -08:00
Srinivas Pandruvada
7d440da009 tools/power/x86/intel-speed-select: HFI support
Read HFI (Hardware Feedback Interface) events to process config level
changes in oob mode. When HFI is supported there is no need for polling
to check config level change.

Subscribe to Linux thermal netlink messages and process message:
THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE.
This message contains cpu number, performance and energy efficiency.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2022-02-17 10:57:31 -08:00
Srinivas Pandruvada
7fd786dfbd tools/power/x86/intel-speed-select: OOB daemon mode
It is possible that some out of band agent changed config level. In this
case CPUs need to be online/offline to support this config change. Add
a command line option --oob, so that this tool can run as daemon and poll
for config level change and take action. The poll interval is configurable
in seconds using config option --poll-interval.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2022-02-17 10:57:25 -08:00
Masahiro Yamada
5c8166419a kbuild: replace $(if A,A,B) with $(or A,B)
$(or ...) is available since GNU Make 3.81, and useful to shorten the
code in some places.

Covert as follows:

  $(if A,A,B)  -->  $(or A,B)

This patch also converts:

  $(if A, A, B) --> $(or A, B)

Strictly speaking, the latter is not an equivalent conversion because
GNU Make keeps spaces after commas; if A is not empty, $(if A, A, B)
expands to " A", while $(or A, B) expands to "A".

Anyway, preceding spaces are not significant in the code hunks I touched.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2022-02-15 12:25:56 +09:00
ozkanonur
101025ff8e tools/power/cpupower/{ToDo => TODO}: Rename the todo file
Renamed the to-do file to 'TODO' instead of 'ToDo' to
comply with the naming standard.

Signed-off-by: ozkanonur <onurozkan.dev@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-01-24 09:07:11 -07:00
Andreas Rammhold
9d7c485065 tools: cpupower: fix typo in cpupower-idle-set(1) manpage
The tools name was wrong in the SYNTAX section of the manpage it should
read "idle-set" instead of "idle-info".

Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-01-24 09:07:11 -07:00
Linus Torvalds
6a8d7fbf1c More ACPI updates for 5.17-rc1
- Add support for the the Platform Firmware Runtime Update and
    Telemetry (PFRUT) interface based on ACPI to allow certain pieces
    of the platform firmware to be updated without restarting the
    system and to provide a mechanism for collecting platform firmware
    telemetry data (Chen Yu, Dan Carpenter, Yang Yingliang).
 
  - Ignore E820 reservations covering PCI host bridge windows on
    sufficiently recent x86 systems to avoid issues with allocating
    PCI BARs on systems where the E820 reservations cover the entire
    PCI host bridge memory window returned by the _CRS object in the
    system's ACPI tables (Hans de Goede).
 
  - Fix and clean up acpi_scan_init() (Rafael Wysocki).
 
  - Add more sanity checking to ACPI SPCR tables parsing (Mark
    Langsdorf).
 
  - Fix up ACPI APD (AMD Soc) driver initialization (Jiasheng Jiang).
 
  - Drop unnecessary "static" from the ACPI PCC address space handling
    driver added recently (kernel test robot).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmHlrTwSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxQ00QAI3CYIyM+TtgxOkun/DQdHEtLOXxVsQG
 V9p9zNa0xFjQY2fE3wwa4r03fg/AfM+qqOdgZDg2QnUlHVx+ZqzNlxMVnYz2QK3P
 lhZUJ2sX0ziAYC5AJFP44mcU4yAFgqGgUgv6VUGdoG2khngKA5ds1qYPqdNMigGr
 lfAoro2tVpKL66czvglBM6Af0RIrZvmh5dpwtja1tfquAy2qLOLfwBIafdFjrTS8
 nVckdBNTgd12BxMaTlEIr8ZKX9Qe/YI0s+avzLc/lMI8gBlG0ZkGczDHxjLE48iE
 ZHwttNJm6PKR6Sj5AwXjswkW0n0aqVz1BbeDgdeL9zB6WbH9+EQaQFqYIc1pNyGG
 f67c8YwGFPMGx3BKdTksFESKb6DZifc1zbye3OKLxQquaWmufmhmQDVuXZzcfRO3
 dkhIngX/sieEWwj1P1WdaDO4vC2zG2devJhxu3WGV8HCAHsZUoBduUwk+YZUVyp3
 y+imobCCGEKZnHxtqJg7+VnQnH8ZTHFgOyqGa0boI5M8Dkae+qCcPCRDxHNa7L+7
 Hb1eCH5RbB4MKQj/dmf01vpy/Q3gZOMHOoOHyMWp+IveculjcCxOIVZN0YQizj+3
 Nw+1dcJLM6iR21f63zOQkoOhoFchp88IDc1PJtJnZOvI49Q9YB/2HKQdBGn292ZL
 +e3TWGpsfaZW
 =I4UB
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more ACPI updates from Rafael Wysocki:
 "The most significant item here is the Platform Firmware Runtime Update
  and Telemetry (PFRUT) support designed to allow certain pieces of the
  platform firmware to be updated on the fly, among other things.

  Also important is the e820 handling change on x86 that should work
  around PCI BAR allocation issues on some systems shipping since 2019.

  The rest is just a handful of assorted fixes and cleanups on top of
  the ACPI material merged previously.

  Specifics:

   - Add support for the the Platform Firmware Runtime Update and
     Telemetry (PFRUT) interface based on ACPI to allow certain pieces
     of the platform firmware to be updated without restarting the
     system and to provide a mechanism for collecting platform firmware
     telemetry data (Chen Yu, Dan Carpenter, Yang Yingliang).

   - Ignore E820 reservations covering PCI host bridge windows on
     sufficiently recent x86 systems to avoid issues with allocating PCI
     BARs on systems where the E820 reservations cover the entire PCI
     host bridge memory window returned by the _CRS object in the
     system's ACPI tables (Hans de Goede).

   - Fix and clean up acpi_scan_init() (Rafael Wysocki).

   - Add more sanity checking to ACPI SPCR tables parsing (Mark
     Langsdorf).

   - Fix up ACPI APD (AMD Soc) driver initialization (Jiasheng Jiang).

   - Drop unnecessary "static" from the ACPI PCC address space handling
     driver added recently (kernel test robot)"

* tag 'acpi-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: PCC: pcc_ctx can be static
  ACPI: scan: Rename label in acpi_scan_init()
  ACPI: scan: Simplify initialization of power and sleep buttons
  ACPI: scan: Change acpi_scan_init() return value type to void
  ACPI: SPCR: check if table->serial_port.access_width is too wide
  ACPI: APD: Check for NULL pointer after calling devm_ioremap()
  x86/PCI: Ignore E820 reservations for bridge windows on newer systems
  ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl()
  ACPI: pfr_update: Fix return value check in pfru_write()
  ACPI: tools: Introduce utility for firmware updates/telemetry
  ACPI: Introduce Platform Firmware Runtime Telemetry driver
  ACPI: Introduce Platform Firmware Runtime Update device driver
  efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures
2022-01-18 08:51:51 +02:00
Linus Torvalds
347708875a platform-drivers-x86 for v5.17-1
Highlights:
  - new drivers:
    - asus-tf103c-dock
    - intel_crystal_cove_charger
    - lenovo-yogabook-wmi
    - simatic-ipc platform-code + led driver + watchdog driver
    - x86-android-tablets (kernel module to workaround DSDT bugs on these)
  - amd-pmc:
    - bug-fixes
    - smar trace buffer support
  - asus-wmi: support for custom fan curves
  - int3472 (camera info ACPI object for Intel IPU3/SkyCam cameras):
    - ACPI core + int3472 changes to delay enumeration of camera sensor I2C
      clients until the PMIC for the sensor has been fully probed
    - Add support for board data (DSDT info is incomplete) for setting up
      the tps68470 PMIC used on some boards with these cameras
    - Add board data for the Microsoft Surface Go (original, v2 and v3)
  - thinkpad_acpi:
    - various cleanups
    - support for forced battery discharging (for battery calibration)
    - support to inhibit battery charging
    - this includes power_supply core changes to add new APIs for this
  - think_lmi: enhanced BIOS password support
  - various other small fixes and hardware-id additions
 
 The following is an automated git shortlog grouped by driver:
 
 ACPI:
  -  delay enumeration of devices with a _DEP pointing to an INT3472 device
 
 Add Asus TF103C dock driver:
  - Add Asus TF103C dock driver
 
 Add intel_crystal_cove_charger driver:
  - Add intel_crystal_cove_charger driver
 
 Documentation:
  -  syfs-class-firmware-attributes: Lenovo Opcode support
 
 Merge tag 'platform-drivers-x86-int3472-1' into review-hans:
  - Merge tag 'platform-drivers-x86-int3472-1' into review-hans
 
 amd-pmc:
  -  only use callbacks for suspend
  -  Add support for AMD Smart Trace Buffer
  -  Simplify error handling and store the pci_dev in amd_pmc_dev structure
  -  Fix s2idle failures on certain AMD laptops
  -  Make CONFIG_AMD_PMC depend on RTC_CLASS
 
 apple-gmux:
  -  use resource_size() with res
 
 asus-wmi:
  -  Reshuffle headers for better maintenance
  -  Split MODULE_AUTHOR() on per author basis
  -  Join string literals back
  -  remove unneeded semicolon
  -  Add support for custom fan curves
 
 dell-wmi-descriptor:
  -  disable by default
 
 hp_accel:
  -  Use SIMPLE_DEV_PM_OPS() for PM ops
  -  Fix an error handling path in 'lis3lv02d_probe()'
 
 i2c:
  -  acpi: Add i2c_acpi_new_device_by_fwnode() function
  -  acpi: Use acpi_dev_ready_for_enumeration() helper
 
 int3472:
  -  Add board data for Surface Go 3
  -  Deal with probe ordering issues
  -  Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell
  -  Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell
  -  Add get_sensor_adev_and_name() helper
  -  Split into 2 drivers
 
 intel-uncore-frequency:
  -  use default_groups in kobj_type
 
 intel_pmc_core:
  -  fix memleak on registration failure
 
 leds:
  -  simatic-ipc-leds: add new driver for Siemens Industial PCs
 
 lenovo-yogabook-wmi:
  -  Add support for hall sensor on the back
  -  Add driver for Lenovo Yoga Book
 
 lg-laptop:
  -  Recognize more models
 
 platform:
  -  surface: Propagate ACPI Dependency
 
 platform/mellanox:
  -  mlxbf-pmc: Fix an IS_ERR() vs NULL bug in mlxbf_pmc_map_counters
  -  mlxreg-lc: fix error code in mlxreg_lc_create_static_devices()
 
 platform/surface:
  -  aggregator_registry: Rename device registration function
  -  aggregator_registry: Use generic client removal function
  -  aggregator: Make client device removal more generic
 
 platform/x86/intel:
  -  Remove X86_PLATFORM_DRIVERS_INTEL
  -  hid: add quirk to support Surface Go 3
 
 platform_data:
  -  Add linux/platform_data/tps68470.h file
 
 pmc_atom:
  -  improve critclk_systems matching for Siemens PCs
 
 power:
  -  supply: Provide stubs for charge_behaviour helpers
  -  supply: fix charge_behaviour attribute initialization
  -  supply: add helpers for charge_behaviour sysfs
  -  supply: add charge_behaviour attributes
 
 samsung-laptop:
  -  Fix typo in a comment
 
 simatic-ipc:
  -  add main driver for Siemens devices
 
 system76_acpi:
  -  Guard System76 EC specific functionality
 
 think-lmi:
  -  Prevent underflow in index_store()
  -  Simplify tlmi_analyze() error handling a bit
  -  Move kobject_init() call into tlmi_create_auth()
  -  Opcode support
  -  Abort probe on analyze failure
 
 thinkpad_acpi:
  -  support inhibit-charge
  -  support force-discharge
  -  Add lid_logo_dot to the list of safe LEDs
  -  Add LED_RETAIN_AT_SHUTDOWN to led_class_devs
  -  Remove unused sensors_pdev_attrs_registered flag
  -  Fix the hwmon sysfs-attr showing up in the wrong place
  -  tpacpi_attr_group contains driver attributes not device attrs
  -  Register tpacpi_pdriver after subdriver init
  -  Restore missing hotkey_tablet_mode and hotkey_radio_sw sysfs-attr
  -  Fix thermal_temp_input_attr sorting
  -  Remove "goto err_exit" from hotkey_init()
  -  Properly indent code in tpacpi_dytc_profile_init()
  -  Cleanup dytc_profile_available
  -  Simplify dytc_version handling
  -  Make *_init() functions return -ENODEV instead of 1
  -  Accept ibm_init_struct.init() returning -ENODEV
  -  Convert platform driver to use dev_groups
  -  fix documentation for adaptive keyboard
  -  Fix WWAN device disabled issue after S3 deep
  -  Add support for dual fan control
 
 tools/power/x86/intel-speed-select:
  -  v1.11 release
  -  Update max frequency
 
 touchscreen_dmi:
  -  Remove the Glavey TM800A550L entry
  -  Enable pen support on the Chuwi Hi10 Plus and Pro
  -  Correct min/max values for Chuwi Hi10 Pro (CWI529) tablet
  -  Add TrekStor SurfTab duo W1 touchscreen info
 
 watchdog:
  -  simatic-ipc-wdt: add new driver for Siemens Industrial PCs
 
 wmi:
  -  Add no_notify_data flag to struct wmi_driver
  -  Fix driver->notify() vs ->probe() race
  -  Replace read_takes_no_args with a flags field
 
 x86-android-tablets:
  -  Fix GPIO lookup leak on error-exit
  -  Add TM800A550L data
  -  Add Asus MeMO Pad 7 ME176C data
  -  Add Asus TF103C data
  -  Add support for preloading modules
  -  Add support for registering GPIO lookup tables
  -  Add support for instantiating serdevs
  -  Add support for instantiating platform-devs
  -  Add support for PMIC interrupts
  -  Don't return -EPROBE_DEFER from a non probe() function
  -  New driver for x86 Android tablets
 
 x86/platform/uv:
  -  use default_groups in kobj_type
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmHcCbkUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9y3yAf/Xo8TWsnF7XoS3pNCqRcObIulHy6u
 9AOD4gTb0p9LiAd8WN75UsQDew0Rib+UDTS3s6g9l71fMzpTFOD4IaBPrVAmIxpu
 Qs9raFTH67CFid/V3DCwAjPQYxxp5LBGvYJ4oy3OmaYHieV9jdsvNLISlpi/V8wR
 PmbmYtiK5TPZwRT+mknq89D+LynP2NYkvoqRitmB7MrAvxY3c0ssrex6dXMrdgqK
 ehRtfz/ER8xQ03APIzHG+ec73LZsHCMDDG7teas4tiMlMaWGgRO2I8GAudjuPEoy
 mBTSb3ABuEud8LTMgjB+trM2w9IAoFE0L6/OrKE5dK1tPdaLxvCuuSVheQ==
 =tmPR
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:
 "Highlights:

  New drivers:
   - asus-tf103c-dock
   - intel_crystal_cove_charger
   - lenovo-yogabook-wmi
   - simatic-ipc platform-code + led driver + watchdog driver
   - x86-android-tablets (kernel module to workaround DSDT bugs on
     these)

  amd-pmc:
   - bug-fixes
   - smar trace buffer support

  asus-wmi:
   - support for custom fan curves

  int3472 (camera info ACPI object for Intel IPU3/SkyCam cameras):
   - ACPI core + int3472 changes to delay enumeration of camera sensor
     I2C clients until the PMIC for the sensor has been fully probed
   - Add support for board data (DSDT info is incomplete) for setting up
     the tps68470 PMIC used on some boards with these cameras
   - Add board data for the Microsoft Surface Go (original, v2 and v3)

  thinkpad_acpi:
   - various cleanups
   - support for forced battery discharging (for battery calibration)
   - support to inhibit battery charging
   - this includes power_supply core changes to add new APIs for this

  think_lmi:
   - enhanced BIOS password support

  various other small fixes and hardware-id additions"

* tag 'platform-drivers-x86-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (78 commits)
  power: supply: Provide stubs for charge_behaviour helpers
  platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exit
  platform/x86: int3472: Add board data for Surface Go 3
  platform/x86: Add Asus TF103C dock driver
  platform/x86: x86-android-tablets: Add TM800A550L data
  platform/x86: x86-android-tablets: Add Asus MeMO Pad 7 ME176C data
  platform/x86: x86-android-tablets: Add Asus TF103C data
  platform/x86: x86-android-tablets: Add support for preloading modules
  platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables
  platform/x86: x86-android-tablets: Add support for instantiating serdevs
  platform/x86: x86-android-tablets: Add support for instantiating platform-devs
  platform/x86: x86-android-tablets: Add support for PMIC interrupts
  platform/x86: x86-android-tablets: Don't return -EPROBE_DEFER from a non probe() function
  platform/x86: touchscreen_dmi: Remove the Glavey TM800A550L entry
  platform/x86: touchscreen_dmi: Enable pen support on the Chuwi Hi10 Plus and Pro
  platform/x86: touchscreen_dmi: Correct min/max values for Chuwi Hi10 Pro (CWI529) tablet
  platform/x86: Add intel_crystal_cove_charger driver
  power: supply: fix charge_behaviour attribute initialization
  platform/x86: intel-uncore-frequency: use default_groups in kobj_type
  x86/platform/uv: use default_groups in kobj_type
  ...
2022-01-11 11:26:57 -08:00
Chen Yu
53e8558837 ACPI: tools: Introduce utility for firmware updates/telemetry
Introduce a user space tool to make use of the interface exposed by
Platform Firmware Runtime Update and Telemetry drivers.

It can be used for firmware code injection, driver updates and
to retrieve platform firmware telemetry data.

Tested-by: Hongyu Ning <hongyu.ning@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-12-27 17:12:58 +01:00
Srinivas Pandruvada
da78fc797f tools/power/x86/intel-speed-select: v1.11 release
This release adds following change:
- Update max performance when BIOS disabled turbo

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-24 12:51:50 +01:00
Srinivas Pandruvada
9734213ed4 tools/power/x86/intel-speed-select: Update max frequency
When BIOS disables turbo, the cpuinfo_max_freq will also be same as the
power up base frequency. When SST-PP causes increase in base frequency
the performance will be still limited to the old base frequency as the
cpuinfo_max_freq will not be updated.

In this case we need to update scaling_max frequency to the new
base_frequency. This will result in setting updated max performance
limit in the Pstate driver. So performance will not be limited to the
old base frequency.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-24 12:51:34 +01:00
Chen Yu
11f8cb8903 ACPI: tools: Fix compilation when output directory is not present
Compiling the ACPI tools when output directory parameter is specified,
but the output directory is not present, triggers the following error:

make O=/data/test/tmp/ -C tools/power/acpi/

make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
  DESCEND tools/acpidbg
make[1]: Entering directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
  MKDIR    include
  CP       include
  CC       tools/acpidbg/acpidbg.o
Assembler messages:
Fatal error: can't create /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o: No such file or directory
make[1]: *** [../../Makefile.rules:24: /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o] Error 1
make[1]: Leaving directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
make: *** [Makefile:18: acpidbg] Error 2
make: Leaving directory '/data/src/kernel/linux/tools/power/acpi'

which occurs because the output directory has not been created yet.

Fix this issue by creating the output directory before compiling.

Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ rjw: New subject, changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-12-08 15:10:27 +01:00
Srinivas Pandruvada
307722e872 tools/power/x86/intel-speed-select: v1.10 release
This release adds following change:
- Fix reporting of memory frequency

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-18 15:29:32 +02:00
Srinivas Pandruvada
159f130f60 tools/power/x86/intel-speed-select: Fix uncore memory frequency display
The uncore memory frequency value from the mailbox command
CONFIG_TDP_GET_MEM_FREQ needs to be scaled based on the platform for
display. There is no single constant multiplier.

This change introduces CPU model specific memory frequency multiplier.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-06-18 15:29:23 +02:00
Linus Torvalds
d8cb379cda Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull turbostat updates from Len Brown:
 "Bug fixes and a smattering of features"

* 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (21 commits)
  tools/power turbostat: version 2021.05.04
  tools/power turbostat: Support "turbostat --hide idle"
  tools/power turbostat: elevate priority of interval mode
  tools/power turbostat: formatting
  tools/power turbostat: rename tcc variables
  tools/power turbostat: add TCC Offset support
  tools/power turbostat: save original CPU model
  tools/power turbostat: Fix Core C6 residency on Atom CPUs
  tools/power turbostat: Print the C-state Pre-wake settings
  tools/power turbostat: Enable tsc_tweak for Elkhart Lake and Jasper Lake
  tools/power turbostat: unmark non-kernel-doc comment
  tools/power/turbostat: Remove Package C6 Retention on Ice Lake Server
  tools/power turbostat: Fix offset overflow issue in index converting
  tools/power/turbostat: Fix turbostat for AMD Zen CPUs
  tools/power turbostat: update version number
  tools/power turbostat: Fix DRAM Energy Unit on SKX
  Revert "tools/power turbostat: adjust for temperature offset"
  tools/power turbostat: Support Ice Lake D
  tools/power turbostat: Support Alder Lake Mobile
  tools/power turbostat: print microcode patch level
  ...
2021-05-05 12:24:29 -07:00
Len Brown
3c070b2abf tools/power turbostat: version 2021.05.04
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:09 -04:00
Len Brown
b60c573dc2 tools/power turbostat: Support "turbostat --hide idle"
As idle, in particular, can have many columns on some machines...
Make it easy to ignore them all at once.

Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:09 -04:00
Len Brown
38c6663a68 tools/power turbostat: elevate priority of interval mode
This makes interval mode less likely to see delayed
results on a heavily loaded system.

Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:09 -04:00
Len Brown
1b439f01b6 tools/power turbostat: formatting
Spring is here...
run a long overdue Lendent on turbostat.c

no functional change

Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:09 -04:00
Zhang Rui
55279aef75 tools/power turbostat: rename tcc variables
There are two TCC activation temeprature.
One is the default TCC activation temperature, also known as TJ_MAX.
Another one is the effective TCC activation temperature, which is the
subtraction of default TCC activation temperature and TCC offset.

The name of variable tcc_activation_temp might be misleading here.
Thus rename tcc_activation_temp to tj_max, and use tcc_default and
tcc_offset to calculate the effective TCC activation temperature.

No functional change in this patch.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:09 -04:00
Zhang Rui
0b9a0b9be9 tools/power turbostat: add TCC Offset support
The length of TCC Offset bits varies on different platforms.
Decode TCC Offset bits only for the platforms that we have verified.
For the others, only show default TCC activation temperature.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:08 -04:00
Zhang Rui
e9d3092f6d tools/power turbostat: save original CPU model
CPU model may get changed in intel_model_duplicates() for code reuse.
But there are still some cases we need the original CPU model to handle
minor differences between generations.

Thus save the original CPU model.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:08 -04:00
Zhang Rui
7ab5ff4937 tools/power turbostat: Fix Core C6 residency on Atom CPUs
For Atom CPUs that have core cstate deeper than C6,
MSR_CORE_C6_RESIDENCY actually returns the residency for both CC6 and
deeper Core cstates.
Thus, the real Core C6 residency should be the subtraction of
MSR_CORE_C6_RESIDENCY return value and MSR_CORE_C6_RESIDENCY return value.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 20:01:00 -04:00
Chen Yu
aeb01e6d71 tools/power turbostat: Print the C-state Pre-wake settings
C-state pre-wake setting[1] is an optimization for some Intel CPUs to
be woken up from deep C-states in order to reduce latency. According to
the spec, the BIT30 is the C-state Pre-wake Disable. Expose this setting
accordingly.
Sample output from turbostat:
...
cpu51: MSR_IA32_POWER_CTL: 0x1a00a40059 (C1E auto-promotion: DISabled)
C-state Pre-wake: ENabled
cpu51: MSR_TURBO_RATIO_LIMIT: 0x2021212121212224
...

[1] https://intel.github.io/wult/#c-state-pre-wake

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 19:10:32 -04:00
Chen Yu
8c69da2930 tools/power turbostat: Enable tsc_tweak for Elkhart Lake and Jasper Lake
It was found that on Elkhart Lake the TSC frequency is driven by
a separate crystal-clock domain, which is different from the
BCLK domain which includes mperf. This has result in small different
speed thus inconsistence between TSC and the mperf, which caused the
Busy% to be higher than 100%. On this platform it seems that the mperf
runs faster than tsc when the CPU is 100% utilized:
delta tsc(18815473183) < delta mperf(18958403680) for 10 seconds.

To align TSC with mperf, leverage the tsc_tweak mechanism introduced for
cores newer than Skylake, so that TSC and mperf would be calculated in
the same domain.

Reported-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 19:09:00 -04:00
Randy Dunlap
1e3ec5cdfb tools/power turbostat: unmark non-kernel-doc comment
Do not mark a comment as kernel-doc notation when it is not
meant to be in kernel-doc notation.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:44:32 -04:00
Chen Yu
25368d7cef tools/power/turbostat: Remove Package C6 Retention on Ice Lake Server
Currently the turbostat treats ICX the same way as SKX and shares the
code among them. But one difference is that ICX does not support Package
C6 Retention, unlike SKX and CLX.

So this patch:

1. Splitting SKX and ICX in turbostat.
2. Removing Package C6 Rentention for ICX.

And after this split, it would be easier to cutomize Ice Lake Server
in turbostat in the future.

Suggested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Reviewed-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:35:43 -04:00
Calvin Walton
13a779de41 tools/power turbostat: Fix offset overflow issue in index converting
The idx_to_offset() function returns type int (32-bit signed), but
MSR_PKG_ENERGY_STAT is u32 and would be interpreted as a negative number.
The end result is that it hits the if (offset < 0) check in update_msr_sum()
which prevents the timer callback from updating the stat in the background when
long durations are used. The similar issue exists in offset_to_idx() and
update_msr_sum(). Fix this issue by converting the 'int' to 'off_t' accordingly.

Fixes: 9972d5d84d ("tools/power turbostat: Enable accumulate RAPL display")
Signed-off-by: Calvin Walton <calvin.walton@kepstin.ca>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:33:41 -04:00
Bas Nieuwenhuizen
301b1d3a91 tools/power/turbostat: Fix turbostat for AMD Zen CPUs
It was reported that on Zen+ system turbostat started exiting,
which was tracked down to the MSR_PKG_ENERGY_STAT read failing because
offset_to_idx wasn't returning a non-negative index.

This patch combined the modification from Bingsong Si and
Bas Nieuwenhuizen and addd the MSR to the index system as alternative for
MSR_PKG_ENERGY_STATUS.

Fixes: 9972d5d84d ("tools/power turbostat: Enable accumulate RAPL display")
Reported-by: youling257 <youling257@gmail.com>
Tested-by: youling257 <youling257@gmail.com>
Tested-by: Kurt Garloff <kurt@garloff.de>
Tested-by: Bingsong Si <owen.si@ucloud.cn>
Tested-by: Artem S. Tashkinov <aros@gmx.com>
Co-developed-by: Bingsong Si <owen.si@ucloud.cn>
Co-developed-by: Terry Bowman <terry.bowman@amd.com>
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:31:35 -04:00
Len Brown
ba58ecde5e tools/power turbostat: update version number 2021-05-04 18:23:15 -04:00
Zhang Rui
abdc75ab53 tools/power turbostat: Fix DRAM Energy Unit on SKX
SKX uses fixed DRAM Energy Unit, just like HSX and BDX.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:23:14 -04:00
Len Brown
b2b94be787 Revert "tools/power turbostat: adjust for temperature offset"
This reverts commit 6ff7cb371c.

Apparently the TCC offset should not be used to adjust what temperature
we show the user after all.

(on most systems, TCC offset is 0, FWIW)

Fixes: 6ff7cb371c

Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:23:14 -04:00
Chen Yu
6c5c656006 tools/power turbostat: Support Ice Lake D
Ice Lake D is low-end server version of Ice Lake X, reuse
the code accordingly.

Tested-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:23:14 -04:00
Chen Yu
5683460b85 tools/power turbostat: Support Alder Lake Mobile
Share the code between Alder Lake Mobile and Alder Lake Desktop.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:23:14 -04:00
Len Brown
ed0757b83a tools/power turbostat: print microcode patch level
(also available via "grep microcode /proc/cpuinfo")

Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:23:14 -04:00
Len Brown
2af4f9b859 tools/power turbostat: add built-in-counter for IPC -- Instructions per Cycle
Use linux-perf to access the hardware instructions-retired counter.
This is necessary because the counter is not enabled by default,
and also the counter is prone to roll-over -- both of which
perf manages.

It is not necessary to use perf for the cycle counter,
because turbostat already needs to collect delta-aperf
to calcuate frequency.

Signed-off-by: Len Brown <len.brown@intel.com>
2021-05-04 18:23:14 -04:00
Linus Torvalds
5469f160e6 Power management updates for 5.13-rc1
- Add idle states table for IceLake-D to the intel_idle driver and
    update IceLake-X C6 data in it (Artem Bityutskiy).
 
  - Fix the C7 idle state on Tegra114 in the tegra cpuidle driver and
    drop the unused do_idle() firmware call from it (Dmitry Osipenko).
 
  - Fix cpuidle-qcom-spm Kconfig entry (He Ying).
 
  - Fix handling of possible negative tick_nohz_get_next_hrtimer()
    return values of in cpuidle governors (Rafael Wysocki).
 
  - Add support for frequency-invariance to the ACPI CPPC cpufreq
    driver and update the frequency-invariance engine (FIE) to use it
    as needed (Viresh Kumar).
 
  - Simplify the default delay_us setting in the ACPI CPPC cpufreq
    driver (Tom Saeger).
 
  - Clean up frequency-related computations in the intel_pstate
    cpufreq driver (Rafael Wysocki).
 
  - Fix TBG parent setting for load levels in the armada-37xx
    cpufreq driver and drop the CPU PM clock .set_parent method for
    armada-37xx (Marek Behún).
 
  - Fix multiple issues in the armada-37xx cpufreq driver (Pali Rohár).
 
  - Fix handling of dev_pm_opp_of_cpumask_add_table() return values
    in cpufreq-dt to take the -EPROBE_DEFER one into acconut as
    appropriate (Quanyang Wang).
 
  - Fix format string in ia64-acpi-cpufreq (Sergei Trofimovich).
 
  - Drop the unused for_each_policy() macro from cpufreq (Shaokun
    Zhang).
 
  - Simplify computations in the schedutil cpufreq governor to avoid
    unnecessary overhead (Yue Hu).
 
  - Fix typos in the s5pv210 cpufreq driver (Bhaskar Chowdhury).
 
  - Fix cpufreq documentation links in Kconfig (Alexander Monakov).
 
  - Fix PCI device power state handling in pci_enable_device_flags()
    to avoid issuse in some cases when the device depends on an ACPI
    power resource (Rafael Wysocki).
 
  - Add missing documentation of pm_runtime_resume_and_get() (Alan
    Stern).
 
  - Add missing static inline stub for pm_runtime_has_no_callbacks()
    to pm_runtime.h and drop the unused try_to_freeze_nowarn()
    definition (YueHaibing).
 
  - Drop duplicate struct device declaration from pm.h and fix a
    structure type declaration in intel_rapl.h (Wan Jiabing).
 
  - Use dev_set_name() instead of an open-coded equivalent of it in
    the wakeup sources code and drop a redundant local variable
    initialization from it (Andy Shevchenko, Colin Ian King).
 
  - Use crc32 instead of md5 for e820 memory map integrity check
    during resume from hibernation on x86 (Chris von Recklinghausen).
 
  - Fix typos in comments in the system-wide and hibernation support
    code (Lu Jialin).
 
  - Modify the generic power domains (genpd) code to avoid resuming
    devices in the "prepare" phase of system-wide suspend and
    hibernation (Ulf Hansson).
 
  - Add Hygon Fam18h RAPL support to the intel_rapl power capping
    driver (Pu Wen).
 
  - Add MAINTAINERS entry for the dynamic thermal power management
    (DTPM) code (Daniel Lezcano).
 
  - Add devm variants of operating performance points (OPP) API
    functions and switch over some users of the OPP framework to
    the new resource-managed API (Yangtao Li and Dmitry Osipenko).
 
  - Update devfreq core:
 
    * Register devfreq devices as cooling devices on demand (Daniel
      Lezcano).
 
    * Add missing unlock opeation in devfreq_add_device() (Lukasz
      Luba).
 
    * Use the next frequency as resume_freq instead of the previous
      frequency when using the opp-suspend property (Dong Aisheng).
 
    * Check get_dev_status in devfreq_update_stats() (Dong Aisheng).
 
    * Fix set_freq path for the userspace governor in Kconfig (Dong
      Aisheng).
 
    * Remove invalid description of get_target_freq() (Dong Aisheng).
 
  - Update devfreq drivers:
 
    * imx8m-ddrc: Remove imx8m_ddrc_get_dev_status() and unneeded
      of_match_ptr() (Dong Aisheng, Fabio Estevam).
 
    * rk3399_dmc: dt-bindings: Add rockchip,pmu phandle and drop
      references to undefined symbols (Enric Balletbo i Serra, Gaël
      PORTAY).
 
    * rk3399_dmc: Use dev_err_probe() to simplify the code (Krzysztof
      Kozlowski).
 
    * imx-bus: Remove unneeded of_match_ptr() (Fabio Estevam).
 
  - Fix kernel-doc warnings in three places (Pierre-Louis Bossart).
 
  - Fix typo in the pm-graph utility code (Ricardo Ribalda).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmCHAUISHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxAxMP/0tFjgxeaJ3chYaiqoPlk2QX/XdwqJvm
 8OOu2qBMWbt2bubcIlAPpdlCNaERI4itF7E8za7t9alswdq7YPWGmNR9snCXUKhD
 BzERuicZTeOcCk2P3DTgzLVc4EzF6wutA3lTdYYZIpf+LuuB+guG8zgMzScRHIsM
 N3I83O+iLTA9ifIqN0/wH//a0ISvo6rSWtcbx+48d5bYvYixW7CsBmoxWHhGiYsw
 4PJ4AzbdNJEhQp91SBYPIAmqwV88FZUPoYnRazXMxOSevMewhP9JuCHXAujC3gLV
 l5d2TBaBV4EBYLD5tfCpJvHMXhv/yBpg6KRivjri+zEnY1TAqIlfR4vYiL7puVvQ
 PdwjyvNFDNGyUSX/AAwYF6F4WCtIhw8hCahw6Dw2zcDz0plFdRZmWAiTdmIjECJK
 8EvwJNlmdl27G1y+EBc6NnwzEFZQwiu9F5bUHUkmc3fF1M1aFTza8WDNDo30TC94
 94c+uVBRL2fBePl4FfGZATfJbOMb8+vDIkroQxrIjQDT/7Ha3Mz75JZDRHItZo92
 +4fES2eFdfZISCLIQMBY5TeXox3O8qsirC1k4qELwy71gPUE9CpP3FkxKIvyZLlv
 +6fS9ttpUfyFBF7gqrEy+ziVk1Rm4oorLmWCtthz4xyerzj5+vtZQqKzcySk0GA5
 hYkseZkedR6y
 =t+SG
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "These add some new hardware support (for example, IceLake-D idle
  states in intel_idle), fix some issues (for example, the handling of
  negative "sleep length" values in cpuidle governors), add new
  functionality to the existing drivers (for example, scale-invariance
  support in the ACPI CPPC cpufreq driver) and clean up code all over.

  Specifics:

   - Add idle states table for IceLake-D to the intel_idle driver and
     update IceLake-X C6 data in it (Artem Bityutskiy).

   - Fix the C7 idle state on Tegra114 in the tegra cpuidle driver and
     drop the unused do_idle() firmware call from it (Dmitry Osipenko).

   - Fix cpuidle-qcom-spm Kconfig entry (He Ying).

   - Fix handling of possible negative tick_nohz_get_next_hrtimer()
     return values of in cpuidle governors (Rafael Wysocki).

   - Add support for frequency-invariance to the ACPI CPPC cpufreq
     driver and update the frequency-invariance engine (FIE) to use it
     as needed (Viresh Kumar).

   - Simplify the default delay_us setting in the ACPI CPPC cpufreq
     driver (Tom Saeger).

   - Clean up frequency-related computations in the intel_pstate cpufreq
     driver (Rafael Wysocki).

   - Fix TBG parent setting for load levels in the armada-37xx cpufreq
     driver and drop the CPU PM clock .set_parent method for armada-37xx
     (Marek Behún).

   - Fix multiple issues in the armada-37xx cpufreq driver (Pali Rohár).

   - Fix handling of dev_pm_opp_of_cpumask_add_table() return values in
     cpufreq-dt to take the -EPROBE_DEFER one into acconut as
     appropriate (Quanyang Wang).

   - Fix format string in ia64-acpi-cpufreq (Sergei Trofimovich).

   - Drop the unused for_each_policy() macro from cpufreq (Shaokun
     Zhang).

   - Simplify computations in the schedutil cpufreq governor to avoid
     unnecessary overhead (Yue Hu).

   - Fix typos in the s5pv210 cpufreq driver (Bhaskar Chowdhury).

   - Fix cpufreq documentation links in Kconfig (Alexander Monakov).

   - Fix PCI device power state handling in pci_enable_device_flags() to
     avoid issuse in some cases when the device depends on an ACPI power
     resource (Rafael Wysocki).

   - Add missing documentation of pm_runtime_resume_and_get() (Alan
     Stern).

   - Add missing static inline stub for pm_runtime_has_no_callbacks() to
     pm_runtime.h and drop the unused try_to_freeze_nowarn() definition
     (YueHaibing).

   - Drop duplicate struct device declaration from pm.h and fix a
     structure type declaration in intel_rapl.h (Wan Jiabing).

   - Use dev_set_name() instead of an open-coded equivalent of it in the
     wakeup sources code and drop a redundant local variable
     initialization from it (Andy Shevchenko, Colin Ian King).

   - Use crc32 instead of md5 for e820 memory map integrity check during
     resume from hibernation on x86 (Chris von Recklinghausen).

   - Fix typos in comments in the system-wide and hibernation support
     code (Lu Jialin).

   - Modify the generic power domains (genpd) code to avoid resuming
     devices in the "prepare" phase of system-wide suspend and
     hibernation (Ulf Hansson).

   - Add Hygon Fam18h RAPL support to the intel_rapl power capping
     driver (Pu Wen).

   - Add MAINTAINERS entry for the dynamic thermal power management
     (DTPM) code (Daniel Lezcano).

   - Add devm variants of operating performance points (OPP) API
     functions and switch over some users of the OPP framework to the
     new resource-managed API (Yangtao Li and Dmitry Osipenko).

   - Update devfreq core:

      * Register devfreq devices as cooling devices on demand (Daniel
        Lezcano).

      * Add missing unlock opeation in devfreq_add_device() (Lukasz
        Luba).

      * Use the next frequency as resume_freq instead of the previous
        frequency when using the opp-suspend property (Dong Aisheng).

      * Check get_dev_status in devfreq_update_stats() (Dong Aisheng).

      * Fix set_freq path for the userspace governor in Kconfig (Dong
        Aisheng).

      * Remove invalid description of get_target_freq() (Dong Aisheng).

   - Update devfreq drivers:

      * imx8m-ddrc: Remove imx8m_ddrc_get_dev_status() and unneeded
        of_match_ptr() (Dong Aisheng, Fabio Estevam).

      * rk3399_dmc: dt-bindings: Add rockchip,pmu phandle and drop
        references to undefined symbols (Enric Balletbo i Serra, Gaël
        PORTAY).

      * rk3399_dmc: Use dev_err_probe() to simplify the code (Krzysztof
        Kozlowski).

      * imx-bus: Remove unneeded of_match_ptr() (Fabio Estevam).

   - Fix kernel-doc warnings in three places (Pierre-Louis Bossart).

   - Fix typo in the pm-graph utility code (Ricardo Ribalda)"

* tag 'pm-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (74 commits)
  PM: wakeup: remove redundant assignment to variable retval
  PM: hibernate: x86: Use crc32 instead of md5 for hibernation e820 integrity check
  cpufreq: Kconfig: fix documentation links
  PM: wakeup: use dev_set_name() directly
  PM: runtime: Add documentation for pm_runtime_resume_and_get()
  cpufreq: intel_pstate: Simplify intel_pstate_update_perf_limits()
  cpufreq: armada-37xx: Fix module unloading
  cpufreq: armada-37xx: Remove cur_frequency variable
  cpufreq: armada-37xx: Fix determining base CPU frequency
  cpufreq: armada-37xx: Fix driver cleanup when registration failed
  clk: mvebu: armada-37xx-periph: Fix workaround for switching from L1 to L0
  clk: mvebu: armada-37xx-periph: Fix switching CPU freq from 250 Mhz to 1 GHz
  cpufreq: armada-37xx: Fix the AVS value for load L1
  clk: mvebu: armada-37xx-periph: remove .set_parent method for CPU PM clock
  cpufreq: armada-37xx: Fix setting TBG parent for load levels
  cpuidle: Fix ARM_QCOM_SPM_CPUIDLE configuration
  cpuidle: tegra: Remove do_idle firmware call
  cpuidle: tegra: Fix C7 idling state on Tegra114
  PM: sleep: fix typos in comments
  cpufreq: Remove unused for_each_policy macro
  ...
2021-04-26 15:10:25 -07:00
Linus Torvalds
d8f9176b4e ACPI updates for 5.13-rc1
- Update ACPICA code in the kernel to upstream revision 20210331
    including the following changes:
 
    * Add parsing for IVRS IVHD 40h and device entry F0h (Alexander
      Monakov).
 
    * Add new CEDT table for CXL 2.0 and iASL support for it (Ben
      Widawsky, Bob Moore).
 
    * NFIT: add Location Cookie field (Bob Moore).
 
    * HMAT: add new fields/flags (Bob Moore).
 
    * Add new flags in SRAT (Bob Moore).
 
    * PMTT: add new fields/structures (Bob Moore).
 
    * Add CSI2Bus resource template (Bob Moore).
 
    * iASL: Decode subtable type field for VIOT (Bob Moore).
 
    * Fix various typos and spelling mistakes (Colin Ian King).
 
    * Add new predefined objects _BPC, _BPS, and _BPT (Erik Kaneda).
 
    * Add USB4 capabilities UUID (Erik Kaneda).
 
    * Add CXL ACPI device ID and _CBR object (Erik Kaneda).
 
    * MADT: add Multiprocessor Wakeup Structure (Erik Kaneda).
 
    * PCCT: add support for subtable type 5 (Erik Kaneda).
 
    * PPTT: add new version of subtable type 1 (Erik Kaneda).
 
    * Add SDEV secure access components (Erik Kaneda).
 
    * Add support for PHAT table (Erik Kaneda).
 
    * iASL: Add definitions for the VIOT table (Jean-Philippe Brucker).
 
    * acpisrc: Add missing conversion for VIOT support (Jean-Philippe
      Brucker).
 
    * IORT: Updates for revision E.b (Shameer Kolothum).
 
  - Rearrange message printing in ACPI-related code to avoid using the
    ACPICA's internal message printing macros outside ACPICA and do
    some related code cleanups (Rafael Wysocki).
 
  - Modify the device enumeration code to turn off all of the unused
    ACPI power resources at the end (Rafael Wysocki).
 
  - Change the ACPI power resources handling code to turn off unused
    ACPI power resources without checking their status which should
    not be necessary by the spec (Rafael Wysocki).
 
  - Add empty stubs for CPPC-related functions to be used when
    CONFIG_ACPI_CPPC_LIB is not set (Rafael Wysocki).
 
  - Simplify device enumeration code (Rafael Wysocki).
 
  - Change device enumeration code to use match_string() for string
    matching (Andy Shevchenko).
 
  - Modify irqresource_disabled() to retain the resouce flags that
    have been set already (Angela Czubak).
 
  - Add native backlight whitelist entry for GA401/GA502/GA503 (Luke
    Jones).
 
  - Modify the ACPI backlight driver to let the native backlight
    handling take over on hardware-reduced systems (Hans de Goede).
 
  - Introduce acpi_dev_get() and switch over the ACPI core code to
    using it (Andy Shevchenko).
 
  - Use kobj_attribute as callback argument instead of a local struct
    type in the CPPC linrary code (Nathan Chancellor).
 
  - Drop unneeded initializatio of a static variable from the ACPI
    processor driver (Tian Tao).
 
  - Drop unnecessary local variable assignment from the ACPI APEI
    code (Colin Ian King).
 
  - Document for_each_acpi_dev_match() macro (Andy Shevchenko).
 
  - Address assorted coding style issues in multiple places (Xiaofei
    Tan).
 
  - Capitalize TLAs in a few comments (Andy Shevchenko).
 
  - Correct assorted typos in comments (Tom Saeger).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmCHAL8SHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxZroQAIdFsRUTKmm8st9sdfEtF3QHLS3/EV2x
 1GlkL+3yE/WuEFXNd0mAv0MTcV2sNMKGd5oz74zLkciPC2dNR4168Ni6DhGSoELM
 0ZMOAu9E12Nyq7/1FdWalLQprtR8OuLVwgC2VckK+f//4vzpZ+6PtGMwAwtImSHK
 m3WRPimVbgOVJ1UWZjsfIm7kLBD4o4oCx0pdeEl77q0oQKmMdcByUh2YnjwKzFnP
 9zqV+SCi3HL4w67HO/uMe7x8isNyWONYXVqOvOkgXi7PeoX9v0XiWSCJ0KnAvbI1
 PZokJT8pTrKnFyL3zJS6pU/ZHj7ikFiTc+MfyyPcYRJZ5nBvRjqHKoPOtZ9yfU6n
 jgt/u3REhqwnHy0ikS8HsP+PWnAJF1Re3sNVvIMnX6XxTIndHCXZEoeldfeC23S9
 PmzGA0//iPngiYaOVM5BxIjRi2nRBHlVvzSIACICXDcszA81RHePFIzfjUgW3elp
 v6kAhkrXYajqrDb7NuvY4MTuuBo8w3q2xWJGu5VlDkNOblM0AExRhXmvp1RW0kL7
 +mi5X6xBFEB9M6hEoWKnleaZTXTlFYBreKsMPEEP7N7a5+UZRPedcjX1PflCkOB3
 uL5p/+x3br1fkDyK0P7wFf3VqiBXuwFajEdCmyHnizpD6m0oWC6pv9PUGYUCneJ1
 JGH5X/3Uu33D
 =5fuB
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to the most recent upstream
  revision including (but not limited to) new material introduced in the
  6.4 version of the spec, update message printing in the ACPI-related
  code, address a few issues and clean up code in a number of places.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20210331
     including the following changes:

      * Add parsing for IVRS IVHD 40h and device entry F0h (Alexander
        Monakov).

      * Add new CEDT table for CXL 2.0 and iASL support for it (Ben
        Widawsky, Bob Moore).

      * NFIT: add Location Cookie field (Bob Moore).

      * HMAT: add new fields/flags (Bob Moore).

      * Add new flags in SRAT (Bob Moore).

      * PMTT: add new fields/structures (Bob Moore).

      * Add CSI2Bus resource template (Bob Moore).

      * iASL: Decode subtable type field for VIOT (Bob Moore).

      * Fix various typos and spelling mistakes (Colin Ian King).

      * Add new predefined objects _BPC, _BPS, and _BPT (Erik Kaneda).

      * Add USB4 capabilities UUID (Erik Kaneda).

      * Add CXL ACPI device ID and _CBR object (Erik Kaneda).

      * MADT: add Multiprocessor Wakeup Structure (Erik Kaneda).

      * PCCT: add support for subtable type 5 (Erik Kaneda).

      * PPTT: add new version of subtable type 1 (Erik Kaneda).

      * Add SDEV secure access components (Erik Kaneda).

      * Add support for PHAT table (Erik Kaneda).

      * iASL: Add definitions for the VIOT table (Jean-Philippe
        Brucker).

      * acpisrc: Add missing conversion for VIOT support (Jean-Philippe
        Brucker).

      * IORT: Updates for revision E.b (Shameer Kolothum).

   - Rearrange message printing in ACPI-related code to avoid using the
     ACPICA's internal message printing macros outside ACPICA and do
     some related code cleanups (Rafael Wysocki).

   - Modify the device enumeration code to turn off all of the unused
     ACPI power resources at the end (Rafael Wysocki).

   - Change the ACPI power resources handling code to turn off unused
     ACPI power resources without checking their status which should not
     be necessary by the spec (Rafael Wysocki).

   - Add empty stubs for CPPC-related functions to be used when
     CONFIG_ACPI_CPPC_LIB is not set (Rafael Wysocki).

   - Simplify device enumeration code (Rafael Wysocki).

   - Change device enumeration code to use match_string() for string
     matching (Andy Shevchenko).

   - Modify irqresource_disabled() to retain the resouce flags that have
     been set already (Angela Czubak).

   - Add native backlight whitelist entry for GA401/GA502/GA503 (Luke
     Jones).

   - Modify the ACPI backlight driver to let the native backlight
     handling take over on hardware-reduced systems (Hans de Goede).

   - Introduce acpi_dev_get() and switch over the ACPI core code to
     using it (Andy Shevchenko).

   - Use kobj_attribute as callback argument instead of a local struct
     type in the CPPC linrary code (Nathan Chancellor).

   - Drop unneeded initializatio of a static variable from the ACPI
     processor driver (Tian Tao).

   - Drop unnecessary local variable assignment from the ACPI APEI code
     (Colin Ian King).

   - Document for_each_acpi_dev_match() macro (Andy Shevchenko).

   - Address assorted coding style issues in multiple places (Xiaofei
     Tan).

   - Capitalize TLAs in a few comments (Andy Shevchenko).

   - Correct assorted typos in comments (Tom Saeger)"

* tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (68 commits)
  ACPI: video: use native backlight for GA401/GA502/GA503
  ACPI: APEI: remove redundant assignment to variable rc
  ACPI: utils: Capitalize abbreviations in the comments
  ACPI: utils: Document for_each_acpi_dev_match() macro
  ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code
  ACPI: scan: Utilize match_string() API
  resource: Prevent irqresource_disabled() from erasing flags
  ACPI: CPPC: Replace cppc_attr with kobj_attribute
  ACPI: scan: Call acpi_get_object_info() from acpi_set_pnp_ids()
  ACPI: scan: Drop sta argument from acpi_init_device_object()
  ACPI: scan: Drop sta argument from acpi_add_single_object()
  ACPI: scan: Rearrange checks in acpi_bus_check_add()
  ACPI: scan: Fold acpi_bus_type_and_status() into its caller
  ACPI: video: Check LCD flag on ACPI-reduced-hardware devices
  ACPI: utils: Add acpi_reduced_hardware() helper
  ACPI: dock: fix some coding style issues
  ACPI: sysfs: fix some coding style issues
  ACPI: PM: add a missed blank line after declarations
  ACPI: custom_method: fix a coding style issue
  ACPI: CPPC: fix some coding style issues
  ...
2021-04-26 15:03:23 -07:00
Linus Torvalds
90035c28f1 platform-drivers-x86 for v5.13-1
Highlights:
  - Lots of Microsoft Surface work
  - platform-profile support for HP and Microsoft Surface devices
  - New WMI Gigabyte motherboard temperature monitoring driver
  - Intel PMC improvements for Tiger Lake and Alder Lake
  - Misc. bugfixes, improvements and quirk additions all over
 
 The following is an automated git shortlog grouped by driver:
 
 Add support for DYTC MMC_GET BIOS API.:
  - Add support for DYTC MMC_GET BIOS API.
 
 Adjust Dell drivers to a personal email address:
  - Adjust Dell drivers to a personal email address
 
 Fix typo in Kconfig:
  - Fix typo in Kconfig
 
 ISST:
  -  Account for increased timeout in some cases
 
 MAINTAINERS:
  -  Add missing section for alienware-wmi driver
  -  Adjust Dell drivers to email alias
  -  update MELLANOX HARDWARE PLATFORM SUPPORT maintainers
 
 Merge tag 'ib-mfd-platform-x86-v5.13' into review-hans:
  - Merge tag 'ib-mfd-platform-x86-v5.13' into review-hans
 
 Merge tag 'irq-no-autoen-2021-03-25' into review-hans:
  - Merge tag 'irq-no-autoen-2021-03-25' into review-hans
 
 Typo fix in the file classmate-laptop.c:
  - Typo fix in the file classmate-laptop.c
 
 add Gigabyte WMI temperature driver:
  - add Gigabyte WMI temperature driver
 
 add support for Advantech software defined button:
  - add support for Advantech software defined button
 
 asus-laptop:
  -  fix kobj_to_dev.cocci warnings
 
 asus-wmi:
  -  Add param to turn fn-lock mode on by default
 
 dell-wmi-sysman:
  -  Make init_bios_attributes() ACPI object parsing more robust
  -  Cleanup create_attributes_level_sysfs_files()
  -  Make sysman_init() return -ENODEV of the interfaces are not found
  -  Cleanup sysman_init() error-exit handling
  -  Fix release_attributes_data() getting called twice on init_bios_attributes() failure
  -  Make it safe to call exit_foo_attributes() multiple times
  -  Fix possible NULL pointer deref on exit
  -  Fix crash caused by calling kset_unregister twice
 
 docs:
  -  driver-api: Add Surface DTX driver documentation
 
 genirq:
  -  Add IRQF_NO_AUTOEN for request_irq/nmi()
 
 gigabyte-wmi:
  -  add support for B550M AORUS PRO-P
  -  add X570 AORUS ELITE
 
 hp-wmi:
  -  add platform profile support
  -  rename "thermal policy" to "thermal profile"
 
 intel-hid:
  -  Fix spurious wakeups caused by tablet-mode events during suspend
  -  Support Lenovo ThinkPad X1 Tablet Gen 2
 
 intel-vbtn:
  -  Remove unused KEYMAP_LEN define
  -  Stop reporting SW_DOCK events
 
 intel_chtdc_ti_pwrbtn:
  -  Fix missing IRQF_ONESHOT as only threaded handler
 
 intel_pmc_core:
  -  Uninitialized data in pmc_core_lpm_latch_mode_write()
  -  add ACPI dependency
  -  Fix "unsigned 'ret' is never less than zero" smatch warning
  -  Add support for Alder Lake PCH-P
  -  Add LTR registers for Tiger Lake
  -  Add option to set/clear LPM mode
  -  Add requirements file to debugfs
  -  Get LPM requirements for Tiger Lake
  -  Show LPM residency in microseconds
  -  Handle sub-states generically
  -  Remove global struct pmc_dev
  -  Don't use global pmcdev in quirks
  -  export platform global reset bits via etr3 sysfs file
  -  Ignore GBE LTR on Tiger Lake platforms
  -  Update Kconfig
 
 intel_pmt_class:
  -  Initial resource to 0
 
 intel_pmt_crashlog:
  -  Fix incorrect macros
 
 mfd:
  -  intel_pmt: Add support for DG1
  -  intel_pmt: Fix nuisance messages and handling of disabled capabilities
 
 panasonic-laptop:
  -  remove redundant assignment of variable result
 
 platform:
  -  x86: ACPI: Get rid of ACPICA message printing
 
 platform/mellanox:
  -  mlxreg-hotplug: move to use request_irq by IRQF_NO_AUTOEN flag
  -  Typo fix in the file mlxbf-bootctl.c
 
 platform/surface:
  -  aggregator: fix a bit test
  -  aggregator: move to use request_irq by IRQF_NO_AUTOEN flag
  -  aggregator_registry: Give devices time to set up when connecting
  -  clean up a variable in surface_dtx_read()
  -  fix semicolon.cocci warnings
  -  aggregator_registry: Add support for Surface Pro 7+
  -  aggregator_registry: Make symbol 'ssam_base_hub_group' static
  -  dtx: Add support for native SSAM devices
  -  Add DTX driver
  -  aggregator: Make SSAM_DEFINE_SYNC_REQUEST_x define static functions
  -  Add platform profile driver
  -  aggregator_registry: Add HID subsystem devices
  -  aggregator_registry: Add DTX device
  -  aggregator_registry: Add platform profile device
  -  aggregator_registry: Add battery subsystem devices
  -  aggregator_registry: Add base device hub
  -  Set up Surface Aggregator device registry
 
 pmc_atom:
  -  Match all Beckhoff Automation baytrail boards with critclk_systems DMI table
 
 thinkpad_acpi:
  -  Add labels to the first 2 temperature sensors
  -  Correct thermal sensor allocation
  -  Correct minor typo
  -  sysfs interface to get wwan antenna type
  -  Disable DYTC CQL mode around switching to balanced mode
  -  Allow the FnLock LED to change state
  -  check dytc version for lapmode sysfs
  -  Handle keyboard cover attach/detach events
 
 tools/power/x86/intel-speed-select:
  -  v1.9 release
  -  Drop __DATE__ and __TIME__ macros
  -  Add options to force online
  -  Process mailbox read error for core-power
  -  Increase string size
 
 touchscreen_dmi:
  -  Add info for the Teclast Tbook 11 tablet
  -  Handle device properties with software node API
 
 wmi:
  -  Make remove callback return void
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmCGbVEUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9x4ywgAo51ExPQcLMlEDdfpN7oa0ErT+4AF
 lKqOHO/g3Am63NwlAVZElKAJq+AChfQzZ+Idy9E/IirFplmhuoKBBRQoB+U9SwYS
 zerwNDwAh1j1ZLlWDo0BSsiJLdGJH3j5BvScjo57+Vfa75J9EofIGXvNEjLNxb7j
 djLc4FawAfaqL6YerKXZPvYIfpIw2+26SyxDw2s6KlYyBkPIEneQvto0ObWR3vLc
 1iFxLgfxL1fYX7dD9e/9H84kIQzs/wgTduXmnSn32BcFw3YOtWpnpwB0wJ8IIXM0
 8Ta6jH2ZGTbgfKaHZf2O+UObj8tRXFzjpx4neh5vybRrBsYELzQIm+W+jQ==
 =fsK6
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates freom Hans de Goede:

 - lots of Microsoft Surface work

 - platform-profile support for HP and Microsoft Surface devices

 - new WMI Gigabyte motherboard temperature monitoring driver

 - Intel PMC improvements for Tiger Lake and Alder Lake

 - misc bugfixes, improvements and quirk additions all over

* tag 'platform-drivers-x86-v5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (87 commits)
  platform/x86: gigabyte-wmi: add support for B550M AORUS PRO-P
  platform/x86: intel_pmc_core: Uninitialized data in pmc_core_lpm_latch_mode_write()
  platform/x86: intel_pmc_core: add ACPI dependency
  platform/surface: aggregator: fix a bit test
  platform/x86: intel_pmc_core: Fix "unsigned 'ret' is never less than zero" smatch warning
  platform/x86: touchscreen_dmi: Add info for the Teclast Tbook 11 tablet
  platform/x86: intel_pmc_core: Add support for Alder Lake PCH-P
  platform/x86: intel_pmc_core: Add LTR registers for Tiger Lake
  platform/x86: intel_pmc_core: Add option to set/clear LPM mode
  platform/x86: intel_pmc_core: Add requirements file to debugfs
  platform/x86: intel_pmc_core: Get LPM requirements for Tiger Lake
  platform/x86: intel_pmc_core: Show LPM residency in microseconds
  platform/x86: intel_pmc_core: Handle sub-states generically
  platform/x86: intel_pmc_core: Remove global struct pmc_dev
  platform/x86: intel_pmc_core: Don't use global pmcdev in quirks
  platform/x86: intel_chtdc_ti_pwrbtn: Fix missing IRQF_ONESHOT as only threaded handler
  platform/x86: gigabyte-wmi: add X570 AORUS ELITE
  platform/x86: thinkpad_acpi: Add labels to the first 2 temperature sensors
  platform/x86: pmc_atom: Match all Beckhoff Automation baytrail boards with critclk_systems DMI table
  platform/x86: add Gigabyte WMI temperature driver
  ...
2021-04-26 10:58:33 -07:00
Srinivas Pandruvada
61ce18ff01 tools/power/x86/intel-speed-select: v1.9 release
This release adds following changes:
- Support increased number of CPUs
- Return error when mailbox commmand fails to enable core-power
- Option to online all CPUs
- Removes build date and time print

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07 19:47:22 +02:00
Antonio Terceiro
17de9a5654 tools/power/x86/intel-speed-select: Drop __DATE__ and __TIME__ macros
These macros introduce nondeterminism in builds, and break reproducible
builds.

Signed-off-by: Antonio Terceiro <antonio.terceiro@linaro.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07 19:47:22 +02:00
Srinivas Pandruvada
0d3dfd7570 tools/power/x86/intel-speed-select: Add options to force online
It is possible that users manually offlined CPUs via sysfs interface
and then started this utility. In this case we will not be able to get
package and die id of the those CPUs. So add an option to force online
if required for some commands.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07 19:47:22 +02:00
Srinivas Pandruvada
b84733a1c5 tools/power/x86/intel-speed-select: Process mailbox read error for core-power
Some older kernels don't support reading core-power status. In that case
mailbox command fails. So, display core-power status as "unknown" instead
of supported.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07 19:47:22 +02:00
Srinivas Pandruvada
2e70b710f3 tools/power/x86/intel-speed-select: Increase string size
The current string size to print cpulist can accommodate upto 80
logical CPUs per package. But this limit is not enough. So increase
the string size. Also prevent buffer overflow, if the string size
reaches limit.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-07 19:47:22 +02:00
Colin Ian King
e527db8f39 ACPICA: Tree-wide: fix various typos and spelling mistakes
This commit squashes the following:
ACPICA commit bc8939e2d902653e71bb1601b129a993c37fcfad
ACPICA commit 2d9e5e98e23f2a569e5691e6bed183146e25798d
ACPICA commit 937358156631ea7a0eef3569c213c82a031097d5

Fix more spelling issues found using the codespell checker and found
without tools.

Link: https://github.com/acpica/acpica/commit/bc8939e2
Link: https://github.com/acpica/acpica/commit/2d9e5e98
Link: https://github.com/acpica/acpica/commit/93735815

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-04-07 19:09:00 +02:00
Randy Dunlap
800c120ef4 tools/turbostat: Unmark non-kernel-doc comment
Do not mark a comment as kernel-doc notation when it is not meant to be
in kernel-doc notation.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210325201333.16792-1-rdunlap@infradead.org
2021-03-25 23:10:45 +01:00
Ricardo Ribalda
b7e23e54a9 pm-graph: Fix typo "accesible"
Trivial fix.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-03-22 15:27:17 +01:00
Linus Torvalds
983e4adae0 platform-drivers-x86 for v5.12-1
- Microsoft Surface devices System Aggregator Module support
 - SW_TABLET_MODE reporting improvements
 - thinkpad_acpi keyboard language setting support
 - platform / DPTF profile settings support
  - Base / userspace API parts merged from Rafael's acpi-platform branch
  - thinkpad_acpi and ideapad-laptop support through pdx86
 - Remove support for some obsolete Intel MID platforms through merging
   of the shared intel-mid-removal branch
 - Big cleanup of the ideapad-laptop driver
 - Misc. other fixes / new hw support / quirks
 
 The following is an automated git shortlog grouped by driver:
 
 ACPI:
  -  platform-profile: Fix possible deadlock in platform_profile_remove()
  -  platform-profile: Introduce object pointers to callbacks
  -  platform-profile: Drop const qualifier for cur_profile
  -  platform: Add platform profile support
 
 Documentation:
  -  Add documentation for new platform_profile sysfs attribute
 
 Documentation/ABI:
  -  sysfs-platform-ideapad-laptop: conservation_mode attribute
  -  sysfs-platform-ideapad-laptop: update device attribute paths
 
 Kconfig:
  -  add missing selects for ideapad-laptop
 
 MAINTAINERS:
  -  update email address for Henrique de Moraes Holschuh
 
 Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-hans:
  - Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-hans
 
 Merge remote-tracking branch 'linux-pm/acpi-platform' into review-hans:
  - Merge remote-tracking branch 'linux-pm/acpi-platform' into review-hans
 
 Merge tag 'ib-drm-gpio-pdx86-rtc-wdt-v5.12-1' into for-next:
  - Merge tag 'ib-drm-gpio-pdx86-rtc-wdt-v5.12-1' into for-next
 
 Move all dell drivers to their own subdirectory:
  - Move all dell drivers to their own subdirectory
 
 Platform:
  -  OLPC: Constify static struct regulator_ops
  -  OLPC: Specify the enable time
  -  OLPC: Remove dcon_rdev from olpc_ec_priv
  -  OLPC: Fix probe error handling
 
 Revert "platform/x86:
  -  ideapad-laptop: Switch touchpad attribute to be RO"
 
 acer-wmi:
  -  Don't use ACPI_EXCEPTION()
 
 amd-pmc:
  -  put device on error paths
  -  Fix CONFIG_DEBUG_FS check
 
 dell-wmi-sysman:
  -  fix a NULL pointer dereference
 
 docs:
  -  driver-api: Add Surface Aggregator subsystem documentation
 
 drm/gma500:
  -  Get rid of duplicate NULL checks
  -  Convert to use new SCU IPC API
 
 gpio:
  -  msic: Remove driver for deprecated platform
  -  intel-mid: Remove driver for deprecated platform
 
 hp-wmi:
  -  Disable tablet-mode reporting by default
  -  Don't log a warning on HPWMI_RET_UNKNOWN_COMMAND errors
 
 i2c-multi-instantiate:
  -  Don't create platform device for INT3515 ACPI nodes
 
 ideapad-laptop:
  -  add "always on USB charging" control support
  -  add keyboard backlight control support
  -  send notification about touchpad state change to sysfs
  -  fix checkpatch warnings, more consistent style
  -  change 'cfg' debugfs file format
  -  change 'status' debugfs file format
  -  check for touchpad support in _CFG
  -  check for Fn-lock support in HALS
  -  rework is_visible() logic
  -  rework and create new ACPI helpers
  -  group and separate (un)related constants into enums
  -  misc. device attribute changes
  -  always propagate error codes from device attributes' show() callback
  -  convert ACPI helpers to return -EIO in case of failure
  -  use dev_{err,warn} or appropriate variant to display log messages
  -  use msecs_to_jiffies() helper instead of hand-crafted formula
  -  use for_each_set_bit() helper to simplify event processing
  -  use kobj_to_dev()
  -  use device_{add,remove}_group
  -  use sysfs_emit()
  -  add missing call to submodule destructor
  -  sort includes lexicographically
  -  use appropriately typed variable to store the return value of ACPI methods
  -  remove unnecessary NULL checks
  -  remove unnecessary dev_set_drvdata() call
  -  DYTC Platform profile support
  -  Disable touchpad_switch for ELAN0634
 
 intel-vbtn:
  -  Eval VBDL after registering our notifier
  -  Add alternative method to enable switches
  -  Create 2 separate input-devs for buttons and switches
  -  Rework wakeup handling in notify_handler()
  -  Drop HP Stream x360 Convertible PC 11 from allow-list
  -  Support for tablet mode on Dell Inspiron 7352
 
 intel_mid_powerbtn:
  -  Remove driver for deprecated platform
  -  Remove driver for deprecated platform
 
 intel_mid_thermal:
  -  Remove driver for deprecated platform
  -  Remove driver for deprecated platform
 
 intel_pmt:
  -  Make INTEL_PMT_CLASS non-user-selectable
 
 intel_pmt_crashlog:
  -  Add dependency on MFD_INTEL_PMT
 
 intel_pmt_telemetry:
  -  Add dependency on MFD_INTEL_PMT
 
 intel_scu_ipc:
  -  Increase virtual timeout from 3 to 5 seconds
 
 intel_scu_wdt:
  -  Drop mistakenly added const
  -  Get rid of custom x86 model comparison
  -  Drop SCU notification
  -  Move driver from arch/x86
 
 msi-wmi:
  -  Fix variable 'status' set but not used compiler warning
 
 platform/surface:
  -  aggregator: Fix access of unaligned value
  -  Add Surface Hot-Plug driver
  -  surface3-wmi: Fix variable 'status' set but not used compiler warning
  -  aggregator: Fix braces in if condition with unlikely() macro
  -  aggregator: Fix kernel-doc references
  -  aggregator: fix a kernel-doc markup
  -  aggregator_cdev: Add comments regarding unchecked allocation size
  -  aggregator_cdev: Fix access of uninitialized variables
  -  fix potential integer overflow on shift of a int
  -  Add Surface ACPI Notify driver
  -  Add Surface Aggregator user-space interface
  -  aggregator: Add dedicated bus and device type
  -  aggregator: Add error injection capabilities
  -  aggregator: Add trace points
  -  aggregator: Add event item allocation caching
  -  aggregator: Add control packet allocation caching
  -  Add Surface Aggregator subsystem
  -  SURFACE_PLATFORMS should depend on ACPI
  -  surface_gpe: Fix non-PM_SLEEP build warnings
 
 platform/x86/intel-uncore-freq:
  -  Add Sapphire Rapids server support
 
 rtc:
  -  mrst: Remove driver for deprecated platform
 
 sony-laptop:
  -  Remove unneeded semicolon
 
 thinkpad_acpi:
  -  Replace ifdef CONFIG_ACPI_PLATFORM_PROFILE with depends on
  -  Fix 'warning: no previous prototype for' warnings
  -  Add platform profile support
  -  fixed warning and incorporated review comments
  -  rectify length of title underline
  -  Don't register keyboard_lang unnecessarily
  -  set keyboard language
  -  Add P53/73 firmware to fan_quirk_table for dual fan control
  -  correct palmsensor error checking
 
 tools/power/x86/intel-speed-select:
  -  Update version to 1.8
  -  Add new command to get/set TRL
  -  Add new command turbo-mode
  -  Set higher of cpuinfo_max_freq or base_frequency
  -  Set scaling_max_freq to base_frequency
 
 touchscreen_dmi:
  -  Add info for the Jumper EZpad 7 tablet
  -  Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet
 
 watchdog:
  -  intel-mid_wdt: Postpone IRQ handler registration till SCU is ready
  -  intel_scu_watchdog: Remove driver for deprecated platform
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmAqZ5cUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9zmuwf/XLoZzs6oW7Ps9DhkyU5lk7D79rti
 DY4AabVnWZhJ+Yl5+qMCTjC0R0nJYoq9PCDU5q20HHSFq7PXV0fPEVo7ZOp8tPng
 wdzb2glbtGjSWksjj3c8eB/jjPP0tpsWptH+9jlTv9yXwQNVh/rPVltmD+z8y69U
 qNzySltQMtoKmQKNbktUeHA12jBldnH+QlkL8KUp5ZEVDd7gukkmAovpzEcnwk5U
 lrza7I52c9Ggu1pD2OCX7an9tk6N7mQ6Rk2/c6GzRsOYa6SC5Aj7fi2bs0LRdGGx
 Kz/gtKS3dRIreEs4LGmL8byVi7a/YvCQoTfO+MxKq/btedBwxO2edDDsRg==
 =B+Fz
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:
 "Highlights:

   - Microsoft Surface devices System Aggregator Module support

   - SW_TABLET_MODE reporting improvements

   - thinkpad_acpi keyboard language setting support

   - platform / DPTF profile settings support:

      - Base / userspace API parts merged from Rafael's acpi-platform
        branch

      - thinkpad_acpi and ideapad-laptop support through pdx86

   - Remove support for some obsolete Intel MID platforms through
     merging of the shared intel-mid-removal branch

   - Big cleanup of the ideapad-laptop driver

   - Misc other fixes / new hw support / quirks"

* tag 'platform-drivers-x86-v5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (99 commits)
  platform/x86: intel_scu_ipc: Increase virtual timeout from 3 to 5 seconds
  platform/surface: aggregator: Fix access of unaligned value
  tools/power/x86/intel-speed-select: Update version to 1.8
  tools/power/x86/intel-speed-select: Add new command to get/set TRL
  tools/power/x86/intel-speed-select: Add new command turbo-mode
  Platform: OLPC: Constify static struct regulator_ops
  platform/surface: Add Surface Hot-Plug driver
  platform/x86: intel_scu_wdt: Drop mistakenly added const
  platform/x86: Kconfig: add missing selects for ideapad-laptop
  platform/x86: acer-wmi: Don't use ACPI_EXCEPTION()
  platform/x86: thinkpad_acpi: Replace ifdef CONFIG_ACPI_PLATFORM_PROFILE with depends on
  platform/x86: thinkpad_acpi: Fix 'warning: no previous prototype for' warnings
  platform/x86: msi-wmi: Fix variable 'status' set but not used compiler warning
  platform/surface: surface3-wmi: Fix variable 'status' set but not used compiler warning
  platform/x86: Move all dell drivers to their own subdirectory
  Documentation/ABI: sysfs-platform-ideapad-laptop: conservation_mode attribute
  Documentation/ABI: sysfs-platform-ideapad-laptop: update device attribute paths
  platform/x86: ideapad-laptop: add "always on USB charging" control support
  platform/x86: ideapad-laptop: add keyboard backlight control support
  platform/x86: ideapad-laptop: send notification about touchpad state change to sysfs
  ...
2021-02-22 08:50:01 -08:00
Linus Torvalds
3c8f504b3a ACPI updates for 5.12-rc1
- Update ACPICA code in the kernel to upstream revision 20201113
    with changes as follows:
 
    * Remove the MTMR (Mid-Timer) table (Al Stone).
    * Remove the VRTC table (Al Stone).
    * Add type casts for string functions (Bob Moore).
    * Update all copyrights to 2021 (Bob Moore).
    * Fix exception code class checks (Maximilian Luz).
    * Clean up exception code class checks (Maximilian Luz).
    * Fix -Wfallthrough (Nick Desaulniers).
 
  - Add support for setting and reading global profile of the platform
    along with documentation (Mark Pearson, Hans de Goede, Jiaxun Yang).
 
  - Fix fwnode properties matching and clean up the code handling
    device properties and its documentation (Rafael Wysocki, Andy
    Shevchenko).
 
  - Clean up ACPI-based device enumeration code (Rafael Wysocki).
 
  - Clean up the CPPC support library code (Ionela Voinescu).
 
  - Clean up the APEI support code (Yang Li, Yazen Ghannam).
 
  - Update GPIO-related properties documentation (Flavio Suligoi).
 
  - Consolidate and clean up the printing of messages in several
    places (Rafael Wysocki).
 
  - Fix error code path in configfs handling code (Qinglang Miao).
 
  - Use DEVICE_ATTR_<RW|RO|WO> macros where applicable (Dwaipayan Ray).
 
  - Replace tests for !ACPI_FAILURE with tests for ACPI_SUCCESS in
    multiple places (Bjorn Helgaas).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmAqu2wSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxyWYQAIGKknnitF3TxHyXj5Ka+RQXlvygYAZo
 9rQHy9EwUjkWpEiMZf87haWr3bp3EY1y7CnSdYiL9JgRJP9bqXI4ZQO8R2vXpV03
 NJ46NO7/qNGF1dp5Zbt/QSObkk1yloqNPzU3gH/yo+xNHEc0OzjD9roJr7QA1Oes
 ibCCmSG9mpMOVdNCzwIK+hiY6IdQCWIQyY/DZwTaf66U1+ZVTLsWNtVWzADNOKIz
 DcXW54LZAt7c8kNcwwRxqAac+JOQ/RWBpvnexwgPEV82blad/+nd9egHlTjiEJCl
 fxBmnMNqRcClrgo5SCvJNh1Z17d3bzhPUbF1K2RMiim2JSRXAZxK8euxVGTff2zI
 SKsgFcOqLPHYtM0po5V7fgYCRnk6M1aI44s26JCei5hSM1TrlwddKIuR/D42/73O
 F4TCGmkJMEUFltkpUAqo4gqoZcB7TZW/YX7pjy59yNw0VP8mGQSu+xU1SEdvasTg
 XYbVeFUoDe6QLGqu8ukDq7GeXnV16t6Q2b2A+RxmFaKFZGGUH+IPKQp1XbGLnhnM
 JKirrQnwwHqCZOu7D4LoSOgUvHYIF7B+nTA10QA5liq3XvYwjszFOG79cBImSaeV
 jxx7rgoZ55H45gfB2kQE6OwO7RmFZ4bEB4/k/Oav7ewOPFiY5hrxJt2OIaJYLE87
 pcGH533ZlBoS
 =WpL7
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20210105, fix and clean up the handling of device properties, add
  support for setting global profile of the platform, clean up device
  enumeration, the CPPC library, the APEI support and more, update the
  documentation, consolidate the printing of messages in several places
  and make assorted janitorial changes.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20201113 with
     changes as follows:

      * Remove the MTMR (Mid-Timer) table (Al Stone).
      * Remove the VRTC table (Al Stone).
      * Add type casts for string functions (Bob Moore).
      * Update all copyrights to 2021 (Bob Moore).
      * Fix exception code class checks (Maximilian Luz).
      * Clean up exception code class checks (Maximilian Luz).
      * Fix -Wfallthrough (Nick Desaulniers).

   - Add support for setting and reading global profile of the platform
     along with documentation (Mark Pearson, Hans de Goede, Jiaxun
     Yang).

   - Fix fwnode properties matching and clean up the code handling
     device properties and its documentation (Rafael Wysocki, Andy
     Shevchenko).

   - Clean up ACPI-based device enumeration code (Rafael Wysocki).

   - Clean up the CPPC support library code (Ionela Voinescu).

   - Clean up the APEI support code (Yang Li, Yazen Ghannam).

   - Update GPIO-related properties documentation (Flavio Suligoi).

   - Consolidate and clean up the printing of messages in several places
     (Rafael Wysocki).

   - Fix error code path in configfs handling code (Qinglang Miao).

   - Use DEVICE_ATTR_<RW|RO|WO> macros where applicable (Dwaipayan Ray).

   - Replace tests for !ACPI_FAILURE with tests for ACPI_SUCCESS in
     multiple places (Bjorn Helgaas)"

* tag 'acpi-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (44 commits)
  ACPI: property: Satisfy kernel doc validator (part 2)
  ACPI: property: Satisfy kernel doc validator (part 1)
  ACPI: property: Make acpi_node_prop_read() static
  ACPI: property: Remove dead code
  ACPI: property: Fix fwnode string properties matching
  ACPI: OSL: Clean up printing messages
  ACPI: OSL: Rework acpi_check_resource_conflict()
  ACPI: APEI: ERST: remove unneeded semicolon
  ACPI: thermal: Clean up printing messages
  ACPI: video: Clean up printing messages
  ACPI: button: Clean up printing messages
  ACPI: battery: Clean up printing messages
  ACPI: AC: Clean up printing messages
  ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more
  ACPI: utils: Clean up printing messages
  ACPI: scan: Clean up printing messages
  ACPI: bus: Clean up printing messages
  ACPI: PM: Clean up printing messages
  ACPI: power: Clean up printing messages
  ACPI: APEI: Add is_generic_error() to identify GHES sources
  ...
2021-02-20 21:50:59 -08:00
Rafael J. Wysocki
938bdd1d7d Merge back ACPICA material for v5.12. 2021-02-10 19:12:12 +01:00
Srinivas Pandruvada
2a76d235bc tools/power/x86/intel-speed-select: Update version to 1.8
Update version for changes released with v5.12 kernel release.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2021-02-08 11:56:55 -08:00
Srinivas Pandruvada
2c7dc57e9e tools/power/x86/intel-speed-select: Add new command to get/set TRL
Add a new command to get and set TRL (Turbo Ratio Limits). This will
help users to get/set TRL, when the direct MSR access is removed.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2021-02-08 11:54:58 -08:00
Srinivas Pandruvada
006050a6bd tools/power/x86/intel-speed-select: Add new command turbo-mode
Add a new command "turbo-mode", which allows to enable/disable
turbo mode globally. This uses base-frequency as the max frequency
when turbo-mode is disabled. This allows soft disable turbo mode
without depending on kernel or BIOS.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2021-02-08 11:54:58 -08:00
Rafael J. Wysocki
a51d185681 linux-cpupower-5.12-rc1
This cpupower update for Linux 5.12-rc1 consists of:
 
 - Updates to the cpupower command to add support for AMD family 0x19
   and cleanup the code to remove many of the family checks to make
   future family updates easier.
 
 - Adding Makefile dependencies for install targets to allow building
   cpupower in parallel rather than serially.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmAhYN8ACgkQCwJExA0N
 Qxz/RBAAr+HWZ13OaLRpuenQuD29p8z+ZrK1opU1lU9Is9w2ck3qIKwyPwVISWy3
 x8wlzyQzv6BxHTzSdWJ1IHn/dM8VOAuP3bCBrjrIUhflsX+X7Dst39tZX0Ne4X8z
 wGt3VFNYr5wbpClhb+Q2Fk1MMPSIte0stVvjsMPeSXZgAB1KPhesTYmnePimwv//
 kOKXGO3RKHtlfnkcQaljdnsyHalUtmsG48kmL6ex/WCN4D3Aojrlq1bIAfe5U+u0
 2iswYcrPiTY536B8E7d76zHyetat945nQ9TR2RRaF8kfEmoyCONFiGejXtSakAdv
 W1X/5I1egEO5a+oBNpieL7mPIoBZPU0vNXS8/zlYRu1zZ6BvNJ0FSJp1x9mnPME9
 16WcAq1uX6A30PlRPErrLqU5QgvQQqcxPKQBPK4kzCB5BBHUpbyunlcWaMmOOZ53
 ovV73ulugcaOcXlYrOdMPtD6DyFC2u70REveSq/pUk+L3rR6jEHKWyPXUNpIGsh4
 UNidy0bBSp45IbQHws3/e+2QP4Ida6sAqI8L2SnjzULQZtHxBsmffE/ks4WkdTzO
 D3crtAtTKWciSK6HkVgT+jUQnGWjZabrlqXrrY/jPx86hTwNYZhAgS+D4sx1uGrp
 r6mN9ye2vb9F/cK/P++I/gzJ7YU10kRdj9LuolvtwPkDFG6gyYk=
 =pqCu
 -----END PGP SIGNATURE-----

Merge tag 'linux-cpupower-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Pull cpupower utility update for v5.12-rc1 from Shuah Khan:

"This cpupower update for Linux 5.12-rc1 consists of:

 - Updates to the cpupower command to add support for AMD family 0x19
   and cleanup the code to remove many of the family checks to make
   future family updates easier.

 - Adding Makefile dependencies for install targets to allow building
   cpupower in parallel rather than serially."

* tag 'linux-cpupower-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  cpupower: Add cpuid cap flag for MSR_AMD_HWCR support
  cpupower: Remove family arg to decode_pstates()
  cpupower: Condense pstate enabled bit checks in decode_pstates()
  cpupower: Update family checks when decoding HW pstates
  cpupower: Remove unused pscur variable.
  cpupower: Add CPUPOWER_CAP_AMD_HW_PSTATE cpuid caps flag
  cpupower: Correct macro name for CPB caps flag
  cpupower: Update msr_pstate union struct naming
  cpupower: add Makefile dependencies for install targets
2021-02-08 17:38:25 +01:00
Borislav Petkov
7f1b11ba35 tools/power/turbostat: Fallback to an MSR read for EPB
Commit

  6d6501d912 ("tools/power/turbostat: Read energy_perf_bias from sysfs")

converted turbostat to read the energy_perf_bias value from sysfs.
However, older kernels which do not have that file yet, would fail. For
those, fall back to the MSR reading.

Fixes: 6d6501d912 ("tools/power/turbostat: Read energy_perf_bias from sysfs")
Reported-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Link: https://lkml.kernel.org/r/20210127132444.981120-1-dedekind1@gmail.com
2021-02-03 11:58:19 +01:00
Nathan Fontenot
3a3ecfdb60 cpupower: Add cpuid cap flag for MSR_AMD_HWCR support
Remove the family check for accessing the MSR_AMD_HWCR MSR and replace
it with a cpupower cap flag.

This update also allows for the removal of the local cpupower_cpu_info
variable in cpufreq_has_boost_support() since we no longer need it to
check the family.

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:45 -07:00
Nathan Fontenot
d1abc4e996 cpupower: Remove family arg to decode_pstates()
The decode_pstates() routine no longer uses the CPU family and
the caleed routines (get_cof() and get_did()) can grab the family
from the global cpupower_cpu_info struct. These update removes
passing the family arg to all these routines.

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:39 -07:00
Nathan Fontenot
56a85eebeb cpupower: Condense pstate enabled bit checks in decode_pstates()
The enabled bit (bit 63) is common for all families so we can remove
the multiple enabled checks based on family and have a common check
for HW pstate enabled.

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:32 -07:00
Nathan Fontenot
23765b82a8 cpupower: Update family checks when decoding HW pstates
The family checks in get_cof() and get_did() need to use the
correct MSR format depending on the family. Add a cpupower
capability for using the pstatedef (family 17h and newer) to
control this instead of direct family checks.

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:26 -07:00
Nathan Fontenot
1421de7919 cpupower: Remove unused pscur variable.
The pscur variable is set but not uused, just remove it.

This may have previsously been set to validate the MSR_AMD_PSTATE_STATUS
MSR. With the addition of the CPUPOWER_CAP_AMD_HW_PSTATE cap flag this
is no longer needed since the cpuid bit to enable this cap flag also
validates that the MSR_AMD_PSTATE_STATUS MSR is present.

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:21 -07:00
Nathan Fontenot
a0255a76bf cpupower: Add CPUPOWER_CAP_AMD_HW_PSTATE cpuid caps flag
Add a check in get_cpu_info() for the ability to read frequencies
from hardware and set the CPUPOWER_CAP_AMD_HW_PSTATE cpuid flag.
The cpuid flag is set when CPUID_80000007_EDX[7] is set,
which is all families >= 10h. The check excludes family 14h
because HW pstate reporting was not implemented on family 14h.

This is intended to reduce family checks in the main code paths.

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Reviewed-by: skhan@linuxfoundation.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:15 -07:00
Robert Richter
7a136a8fcd cpupower: Correct macro name for CPB caps flag
The name is Core Performance Boost (CPB) for the cpuid flag. Correct
cpuid caps flag to use this name (instead of CBP).

Signed-off-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:40:08 -07:00
Nathan Fontenot
629d512d68 cpupower: Update msr_pstate union struct naming
The msr_pstate union struct named fam17h_bits is misleading since
this is the struct to use for all families >= 0x17, not just
for family 0x17. Rename the bits structs to be 'pstate' (for pre
family 17h CPUs) and 'pstatedef' (for CPUs since fam 17h) to align
closer with PPR/BDKG (1) naming.

There are no functional changes as part of this update.

1: AMD Processor Programming Reference (PPR) and BIOS and
Kernel Developer's Guide (BKDG) available at:
http://developer.amd.com/resources/developer-guides-manuals

Signed-off-by: Nathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Reviewed-by: skhan@linuxfoundation.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-26 09:39:54 -07:00
Bob Moore
4441e55d50 ACPICA: Updated all copyrights to 2021
This affects all ACPICA source code modules.

ACPICA commit c570953c914437e621dd5f160f26ddf352e0d2f4

Link: https://github.com/acpica/acpica/commit/c570953c
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-01-22 15:51:53 +01:00
Ivan Babrou
fb7791e213 cpupower: add Makefile dependencies for install targets
This allows building cpupower in parallel rather than serially.

Signed-off-by: Ivan Babrou <ivan@cloudflare.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-01-05 11:29:27 -07:00
Srinivas Pandruvada
bbaa2e95e2 tools/power/x86/intel-speed-select: Set higher of cpuinfo_max_freq or base_frequency
In some case when BIOS disabled turbo, cpufreq cpuinfo_max_freq can be
lower than base_frequency at higher config level. So, in that case set
scaling_min_freq to base_frequency.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20201221071859.2783957-3-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-01-04 15:54:27 +01:00
Srinivas Pandruvada
f981dc171c tools/power/x86/intel-speed-select: Set scaling_max_freq to base_frequency
When BIOS disables turbo, The scaling_max_freq in cpufreq sysfs will be
limited to config level 0 base frequency. But when user selects a higher
config levels, this will result in higher base frequency. But since
scaling_max_freq is still old base frequency, the performance will still
be limited. So when the turbo is disabled and cpufreq base_frequency is
higher than scaling_max_freq, update the scaling_max_freq to the
base_frequency.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20201221071859.2783957-2-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-01-04 15:54:27 +01:00
Linus Torvalds
7b95f0563a Kbuild updates for v5.11
- Use /usr/bin/env for shebang lines in scripts
 
  - Remove useless -Wnested-externs warning flag
 
  - Update documents
 
  - Refactor log handling in modpost
 
  - Stop building modules without MODULE_LICENSE() tag
 
  - Make the insane combination of 'static' and EXPORT_SYMBOL an error
 
  - Improve genksyms to handle _Static_assert()
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCgAzFiEEbmPs18K1szRHjPqEPYsBB53g2wYFAl/iIY8VHG1hc2FoaXJv
 eUBrZXJuZWwub3JnAAoJED2LAQed4NsGbfsP+gMv3F+ztqfYNoMNmZcj+fLh4zrA
 8I3d0t0AoxovV1bsyVDk9nebsYLbDdsyCdHM1ZNFAFEpf9QLL8sxtpHvaaxy+rCq
 PCmy+E6iO5B91oORhuqpYpcmmgPHf4RrpUcnEEiWOMrHE5giYbXz3AiqGAt/88J5
 Y8yaPCQVhNJNkx73KHCMYLVp97xPGa5HvNrcskAueA8uG+FCRDFaIqFX+OYbGnmC
 /3kVAJmX6i2kNPzvnXpAW6mTbI/z7+s/k5yRbEFYNUtJqN+BfaFadV8pyOGXQr1T
 fwXVtXdWqVg7rbqupyVYItLHaOq2RBm4PJuee/8s7ooBI1y7U6N0HZCj+jES92ML
 wuqEyED+lLzmxRyfhmrFH/5XhxacciO7dQb9Woe5FQ6QOm+tQPtwCnxwrSSAK4XU
 k7CsJ+OMJI+JulFrgPuC/rcESjTAsgL2j4SDhsO0GLV+Qb/P9kXR88jt5eJygmSx
 xZWpI+FUUY/Ihw648i2pkHGS/NmfOrT78X4nvbOWMDKOV02NEoMmLDYnZPUIoetn
 yUo8+xSBp6n3aTy5TDtrMblNRUJwL9OzDlDiEjsPtNUJZ6sdQzFRsxJ7+FCw2Ley
 rKN2r+i5FdyAq0LLHDhoEcJxFY7cj+yAsd0QqtBb0NZLgLsaPiP7w45CXRNpqkWG
 BbK+F1E9jP8VfiZu
 =+27V
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada:

 - Use /usr/bin/env for shebang lines in scripts

 - Remove useless -Wnested-externs warning flag

 - Update documents

 - Refactor log handling in modpost

 - Stop building modules without MODULE_LICENSE() tag

 - Make the insane combination of 'static' and EXPORT_SYMBOL an error

 - Improve genksyms to handle _Static_assert()

* tag 'kbuild-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  Documentation/kbuild: Document platform dependency practises
  Documentation/kbuild: Document COMPILE_TEST dependencies
  genksyms: Ignore module scoped _Static_assert()
  modpost: turn static exports into error
  modpost: turn section mismatches to error from fatal()
  modpost: change license incompatibility to error() from fatal()
  modpost: turn missing MODULE_LICENSE() into error
  modpost: refactor error handling and clarify error/fatal difference
  modpost: rename merror() to error()
  kbuild: don't hardcode depmod path
  kbuild: doc: document subdir-y syntax
  kbuild: doc: clarify the difference between extra-y and always-y
  kbuild: doc: split if_changed explanation to a separate section
  kbuild: doc: merge 'Special Rules' and 'Custom kbuild commands' sections
  kbuild: doc: fix 'List directories to visit when descending' section
  kbuild: doc: replace arch/$(ARCH)/ with arch/$(SRCARCH)/
  kbuild: doc: update the description about kbuild Makefiles
  Makefile.extrawarn: remove -Wnested-externs warning
  tweewide: Fix most Shebang lines
2020-12-22 14:02:39 -08:00
Linus Torvalds
b4ec805464 Power management updates for 5.11-rc1
- Use local_clock() instead of jiffies in the cpufreq statistics to
    improve accuracy (Viresh Kumar).
 
  - Fix up OPP usage in the cpufreq-dt and qcom-cpufreq-nvmem cpufreq
    drivers (Viresh Kumar).
 
  - Clean up the cpufreq core, the intel_pstate driver and the
    schedutil cpufreq governor (Rafael Wysocki).
 
  - Fix up error code paths in the sti-cpufreq and mediatek cpufreq
    drivers (Yangtao Li, Qinglang Miao).
 
  - Fix cpufreq_online() to return error codes instead of success (0)
    in all cases when it fails (Wang ShaoBo).
 
  - Add mt8167 support to the mediatek cpufreq driver and blacklist
    mt8516 in the cpufreq-dt-platdev driver (Fabien Parent).
 
  - Modify the tegra194 cpufreq driver to always return values from
    the frequency table as the current frequency and clean up that
    driver (Sumit Gupta, Jon Hunter).
 
  - Modify the arm_scmi cpufreq driver to allow it to discover the
    power scale present in the performance protocol and provide this
    information to the Energy Model (Lukasz Luba).
 
  - Add missing MODULE_DEVICE_TABLE to several cpufreq drivers (Pali
    Rohár).
 
  - Clean up the CPPC cpufreq driver (Ionela Voinescu).
 
  - Fix NVMEM_IMX_OCOTP dependency in the imx cpufreq driver (Arnd
    Bergmann).
 
  - Rework the poling interval selection for the polling state in
    cpuidle (Mel Gorman).
 
  - Enable suspend-to-idle for PSCI OSI mode in the PSCI cpuidle
    driver (Ulf Hansson).
 
  - Modify the OPP framework to support empty (node-less) OPP tables
    in DT for passing dependency information (Nicola Mazzucato).
 
  - Fix potential lockdep issue in the OPP core and clean up the OPP
    core (Viresh Kumar).
 
  - Modify dev_pm_opp_put_regulators() to accept a NULL argument and
    update its users accordingly (Viresh Kumar).
 
  - Add frequency changes tracepoint to devfreq (Matthias Kaehlcke).
 
  - Add support for governor feature flags to devfreq, make devfreq
    sysfs file permissions depend on the governor and clean up the
    devfreq core (Chanwoo Choi).
 
  - Clean up the tegra20 devfreq driver and deprecate it to allow
    another driver based on EMC_STAT to be used instead of it (Dmitry
    Osipenko).
 
  - Add interconnect support to the tegra30 devfreq driver, allow it
    to take the interconnect and OPP information from DT and clean it
    up ((Dmitry Osipenko).
 
  - Add interconnect support to the exynos-bus devfreq driver along
    with interconnect properties documentation (Sylwester Nawrocki).
 
  - Add suport for AMD Fam17h and Fam19h processors to the RAPL power
    capping driver (Victor Ding, Kim Phillips).
 
  - Fix handling of overly long constraint names in the powercap
    framework (Lukasz Luba).
 
  - Fix the wakeup configuration handling for bridges in the ACPI
    device power management core (Rafael Wysocki).
 
  - Add support for using an abstract scale for power units in the
    Energy Model (EM) and document it (Lukasz Luba).
 
  - Add em_cpu_energy() micro-optimization to the EM (Pavankumar
    Kondeti).
 
  - Modify the generic power domains (genpd) framwework to support
    suspend-to-idle (Ulf Hansson).
 
  - Fix creation of debugfs nodes in genpd (Thierry Strudel).
 
  - Clean up genpd (Lina Iyer).
 
  - Clean up the core system-wide suspend code and make it print
    driver flags for devices with debug enabled (Alex Shi, Patrice
    Chotard, Chen Yu).
 
  - Modify the ACPI system reboot code to make it prepare for system
    power off to avoid confusing the platform firmware (Kai-Heng Feng).
 
  - Update the pm-graph (multiple changes, mostly usability-related)
    and cpupower (online and offline CPU information support) PM
    utilities (Todd Brandt, Brahadambal Srinivasan).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl/Y8mcSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxjY4QAKsNFJeEtjGCxq7MxQIML3QLAsdJM9of
 9kkY9skMEw4v1TRmyy7sW9jZW2pLSRcLJwWRKWu4143qUS3YUp2DQ0lqX4WyXoWu
 BhnkhkMUl6iCeBO8CWnt8zsTuqSa20A13sL9LyqN1+7OZKHD8StbT4hKjBncdNNN
 4aDj+1uAPyOgj2iCUZuHQ8DtpBvOLjgTh367vbhbufjeJ//8/9+R7s4Xzrj7wtmv
 JlE0LDgvge9QeGTpjhxQJzn0q2/H5fg9jbmjPXUfbHJNuyKhrqnmjGyrN5m256JI
 8DqGqQtJpmFp7Ihrur3uKTk3gWO05YwJ1FdeEooAKEjEMObm5xuYhKVRoDhmlJAu
 G6ui+OAUvNR0FffJtbzvWe/pLovLGOEOHdvTrZxUF8Abo6br3untTm8rKTi1fhaF
 wWndSMw0apGsPzCx5T+bE7AbJz2QHFpLhaVAutenuCzNI8xoMlxNKEzsaVz/+FqL
 Pq/PdFaM4vNlMbv7hkb/fujkCs/v3EcX2ihzvt7I2o8dBS0D1X8A4mnuWJmiGslw
 1ftbJ6M9XacwkPBTHPgeXxJh2C1yxxe5VQ9Z5fWWi7sPOUeJnUwxKaluv+coFndQ
 sO6JxsPQ4hQihg8yOxLEkL6Wn68sZlmp+u2Oj+TPFAsAGANIA8rJlBPo1ppJWvdQ
 j1OCIc/qzwpH
 =BVdX
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "These update cpufreq (core and drivers), cpuidle (polling state
  implementation and the PSCI driver), the OPP (operating performance
  points) framework, devfreq (core and drivers), the power capping RAPL
  (Running Average Power Limit) driver, the Energy Model support, the
  generic power domains (genpd) framework, the ACPI device power
  management, the core system-wide suspend code and power management
  utilities.

  Specifics:

   - Use local_clock() instead of jiffies in the cpufreq statistics to
     improve accuracy (Viresh Kumar).

   - Fix up OPP usage in the cpufreq-dt and qcom-cpufreq-nvmem cpufreq
     drivers (Viresh Kumar).

   - Clean up the cpufreq core, the intel_pstate driver and the
     schedutil cpufreq governor (Rafael Wysocki).

   - Fix up error code paths in the sti-cpufreq and mediatek cpufreq
     drivers (Yangtao Li, Qinglang Miao).

   - Fix cpufreq_online() to return error codes instead of success (0)
     in all cases when it fails (Wang ShaoBo).

   - Add mt8167 support to the mediatek cpufreq driver and blacklist
     mt8516 in the cpufreq-dt-platdev driver (Fabien Parent).

   - Modify the tegra194 cpufreq driver to always return values from the
     frequency table as the current frequency and clean up that driver
     (Sumit Gupta, Jon Hunter).

   - Modify the arm_scmi cpufreq driver to allow it to discover the
     power scale present in the performance protocol and provide this
     information to the Energy Model (Lukasz Luba).

   - Add missing MODULE_DEVICE_TABLE to several cpufreq drivers (Pali
     Rohár).

   - Clean up the CPPC cpufreq driver (Ionela Voinescu).

   - Fix NVMEM_IMX_OCOTP dependency in the imx cpufreq driver (Arnd
     Bergmann).

   - Rework the poling interval selection for the polling state in
     cpuidle (Mel Gorman).

   - Enable suspend-to-idle for PSCI OSI mode in the PSCI cpuidle driver
     (Ulf Hansson).

   - Modify the OPP framework to support empty (node-less) OPP tables in
     DT for passing dependency information (Nicola Mazzucato).

   - Fix potential lockdep issue in the OPP core and clean up the OPP
     core (Viresh Kumar).

   - Modify dev_pm_opp_put_regulators() to accept a NULL argument and
     update its users accordingly (Viresh Kumar).

   - Add frequency changes tracepoint to devfreq (Matthias Kaehlcke).

   - Add support for governor feature flags to devfreq, make devfreq
     sysfs file permissions depend on the governor and clean up the
     devfreq core (Chanwoo Choi).

   - Clean up the tegra20 devfreq driver and deprecate it to allow
     another driver based on EMC_STAT to be used instead of it (Dmitry
     Osipenko).

   - Add interconnect support to the tegra30 devfreq driver, allow it to
     take the interconnect and OPP information from DT and clean it up
     (Dmitry Osipenko).

   - Add interconnect support to the exynos-bus devfreq driver along
     with interconnect properties documentation (Sylwester Nawrocki).

   - Add suport for AMD Fam17h and Fam19h processors to the RAPL power
     capping driver (Victor Ding, Kim Phillips).

   - Fix handling of overly long constraint names in the powercap
     framework (Lukasz Luba).

   - Fix the wakeup configuration handling for bridges in the ACPI
     device power management core (Rafael Wysocki).

   - Add support for using an abstract scale for power units in the
     Energy Model (EM) and document it (Lukasz Luba).

   - Add em_cpu_energy() micro-optimization to the EM (Pavankumar
     Kondeti).

   - Modify the generic power domains (genpd) framwework to support
     suspend-to-idle (Ulf Hansson).

   - Fix creation of debugfs nodes in genpd (Thierry Strudel).

   - Clean up genpd (Lina Iyer).

   - Clean up the core system-wide suspend code and make it print driver
     flags for devices with debug enabled (Alex Shi, Patrice Chotard,
     Chen Yu).

   - Modify the ACPI system reboot code to make it prepare for system
     power off to avoid confusing the platform firmware (Kai-Heng Feng).

   - Update the pm-graph (multiple changes, mostly usability-related)
     and cpupower (online and offline CPU information support) PM
     utilities (Todd Brandt, Brahadambal Srinivasan)"

* tag 'pm-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (86 commits)
  cpufreq: Fix cpufreq_online() return value on errors
  cpufreq: Fix up several kerneldoc comments
  cpufreq: stats: Use local_clock() instead of jiffies
  cpufreq: schedutil: Simplify sugov_update_next_freq()
  cpufreq: intel_pstate: Simplify intel_cpufreq_update_pstate()
  PM: domains: create debugfs nodes when adding power domains
  opp: of: Allow empty opp-table with opp-shared
  dt-bindings: opp: Allow empty OPP tables
  media: venus: dev_pm_opp_put_*() accepts NULL argument
  drm/panfrost: dev_pm_opp_put_*() accepts NULL argument
  drm/lima: dev_pm_opp_put_*() accepts NULL argument
  PM / devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument
  cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument
  cpufreq: dt: dev_pm_opp_put_regulators() accepts NULL argument
  opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table
  opp: Don't create an OPP table from dev_pm_opp_get_opp_table()
  cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP table
  opp: Reduce the size of critical section in _opp_kref_release()
  PM / EM: Micro optimization in em_cpu_energy
  cpufreq: arm_scmi: Discover the power scale in performance protocol
  ...
2020-12-15 16:30:31 -08:00
Linus Torvalds
61f914256c platform-drivers-x86 for v5.11-1
Highlights:
 - New driver for changing BIOS settings from within Linux on Dell devices,
   this introduces a new generic sysfs API for this. Lenovo is working on
   also supporting this API on their devices
 - New Intel PMT telemetry and crashlog drivers
 - Support for SW_TABLET_MODE reporting for the acer-wmi and intel-hid drivers
 - Preparation work for improving support for Microsoft Surface hardware
 - Various fixes / improvements / quirks for the panasonic-laptop and others
 
 The following is an automated git shortlog grouped by driver:
 
 ISST:
  -  Mark mmio_range_devid_0 and mmio_range_devid_1 with static keyword
  -  Change PCI device macros
  -  Allow configurable offset range
  -  Check for unaligned mmio address
 
 Intel PMT Crashlog capability driver:
  - Intel PMT Crashlog capability driver
 
 Intel PMT Telemetry capability driver:
  - Intel PMT Telemetry capability driver
 
 Intel PMT class driver:
  - Intel PMT class driver
 
 Introduce support for Systems Management Driver over WMI for Dell Systems:
  - Introduce support for Systems Management Driver over WMI for Dell Systems
 
 MAINTAINERS:
  -  new panasonic-laptop maintainer
  -  rectify DELL WMI SYSMAN DRIVERS section
 
 Merge tag 'ib-mfd-x86-v5.11' into review-hans:
  - Merge tag 'ib-mfd-x86-v5.11' into review-hans
 
 PCI:
  -  Add defines for Designated Vendor-Specific Extended Capability
 
 Revert "platform/x86:
  -  wmi: Destroy on cleanup rather than unregister"
 
 acer-wireless:
  -  send an EV_SYN/SYN_REPORT between state changes
 
 acer-wmi:
  -  Add ACER_CAP_KBD_DOCK quirk for the Aspire Switch 10E SW3-016
  -  add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
  -  Add support for SW_TABLET_MODE on Switch devices
  -  Add ACER_CAP_SET_FUNCTION_MODE capability flag
  -  Add new force_caps module parameter
  -  Cleanup accelerometer device handling
  -  Cleanup ACER_CAP_FOO defines
  -  Drop no-op set_quirks call from find_quirks
 
 amd-pmc:
  -  Add AMD platform support for S2Idle
 
 asus-wmi:
  -  Add userspace notification for performance mode change
  -  Add support for SW_TABLET_MODE on UX360
 
 dell-smbios-base:
  -  Fix error return code in dell_smbios_init
 
 dell-wmi-sysman:
  -  work around for BIOS bug
  -  fix init_bios_attributes() error handling
 
 docs:
  -  ABI: sysfs-class-firmware-attributes: solve some warnings
 
 i2c-multi-instantiate:
  -  Use device_get_match_data() to get driver data
  -  Simplify with dev_err_probe()
  -  Drop redundant ACPI_PTR()
 
 intel-hid:
  -  add Rocket Lake ACPI device ID
  -  Do not create SW_TABLET_MODE input-dev when a KIOX010A ACPI dev is present
  -  Add alternative method to enable switches
  -  Add support for SW_TABLET_MODE
  -  fix _DSM function index handling
 
 intel-vbtn:
  -  Fix SW_TABLET_MODE always reporting 1 on some HP x360 models
  -  Allow switch events on Acer Switch Alpha 12
  -  Support for tablet mode on HP Pavilion 13 x360 PC
 
 intel_pmc_core:
  -  Assign boolean values to a bool variable
 
 mfd:
  -  Intel Platform Monitoring Technology support
 
 mlx-platform:
  -  Fix item counter assignment for MSN2700/ComEx system
  -  Fix item counter assignment for MSN2700, MSN24xx systems
  -  remove an unused variable
  -  Remove PSU EEPROM from MSN274x platform configuration
  -  Remove PSU EEPROM from default platform configuration
 
 panasonic-laptop:
  -  Add sysfs attributes for firmware brightness registers
  -  Add support for battery charging threshold (eco mode)
  -  Resolve hotkey double trigger bug
  -  Add write support to mute
  -  Fix sticky key init bug
  -  Fix naming of platform files for consistency with other modules
  -  Split MODULE_AUTHOR() by one author per macro call
  -  Replace ACPI prints with pr_*() macros
  -  Add support for optical driver power in Y and W series
 
 platform:
  -  Add Surface platform directory
 
 platform/mellanox:
  -  mlxbf-pmc: Add Mellanox BlueField PMC driver
 
 platform/surface:
  -  gpe: Add support for 15" Intel version of Surface Laptop 3
  -  Add Driver to set up lid GPEs on MS Surface device
  -  Move Surface Pro 3 Button driver to platform/surface
  -  Move Surface 3 Power OpRegion driver to platform/surface
  -  Move Surface 3 Button driver to platform/surface
  -  Move Surface 3 WMI driver to platform/surface
 
 platform/x86/dell-wmi-sysman:
  -  Make some symbols static
  -  Make wmi_sysman_kobj_sysfs_ops static
 
 pmt:
  -  Fix a potential Oops on error in probe
 
 remove unneeded break:
  - remove unneeded break
 
 thinkpad_acpi:
  -  remove trailing semicolon in macro definition
  -  Whitelist P15 firmware for dual fan control
  -  Add palm sensor support
  -  Send tablet mode switch at wakeup time
  -  Add BAT1 is primary battery quirk for Thinkpad Yoga 11e 4th gen
  -  Do not report SW_TABLET_MODE on Yoga 11e
  -  add P1 gen3 second fan support
 
 tools/power/x86/intel-speed-select:
  -  Update version for v5.11
  -  Account for missing sysfs for die_id
  -  Read TRL from mailbox
 
 toshiba_acpi:
  -  Fix the wrong variable assignment
 
 touchscreen_dmi:
  -  Add info for the Irbis TW118 tablet
  -  Add info for the Predia Basic tablet
 
 x86/platform:
  -  classmate-laptop: add WiFi media button
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAl/XTkEUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9z5EAf7BzqZDyFBpsDd8+o0FsjCq1DEzw0R
 lZdhZt65wSMqe0sndgfStPQG1yet8JgABgq8aCkBQLhj55hjiOUYHe5iXmylSRQn
 iWhu2xI+qYb9rhPW3lYilGcWAIfC5jrEZHFLtpXKx/p5iwCJQRvI6sV8HwcwJjnQ
 p3eyxIUEQieAtO90scqsOWZTKtT/no9UMTLbZwrO3Spv05WGopIMtkHPWYTd96pa
 6SRBdhZj3mrHHc7mRe0u4Wx2dzeUwiPLfubt/kmRPoo1HWTGE2Ck4KPqN/nSY3R2
 z882CMZjWpbwoc3OP2fK26uIHjTh45+yVH8DVZbaQW9BWIOdE87iADzuWA==
 =Df8H
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:
 "Highlights:

   - New driver for changing BIOS settings from within Linux on Dell
     devices. This introduces a new generic sysfs API for this. Lenovo
     is working on also supporting this API on their devices

   - New Intel PMT telemetry and crashlog drivers

   - Support for SW_TABLET_MODE reporting for the acer-wmi and intel-hid
     drivers

   - Preparation work for improving support for Microsoft Surface
     hardware

   - Various fixes / improvements / quirks for the panasonic-laptop and
     others"

* tag 'platform-drivers-x86-v5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (81 commits)
  platform/x86: ISST: Mark mmio_range_devid_0 and mmio_range_devid_1 with static keyword
  platform/x86: intel-hid: add Rocket Lake ACPI device ID
  x86/platform: classmate-laptop: add WiFi media button
  platform/x86: mlx-platform: Fix item counter assignment for MSN2700/ComEx system
  platform/x86: mlx-platform: Fix item counter assignment for MSN2700, MSN24xx systems
  tools/power/x86/intel-speed-select: Update version for v5.11
  tools/power/x86/intel-speed-select: Account for missing sysfs for die_id
  tools/power/x86/intel-speed-select: Read TRL from mailbox
  platform/x86: intel-hid: Do not create SW_TABLET_MODE input-dev when a KIOX010A ACPI dev is present
  platform/x86: intel-hid: Add alternative method to enable switches
  platform/x86: intel-hid: Add support for SW_TABLET_MODE
  platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on some HP x360 models
  platform/x86: ISST: Change PCI device macros
  platform/x86: ISST: Allow configurable offset range
  platform/x86: ISST: Check for unaligned mmio address
  acer-wireless: send an EV_SYN/SYN_REPORT between state changes
  platform/x86: dell-wmi-sysman: work around for BIOS bug
  platform/x86: mlx-platform: remove an unused variable
  platform/x86: thinkpad_acpi: remove trailing semicolon in macro definition
  platform/x86: dell-smbios-base: Fix error return code in dell_smbios_init
  ...
2020-12-15 16:10:17 -08:00
Linus Torvalds
d635a69dd4 Networking updates for 5.11
Core:
 
  - support "prefer busy polling" NAPI operation mode, where we defer softirq
    for some time expecting applications to periodically busy poll
 
  - AF_XDP: improve efficiency by more batching and hindering
            the adjacency cache prefetcher
 
  - af_packet: make packet_fanout.arr size configurable up to 64K
 
  - tcp: optimize TCP zero copy receive in presence of partial or unaligned
         reads making zero copy a performance win for much smaller messages
 
  - XDP: add bulk APIs for returning / freeing frames
 
  - sched: support fragmenting IP packets as they come out of conntrack
 
  - net: allow virtual netdevs to forward UDP L4 and fraglist GSO skbs
 
 BPF:
 
  - BPF switch from crude rlimit-based to memcg-based memory accounting
 
  - BPF type format information for kernel modules and related tracing
    enhancements
 
  - BPF implement task local storage for BPF LSM
 
  - allow the FENTRY/FEXIT/RAW_TP tracing programs to use bpf_sk_storage
 
 Protocols:
 
  - mptcp: improve multiple xmit streams support, memory accounting and
           many smaller improvements
 
  - TLS: support CHACHA20-POLY1305 cipher
 
  - seg6: add support for SRv6 End.DT4/DT6 behavior
 
  - sctp: Implement RFC 6951: UDP Encapsulation of SCTP
 
  - ppp_generic: add ability to bridge channels directly
 
  - bridge: Connectivity Fault Management (CFM) support as is defined in
            IEEE 802.1Q section 12.14.
 
 Drivers:
 
  - mlx5: make use of the new auxiliary bus to organize the driver internals
 
  - mlx5: more accurate port TX timestamping support
 
  - mlxsw:
    - improve the efficiency of offloaded next hop updates by using
      the new nexthop object API
    - support blackhole nexthops
    - support IEEE 802.1ad (Q-in-Q) bridging
 
  - rtw88: major bluetooth co-existance improvements
 
  - iwlwifi: support new 6 GHz frequency band
 
  - ath11k: Fast Initial Link Setup (FILS)
 
  - mt7915: dual band concurrent (DBDC) support
 
  - net: ipa: add basic support for IPA v4.5
 
 Refactor:
 
  - a few pieces of in_interrupt() cleanup work from Sebastian Andrzej Siewior
 
  - phy: add support for shared interrupts; get rid of multiple driver
         APIs and have the drivers write a full IRQ handler, slight growth
 	of driver code should be compensated by the simpler API which
 	also allows shared IRQs
 
  - add common code for handling netdev per-cpu counters
 
  - move TX packet re-allocation from Ethernet switch tag drivers to
    a central place
 
  - improve efficiency and rename nla_strlcpy
 
  - number of W=1 warning cleanups as we now catch those in a patchwork
    build bot
 
 Old code removal:
 
  - wan: delete the DLCI / SDLA drivers
 
  - wimax: move to staging
 
  - wifi: remove old WDS wifi bridging support
 
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE6jPA+I1ugmIBA4hXMUZtbf5SIrsFAl/YXmUACgkQMUZtbf5S
 IrvSQBAAgOrt4EFopEvVqlTHZbqI45IEqgtXS+YWmlgnjZCgshyMj8q1yK1zzane
 qYxr/NNJ9kV3FdtaynmmHPgEEEfR5kJ/D3B2BsxYDkaDDrD0vbNsBGw+L+/Gbhxl
 N/5l/9FjLyLY1D+EErknuwR5XGuQ6BSDVaKQMhYOiK2hgdnAAI4hszo8Chf6wdD0
 XDBslQ7vpD/05r+eMj0IkS5dSAoGOIFXUxhJ5dqrDbRHiKsIyWqA3PLbYemfAhxI
 s2XckjfmSgGE3FKL8PSFu+EcfHbJQQjLcULJUnqgVcdwEEtRuE9ggEi52nZRXMWM
 4e8sQJAR9Fx7pZy0G1xfS149j6iPU5LjRlU9TNSpVABz14Vvvo3gEL6gyIdsz+xh
 hMN7UBdp0FEaP028CXoIYpaBesvQqj0BSndmee8qsYAtN6j+QKcM2AOSr7JN1uMH
 C/86EDoGAATiEQIVWJvnX5MPmlAoblyLA+RuVhmxkIBx2InGXkFmWqRkXT5l4jtk
 LVl8/TArR4alSQqLXictXCjYlCm9j5N4zFFtEVasSYi7/ZoPfgRNWT+lJ2R8Y+Zv
 +htzGaFuyj6RJTVeFQMrkl3whAtBamo2a0kwg45NnxmmXcspN6kJX1WOIy82+MhD
 Yht7uplSs7MGKA78q/CDU0XBeGjpABUvmplUQBIfrR/jKLW2730=
 =GXs1
 -----END PGP SIGNATURE-----

Merge tag 'net-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

Pull networking updates from Jakub Kicinski:
 "Core:

   - support "prefer busy polling" NAPI operation mode, where we defer
     softirq for some time expecting applications to periodically busy
     poll

   - AF_XDP: improve efficiency by more batching and hindering the
     adjacency cache prefetcher

   - af_packet: make packet_fanout.arr size configurable up to 64K

   - tcp: optimize TCP zero copy receive in presence of partial or
     unaligned reads making zero copy a performance win for much smaller
     messages

   - XDP: add bulk APIs for returning / freeing frames

   - sched: support fragmenting IP packets as they come out of conntrack

   - net: allow virtual netdevs to forward UDP L4 and fraglist GSO skbs

  BPF:

   - BPF switch from crude rlimit-based to memcg-based memory accounting

   - BPF type format information for kernel modules and related tracing
     enhancements

   - BPF implement task local storage for BPF LSM

   - allow the FENTRY/FEXIT/RAW_TP tracing programs to use
     bpf_sk_storage

  Protocols:

   - mptcp: improve multiple xmit streams support, memory accounting and
     many smaller improvements

   - TLS: support CHACHA20-POLY1305 cipher

   - seg6: add support for SRv6 End.DT4/DT6 behavior

   - sctp: Implement RFC 6951: UDP Encapsulation of SCTP

   - ppp_generic: add ability to bridge channels directly

   - bridge: Connectivity Fault Management (CFM) support as is defined
     in IEEE 802.1Q section 12.14.

  Drivers:

   - mlx5: make use of the new auxiliary bus to organize the driver
     internals

   - mlx5: more accurate port TX timestamping support

   - mlxsw:
      - improve the efficiency of offloaded next hop updates by using
        the new nexthop object API
      - support blackhole nexthops
      - support IEEE 802.1ad (Q-in-Q) bridging

   - rtw88: major bluetooth co-existance improvements

   - iwlwifi: support new 6 GHz frequency band

   - ath11k: Fast Initial Link Setup (FILS)

   - mt7915: dual band concurrent (DBDC) support

   - net: ipa: add basic support for IPA v4.5

  Refactor:

   - a few pieces of in_interrupt() cleanup work from Sebastian Andrzej
     Siewior

   - phy: add support for shared interrupts; get rid of multiple driver
     APIs and have the drivers write a full IRQ handler, slight growth
     of driver code should be compensated by the simpler API which also
     allows shared IRQs

   - add common code for handling netdev per-cpu counters

   - move TX packet re-allocation from Ethernet switch tag drivers to a
     central place

   - improve efficiency and rename nla_strlcpy

   - number of W=1 warning cleanups as we now catch those in a patchwork
     build bot

  Old code removal:

   - wan: delete the DLCI / SDLA drivers

   - wimax: move to staging

   - wifi: remove old WDS wifi bridging support"

* tag 'net-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1922 commits)
  net: hns3: fix expression that is currently always true
  net: fix proc_fs init handling in af_packet and tls
  nfc: pn533: convert comma to semicolon
  af_vsock: Assign the vsock transport considering the vsock address flags
  af_vsock: Set VMADDR_FLAG_TO_HOST flag on the receive path
  vsock_addr: Check for supported flag values
  vm_sockets: Add VMADDR_FLAG_TO_HOST vsock flag
  vm_sockets: Add flags field in the vsock address data structure
  net: Disable NETIF_F_HW_TLS_TX when HW_CSUM is disabled
  tcp: Add logic to check for SYN w/ data in tcp_simple_retransmit
  net: mscc: ocelot: install MAC addresses in .ndo_set_rx_mode from process context
  nfc: s3fwrn5: Release the nfc firmware
  net: vxget: clean up sparse warnings
  mlxsw: spectrum_router: Use eXtended mezzanine to offload IPv4 router
  mlxsw: spectrum: Set KVH XLT cache mode for Spectrum2/3
  mlxsw: spectrum_router_xm: Introduce basic XM cache flushing
  mlxsw: reg: Add Router LPM Cache Enable Register
  mlxsw: reg: Add Router LPM Cache ML Delete Register
  mlxsw: spectrum_router_xm: Implement L-value tracking for M-index
  mlxsw: reg: Add XM Router M Table Register
  ...
2020-12-15 13:22:29 -08:00
Linus Torvalds
9c70f04678 The main part of this branch is the ongoing fight against windmills in
an attempt to have userspace tools not poke at naked MSRs. This round
 deals with MSR_IA32_ENERGY_PERF_BIAS and removes direct poking into it
 by our in-tree tools in favor of the proper "energy_perf_bias" sysfs
 interface which we already have.
 
 In addition, the msr.ko write filtering's error message points to a new
 summary page which contains the info we collected from helpful reporters
 about which userspace tools write MSRs:
 
   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/about
 
 along with the current status of their conversion.
 
 Rest is the usual small fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAl/XVKYACgkQEsHwGGHe
 VUondg//fv3aQM3KtWE7sxv6BjpiUNozPBELRuKo+EskHSxHudRhBxzdSMM7WgKq
 2uojb2CQtzRzYhHuiXjXKfbB7Ci/Jo4EDCJW2otpiqit7/UgXu15Q5ypCUMIteiV
 u9A2w3oN3GPR5TuofLWCffaotVMpFok3u7jX7RxEQPWmZqJItTwZpqYLeyniHaKM
 c6taAxZVyV13iejRhxim2zkl/hMXpjA8I+8CqWIL25J7GYlYeWLWxWYmHIQTs0NM
 zSIyr47RD8RRXVeRdeJMxnQblKE1zrObIV1fUXXu1dSW47DkrrcOQwEMorNjPtPA
 FR5Xhi+TX8JrBasMpwCnV/CTj6Ua8UsMfwQcPOFnXALPj87HfFSypa5BpnBH5xTW
 PaiatRmiNJm3g79ncaTvXCksMbb4WANqOYK+gsGYvtKbfLR+caWT6vytjZA6sC6x
 laynstV9PFUyewdwjjAjilhArzV+y+5RsRudBK8xSjcawbyV4ZEorNKYS9qrhm+y
 7CAM9A8fCQiO6POr6W7HcfmkUOHC9PLhtyjdJH89tAmaf+sfvaczzx3awwSuKx7P
 0rJlDiJP1v7yEpOMWHbpGIqjMBaWK4y3mb4g3UwFpHpo8cTl+WXZQppOPIBn9GA9
 ASLYT/ze7zk1Ua2V88qoXiC5AEvqBnSq4fp2pmf06ROZgBnYT6o=
 =ISyk
 -----END PGP SIGNATURE-----

Merge tag 'x86_misc_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 updates from Borislav Petkov:
 "The main part of this branch is the ongoing fight against windmills in
  an attempt to have userspace tools not poke at naked MSRs.

  This round deals with MSR_IA32_ENERGY_PERF_BIAS and removes direct
  poking into it by our in-tree tools in favor of the proper
  "energy_perf_bias" sysfs interface which we already have.

  In addition, the msr.ko write filtering's error message points to a
  new summary page which contains the info we collected from helpful
  reporters about which userspace tools write MSRs:

      https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/about

  along with the current status of their conversion.

  The rest is the usual small fixes and improvements"

* tag 'x86_misc_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/msr: Add a pointer to an URL which contains further details
  x86/pci: Fix the function type for check_reserved_t
  selftests/x86: Add missing .note.GNU-stack sections
  selftests/x86/fsgsbase: Fix GS == 1, 2, and 3 tests
  x86/msr: Downgrade unrecognized MSR message
  x86/msr: Do not allow writes to MSR_IA32_ENERGY_PERF_BIAS
  tools/power/x86_energy_perf_policy: Read energy_perf_bias from sysfs
  tools/power/turbostat: Read energy_perf_bias from sysfs
  tools/power/cpupower: Read energy_perf_bias from sysfs
  MAINTAINERS: Cleanup SGI-related entries
2020-12-14 13:29:34 -08:00
Finn Behrens
c25ce589dc tweewide: Fix most Shebang lines
Change every shebang which does not need an argument to use /usr/bin/env.
This is needed as not every distro has everything under /usr/bin,
sometimes not even bash.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-08 23:30:04 +09:00
Srinivas Pandruvada
5e27cb9bca tools/power/x86/intel-speed-select: Update version for v5.11
Update version for changes released with v5.11 kernel release.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/platform-driver-x86/57d6648282491906e0e1f70fe3b9a44f72cec90d.camel@intel.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-12-08 11:12:42 +01:00
Srinivas Pandruvada
6c4832253a tools/power/x86/intel-speed-select: Account for missing sysfs for die_id
Some older kernels will not have support to get CPU die_id from the
sysfs. This requires several back ports. But the tool depends on getting
die_id to match to correct CPU.

Relax this restriction and use die_id as 0 when die_id is missing. This
is not a problem as we don't have any multi-die processors with Intel SST
support.

This helps in running this tool on older kernels with just Intel SST
drivers back ported.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/platform-driver-x86/57d6648282491906e0e1f70fe3b9a44f72cec90d.camel@intel.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-12-08 11:12:38 +01:00
Srinivas Pandruvada
07f262d80d tools/power/x86/intel-speed-select: Read TRL from mailbox
When SST-PP feature is not present, the TRL (Turbo Ratio Limits)
is read from MSRs. This is done as the mailbox command will fail
on Skylake-X based platform. But for IceLake servers, mailbox
commands can still be used. So add a check to allow for non Skylake
based platforms to read from mail box commands.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/platform-driver-x86/57d6648282491906e0e1f70fe3b9a44f72cec90d.camel@intel.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-12-08 11:12:15 +01:00
Rafael J. Wysocki
f8edfa6d1e linux-cpupower-5.11-rc1
This cpupower update for Linux 5.11-rc1 consists of a change to provide
 online and offline CPU information. This change makes it easier to keep
 track of offline cpus whose cpuidle or cpufreq property aren't changed
 when updates are made to online cpus.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAl/FZOoACgkQCwJExA0N
 QxyxRxAAiXocAy6ZcDTtVzQuvRA48VwydjOi5/WqOzn6PO15aEIOebcMAkXFGTkj
 RkyZIZLgqvx8xZ+j0vocw2+jbXBw+BXhEsXOkUdD2oIe55AhRdaO2Ove83ff5MeF
 B1g1nt6QNT8/usNbQIkghAObRNi7h9QmTiIKjaYb9jvtW+hISxeIvC1STzfbJOJT
 YFm0RP3ZBQlUALZFweB0c5jxKnXtVzL+8riJgodzRGMIX/cAyClZEtiGvIkG8unc
 RV2p1djyCLhPLg0MDu5trhzDS3NiA2NMggFd5HtJYjwwUgYxyH2tBXMnI7BuukVu
 vNMr5U4wY74ldwPO6M8HzKhEYx1yWurWJKnMScow2bmd6UO9SFHaV7wPcCUKYSsi
 gRkGiCLaTmcN/Cz1rgAt8wqkT02HXkYoETrdAR959fVrDmyFaiej1abeLrLP2hm+
 SKbZpVDzmdnfglx//uGv+j7i1fJdei7w53JIfQ3PtGnRJe+AVjk/0UbCtSCsdLoJ
 LgWPwa6jS459TFWU9wGwQFvsehE6ryOOtXIxRmW33YeCAGNFvpyq1Nsorm6CKzw8
 GbClGrdIG8QMYJBTH6oxoLL1hIV07xw0LJj8VOHeTtM/wdOL430wyN++8mPe6hsv
 DWFeCqIZx6913y+kPQ78w03hiKqWf0D4HiFi0o7CD9CPswTO378=
 =yqNn
 -----END PGP SIGNATURE-----

Merge tag 'linux-cpupower-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Pull cpupower utility update for v5.11-rc1 from Shuah Khan:

"This consists of a change to provide online and offline CPU information.
 This change makes it easier to keep track of offline cpus whose cpuidle
 or cpufreq property aren't changed when updates are made to online cpus."

* tag 'linux-cpupower-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  cpupower: Provide online and offline CPU information
2020-12-01 17:26:49 +01:00
Todd Brandt
d23e95c090 pm-graph v5.8
- if wakeups occur in s2idle: "freeze time: N (-x ms waking y times) ms"

 - change FREEZELOOP and FREEZEWAKE to S2LOOP and S2WAKE for brevity

 - returns all sysfs vals to their initial state after testing

 - use the dmesg log for debugging until the test is completed,
   instrument the executeSuspend process to have a full trace,
   if test completes, formal dmesg log overwrites the debug log

 - fix CPU_ON and CPU_OFF devices in the timeline, should include [n]

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-11-23 18:20:28 +01:00
Borislav Petkov
fe0a578862 tools/power/x86_energy_perf_policy: Read energy_perf_bias from sysfs
... and stop poking at the MSR directly.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20201029190259.3476-4-bp@alien8.de
2020-11-16 17:43:28 +01:00
Borislav Petkov
6d6501d912 tools/power/turbostat: Read energy_perf_bias from sysfs
... instead of poking at the MSR directly.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-pm@vger.kernel.org
Link: https://lkml.kernel.org/r/20201029190259.3476-3-bp@alien8.de
2020-11-16 17:42:46 +01:00
Borislav Petkov
8113ab20e8 tools/power/cpupower: Read energy_perf_bias from sysfs
... instead of poking at the MSR. For that, move the accessor functions
to misc.c and add a sysfs-writing function too.

There should be no functional changes resulting from this.

Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Cc: Thomas Renninger <trenn@suse.com>
Link: https://lkml.kernel.org/r/20201029190259.3476-2-bp@alien8.de
2020-11-16 17:42:12 +01:00
Jakub Kicinski
07cbce2e46 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Daniel Borkmann says:

====================
pull-request: bpf-next 2020-11-14

1) Add BTF generation for kernel modules and extend BTF infra in kernel
   e.g. support for split BTF loading and validation, from Andrii Nakryiko.

2) Support for pointers beyond pkt_end to recognize LLVM generated patterns
   on inlined branch conditions, from Alexei Starovoitov.

3) Implements bpf_local_storage for task_struct for BPF LSM, from KP Singh.

4) Enable FENTRY/FEXIT/RAW_TP tracing program to use the bpf_sk_storage
   infra, from Martin KaFai Lau.

5) Add XDP bulk APIs that introduce a defer/flush mechanism to optimize the
   XDP_REDIRECT path, from Lorenzo Bianconi.

6) Fix a potential (although rather theoretical) deadlock of hashtab in NMI
   context, from Song Liu.

7) Fixes for cross and out-of-tree build of bpftool and runqslower allowing build
   for different target archs on same source tree, from Jean-Philippe Brucker.

8) Fix error path in htab_map_alloc() triggered from syzbot, from Eric Dumazet.

9) Move functionality from test_tcpbpf_user into the test_progs framework so it
   can run in BPF CI, from Alexander Duyck.

10) Lift hashtab key_size limit to be larger than MAX_BPF_STACK, from Florian Lehner.

Note that for the fix from Song we have seen a sparse report on context
imbalance which requires changes in sparse itself for proper annotation
detection where this is currently being discussed on linux-sparse among
developers [0]. Once we have more clarification/guidance after their fix,
Song will follow-up.

  [0] https://lore.kernel.org/linux-sparse/CAHk-=wh4bx8A8dHnX612MsDO13st6uzAz1mJ1PaHHVevJx_ZCw@mail.gmail.com/T/
      https://lore.kernel.org/linux-sparse/20201109221345.uklbp3lzgq6g42zb@ltop.local/T/

* git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (66 commits)
  net: mlx5: Add xdp tx return bulking support
  net: mvpp2: Add xdp tx return bulking support
  net: mvneta: Add xdp tx return bulking support
  net: page_pool: Add bulk support for ptr_ring
  net: xdp: Introduce bulking for xdp tx return path
  bpf: Expose bpf_d_path helper to sleepable LSM hooks
  bpf: Augment the set of sleepable LSM hooks
  bpf: selftest: Use bpf_sk_storage in FENTRY/FEXIT/RAW_TP
  bpf: Allow using bpf_sk_storage in FENTRY/FEXIT/RAW_TP
  bpf: Rename some functions in bpf_sk_storage
  bpf: Folding omem_charge() into sk_storage_charge()
  selftests/bpf: Add asm tests for pkt vs pkt_end comparison.
  selftests/bpf: Add skb_pkt_end test
  bpf: Support for pointers beyond pkt_end.
  tools/bpf: Always run the *-clean recipes
  tools/bpf: Add bootstrap/ to .gitignore
  bpf: Fix NULL dereference in bpf_task_storage
  tools/bpftool: Fix build slowdown
  tools/runqslower: Build bpftool using HOSTCC
  tools/runqslower: Enable out-of-tree build
  ...
====================

Link: https://lore.kernel.org/r/20201114020819.29584-1-daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-11-14 09:13:41 -08:00
Jean-Philippe Brucker
c8a950d0d3 tools: Factor HOSTCC, HOSTLD, HOSTAR definitions
Several Makefiles in tools/ need to define the host toolchain variables.
Move their definition to tools/scripts/Makefile.include

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/bpf/20201110164310.2600671-2-jean-philippe@linaro.org
2020-11-11 12:18:22 -08:00
Linus Torvalds
8bff39bfdc Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull turbostat updates from Len Brown:
 "Update update to version 20.09.30, one kernel side fix"

* 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
  tools/power turbostat: update version number
  powercap: restrict energy meter to root access
  tools/power turbostat: harden against cpu hotplug
  tools/power turbostat: adjust for temperature offset
  tools/power turbostat: Build with _FILE_OFFSET_BITS=64
  tools/power turbostat: Support AMD Family 19h
  tools/power turbostat: Remove empty columns for Jacobsville
  tools/power turbostat: Add a new GFXAMHz column that exposes gt_act_freq_mhz.
  tools/power x86_energy_perf_policy: Input/output error in a VM
  tools/power turbostat: Skip pc8, pc9, pc10 columns, if they are disabled
  tools/power turbostat: Support additional CPU model numbers
  tools/power turbostat: Fix output formatting for ACPI CST enumeration
  tools/power turbostat: Replace HTTP links with HTTPS ones: TURBOSTAT UTILITY
  tools/power turbostat: Use sched_getcpu() instead of hardcoded cpu 0
  tools/power turbostat: Enable accumulate RAPL display
  tools/power turbostat: Introduce functions to accumulate RAPL consumption
  tools/power turbostat: Make the energy variable to be 64 bit
  tools/power turbostat: Always print idle in the system configuration header
  tools/power turbostat: Print /dev/cpu_dma_latency
2020-11-10 10:02:31 -08:00
Len Brown
3e9fa9983b tools/power turbostat: update version number
goodbye summer...

Signed-off-by: Len Brown <len.brown@intel.com>
2020-11-10 11:41:36 -05:00
Brahadambal Srinivasan
748f0d7008 cpupower: Provide online and offline CPU information
When a user tries to modify cpuidle or cpufreq properties on offline
CPUs, the tool returns success (exit status 0) but also does not provide
any warning message regarding offline cpus that may have been specified
but left unchanged. In case of all or a few CPUs being offline, it can be
difficult to keep track of which CPUs didn't get the new frequency or idle
state set. Silent failures are difficult to keep track of when there are a
huge number of CPUs on which the action is performed.

This patch adds helper functions to find both online and offline CPUs and
print them out accordingly.

We use these helper functions in cpuidle-set and cpufreq-set to print an
additional message if the user attempts to modify offline cpus.

Reported-by: Pavithra R. Prakash <pavrampu@in.ibm.com>
Signed-off-by: Brahadambal Srinivasan <latha@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-10-26 13:36:24 -06:00
Linus Torvalds
41f762a15a More power management updates for 5.10-rc1
- Move the AVS drivers to new platform-specific locations and get
    rid of the drivers/power/avs directory (Ulf Hansson).
 
  - Add on/off notifiers and idle state accounting support to the
    generic power domains (genpd) framework (Ulf Hansson, Lina Iyer).
 
  - Ulf will maintain the PM domain part of cpuidle-psci (Ulf Hansson).
 
  - Make intel_idle disregard ACPI _CST if it cannot use the data
    returned by that method (Mel Gorman).
 
  - Modify intel_pstate to avoid leaving useless sysfs directory
    structure behind if it cannot be registered (Chen Yu).
 
  - Fix domain detection in the RAPL power capping driver and prevent
    it from failing to enumerate the Psys RAPL domain (Zhang Rui).
 
  - Allow acpi-cpufreq to use ACPI _PSD information with Family 19 and
    later AMD chips (Wei Huang).
 
  - Update the driver assumptions comment in intel_idle and fix a
    kerneldoc comment in the runtime PM framework (Alexander Monakov,
    Bean Huo).
 
  - Avoid unnecessary resets of the cached frequency in the schedutil
    cpufreq governor to reduce overhead (Wei Wang).
 
  - Clean up the cpufreq core a bit (Viresh Kumar).
 
  - Make assorted minor janitorial changes (Daniel Lezcano, Geert
    Uytterhoeven, Hubert Jasudowicz, Tom Rix).
 
  - Clean up and optimize the cpupower utility somewhat (Colin Ian
    King, Martin Kaistra).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl+TD4gSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx3AgP/0Fpi50+Kggr7pIXKElwg7ECJA0nOLT6
 gp4Vc/J/3r6zqK0ANDgCRlEMckAT61ukll+eU+BlavBrI4ZYj/Homi0+u53t1GjM
 AOwj1SmQgSBcBavWsBOc8+12X6wYLzyQbyWc53oYH5os537n8s7zkSZuSBcGFUgb
 wWF4xOeuW/ETsxAzEYmY7LvtBeEmo3UjV0fZPPbo/ro5EHDaOpvO/4EUDjCQxR6b
 CvyjgLlxuAOFWG/B5lVTCx7S6MmBjHXUIFUizt+TA6YjyGd0mG0i0f7mgzs6hqUD
 gzERDSlehBC3zPh5O35HNGUG8ulvDi9+ugxuckFHu/j4wEeZswp8AuIpdLI6Mcnc
 LDb+LTeypAB5d1fzHeSziv8AL08cUAS6QT+q96whYibQs6WA1mE9yXECyg6ZGsLt
 1KPAc8KD4ojwjo9vtk9VU0ZaUcVBMnqyK+GK929l0nXohw2Fae6X/NlpQ0D7joZA
 NM+dWMXpHy6tuVOgdUmrmN+P6vWd8ApWBeufkUFsCzrh3zG57yVaLl2SAjEtpKh0
 Emr/kJ8Ox8cf++6mGKseR2ZbkGn0Tz2GD5l3hIAGnIv9Nda3YgCc6RyV7U9se7OW
 2xnQvrgXqQKyjjziptVFqDotcC/KXFACr3YZX6GlW675NOMXSGk1ZYI3FbrsM8yd
 0/zq7PyYmb0D
 =TFKg
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.10-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more power management updates from Rafael Wysocki:
 "First of all, the adaptive voltage scaling (AVS) drivers go to new
  platform-specific locations as planned (this part was reported to have
  merge conflicts against the new arm-soc updates in linux-next).

  In addition to that, there are some fixes (intel_idle, intel_pstate,
  RAPL, acpi_cpufreq), the addition of on/off notifiers and idle state
  accounting support to the generic power domains (genpd) code and some
  janitorial changes all over.

  Specifics:

   - Move the AVS drivers to new platform-specific locations and get rid
     of the drivers/power/avs directory (Ulf Hansson).

   - Add on/off notifiers and idle state accounting support to the
     generic power domains (genpd) framework (Ulf Hansson, Lina Iyer).

   - Ulf will maintain the PM domain part of cpuidle-psci (Ulf Hansson).

   - Make intel_idle disregard ACPI _CST if it cannot use the data
     returned by that method (Mel Gorman).

   - Modify intel_pstate to avoid leaving useless sysfs directory
     structure behind if it cannot be registered (Chen Yu).

   - Fix domain detection in the RAPL power capping driver and prevent
     it from failing to enumerate the Psys RAPL domain (Zhang Rui).

   - Allow acpi-cpufreq to use ACPI _PSD information with Family 19 and
     later AMD chips (Wei Huang).

   - Update the driver assumptions comment in intel_idle and fix a
     kerneldoc comment in the runtime PM framework (Alexander Monakov,
     Bean Huo).

   - Avoid unnecessary resets of the cached frequency in the schedutil
     cpufreq governor to reduce overhead (Wei Wang).

   - Clean up the cpufreq core a bit (Viresh Kumar).

   - Make assorted minor janitorial changes (Daniel Lezcano, Geert
     Uytterhoeven, Hubert Jasudowicz, Tom Rix).

   - Clean up and optimize the cpupower utility somewhat (Colin Ian
     King, Martin Kaistra)"

* tag 'pm-5.10-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits)
  PM: sleep: remove unreachable break
  PM: AVS: Drop the avs directory and the corresponding Kconfig
  PM: AVS: qcom-cpr: Move the driver to the qcom specific drivers
  PM: runtime: Fix typo in pm_runtime_set_active() helper comment
  PM: domains: Fix build error for genpd notifiers
  powercap: Fix typo in Kconfig "Plance" -> "Plane"
  cpufreq: schedutil: restore cached freq when next_f is not changed
  acpi-cpufreq: Honor _PSD table setting on new AMD CPUs
  PM: AVS: smartreflex Move driver to soc specific drivers
  PM: AVS: rockchip-io: Move the driver to the rockchip specific drivers
  PM: domains: enable domain idle state accounting
  PM: domains: Add curly braces to delimit comment + statement block
  PM: domains: Add support for PM domain on/off notifiers for genpd
  powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain
  powercap/intel_rapl: Fix domain detection
  intel_idle: Ignore _CST if control cannot be taken from the platform
  cpuidle: Remove pointless stub
  intel_idle: mention assumption that WBINVD is not needed
  MAINTAINERS: Add section for cpuidle-psci PM domain
  cpufreq: intel_pstate: Delete intel_pstate sysfs if failed to register the driver
  ...
2020-10-23 16:27:03 -07:00
Len Brown
3d7772ea56 tools/power turbostat: harden against cpu hotplug
turbostat tends to get confused when CPUs are added and removed
while it is running.

There are races, such as checking the current cpu, and then
reading a sysfs file that depends on that cpu number.

Close the two issues that seem to come up the most.
First, there is an infinite reset loop detector --
change that to allow more resets before giving up.
Secondly, one of those file reads didn't really need
to exit the program on failure...

Signed-off-by: Len Brown <len.brown@intel.com>
2020-10-23 16:54:05 -04:00
Len Brown
6ff7cb371c tools/power turbostat: adjust for temperature offset
cpu1: MSR_IA32_TEMPERATURE_TARGET: 0x05640000 (95 C) (100 default - 5 offset)

Account for the new "offset" field in MSR_TEMPERATURE_TARGET.
While this field is usually zero, ignoring it results in over-stating
the current temperature, both per-core and per-package.

Signed-off-by: Len Brown <len.brown@intel.com>
2020-10-23 16:50:16 -04:00
Rafael J. Wysocki
71d47b53de Merge branches 'pm-core', 'pm-sleep', 'pm-tools' and 'powercap'
* pm-core:
  PM: runtime: Fix typo in pm_runtime_set_active() helper comment

* pm-sleep:
  PM: sleep: remove unreachable break

* pm-tools:
  cpupower: speed up generating git version string
  cpupowerutils: fix spelling mistake "dependant" -> "dependent"

* powercap:
  powercap: Fix typo in Kconfig "Plance" -> "Plane"
  powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain
  powercap/intel_rapl: Fix domain detection
2020-10-23 18:11:23 +02:00
Rafael J. Wysocki
79d6c4093b linux-cpupower-5.10-rc1
This cpupower update for Linux 5.10-rc1 consists of minor fixes for
 spelling and speeding up generating git version string which will
 in turn speedup compiles.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAl+F3XcACgkQCwJExA0N
 QxyR+A/+LjyWBsWlIuVYlkUKCvur4q4yiSNJJmZlsvwOsTD3O6xShQ0AzqKebjOI
 MYAaIsHJDz/qp9F7cKBiGxByco/L0Q1sSsybyCOvopzgHX+QT6/txCLKihosPTg8
 YsrwjeHSFyajQGW892EdNF+NKDvoh5VNRslCtpH40Qf6lRSSK3ct4B1UK497UEGP
 oQC+Ei3+zLip3POBWbF1uzi9FaX3ZQtxXul8HAfzMtV2oeyD6CSMaKy1aq1w7BI3
 zk8p5Ollk+LAv4A8RcXzgVg4wk4GrX42K9EPu/DnSRKhylSgFtl9mKO/pHQbViMd
 uiG59+7oWM5zZQUnCfYY6w4LUBwGPO28cGD4rdFVgC08bTTN0Uqbkd0C1pp3h3k+
 KyV6fpT9CPeHkQaGOvKyGTPRg1mJvjIvKKm0ENRsxVUzCUX3s8O0xOG7S2zzOIkW
 xLF4d3YBXTvSGVp9MpTWXDRIOXlX93i6a9ftV1kZfzqsREzb6mmT0YYMHCKsK1E4
 RrwNBi1qZedjPrE8Aj3r7K7H9yqTWwjqFX5rg9dsp0hRA/8v+lrkHtRzC1BRm+6z
 CxtIaV97uYeB1Q7RuyUO9NIDba7HH4guXC6d7IJpWVxK9DH0QUD4hsVsqxq4rHJ2
 IkapbMW1SfgvB9sg+fef9YOrRTdUtlDaLoKqO0TY3qL9C6q8x9o=
 =Og1O
 -----END PGP SIGNATURE-----

Merge tag 'linux-cpupower-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Pull cpupower utility updates for 5.10-rc1 from Shuah Khan:

"This update consists of minor fixes for spelling and speeding up
 generating git version string which will in turn speed up compiles."

* tag 'linux-cpupower-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  cpupower: speed up generating git version string
  cpupowerutils: fix spelling mistake "dependant" -> "dependent"
2020-10-16 16:10:30 +02:00
Linus Torvalds
9e51183e94 linux-kselftest-fixes-5.10-rc1
This kselftest fixes update consists of a selftests harness fix to
 flush stdout before forking to avoid parent and child printing
 duplicates messages. This is evident when test output is redirected
 to a file.
 
 The second fix is a tools/ wide change to avoid comma separated statements
 from Joe Perches. This fix spans tools/lib, tools/power/cpupower, and
 selftests.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAl+GAdIACgkQCwJExA0N
 QxyraBAAwsPISUpSA34WLuUwNCddI3ttNW2R63ZrdKSy7QlreM02zG9qyEDPwFil
 GLlgXfUE8QOI7rfiqSwr1elzS07bDdel6UcxTuhuy5KPs2+yieGGZ5lllsVY6gJu
 kF5m7setmdmHQr76HCyyGddwdpCTpz7sP3BJzmYn2iAWAQMwtZBXOEgmnf2yiskX
 SHF/f3Bvrnm+BtbzZEa+ysHpL72AlpKrGuLQAnNOCp/DomKEtRACTNxIzKFeO++r
 uelbHO/MzdaGmrCxy3J/RWz3llQVnj6aafZFaqAV7ReWi/OOYTsV48pAHRm8TTv8
 1LvVP48b7aCUc7QWu+d8SBSDfJQANI4tgcP0TI/hUboIuhU8bVkZAUF69txdFgzb
 DopwQVybQq5yEqmPg1RzvccbDojxXq72BvZyqPBo8WmKHWOQXCo9A1owudmcqtob
 WqTr1eAVAd6Rc2vcjkhnzYxQcb8A093ZfP1fyAZ5HQSH5No//4FP9pWBwMzpncKQ
 GdHmMNBns6v1muWMBj6bgT4GA1sN765Kzt1StYSC257v6gtA8+xHo/PUfojZJxy9
 bieAzuqE8n68IKKz4/Rk2JvfFBnaxDZyQUITOCrcoWJRk5apJc3T5+goq+Bep5Na
 SOFbb0JvrGLBjX3bChmLIYVa7zQkupBgwWU8NPM1tYxce+pBS30=
 =jgRu
 -----END PGP SIGNATURE-----

Merge tag 'linux-kselftest-fixes-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:

 - a selftests harness fix to flush stdout before forking to avoid
   parent and child printing duplicates messages. This is evident when
   test output is redirected to a file.

 - a tools/ wide change to avoid comma separated statements from Joe
   Perches. This fix spans tools/lib, tools/power/cpupower, and
   selftests.

* tag 'linux-kselftest-fixes-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  tools: Avoid comma separated statements
  selftests/harness: Flush stdout before forking
2020-10-14 14:23:51 -07:00
Linus Torvalds
cf1d2b44f6 ACPI updates for 5.10-rc1
- Add support for generic initiator-only proximity domains to
    the ACPI NUMA code and the architectures using it (Jonathan
    Cameron).
 
  - Clean up some non-ACPICA code referring to debug facilities from
    ACPICA that are not actually used in there (Hanjun Guo).
 
  - Add new DPTF driver for the PCH FIVR participant (Srinivas
    Pandruvada).
 
  - Reduce overhead related to accessing GPE registers in ACPICA and
    the OS interface layer and make it possible to access GPE registers
    using logical addresses if they are memory-mapped (Rafael Wysocki).
 
  - Update the ACPICA code in the kernel to upstream revision 20200925
    including changes as follows:
    * Add predefined names from the SMBus sepcification (Bob Moore).
    * Update acpi_help UUID list (Bob Moore).
    * Return exceptions for string-to-integer conversions in iASL (Bob
      Moore).
    * Add a new "ALL <NameSeg>" debugger command (Bob Moore).
    * Add support for 64 bit risc-v compilation (Colin Ian King).
    * Do assorted cleanups (Bob Moore, Colin Ian King, Randy Dunlap).
 
  - Add new ACPI backlight whitelist entry for HP 635 Notebook (Alex
    Hung).
 
  - Move TPS68470 OpRegion driver to drivers/acpi/pmic/ and split out
    Kconfig and Makefile specific for ACPI PMIC (Andy Shevchenko).
 
  - Clean up the ACPI SoC driver for AMD SoCs (Hanjun Guo).
 
  - Add missing config_item_put() to fix refcount leak (Hanjun Guo).
 
  - Drop lefrover field from struct acpi_memory_device (Hanjun Guo).
 
  - Make the ACPI extlog driver check for RDMSR failures (Ben
    Hutchings).
 
  - Fix handling of lid state changes in the ACPI button driver when
    input device is closed (Dmitry Torokhov).
 
  - Fix several assorted build issues (Barnabás Pőcze, John Garry,
    Nathan Chancellor, Tian Tao).
 
  - Drop unused inline functions and reduce code duplication by using
    kobj_to_dev() in the NFIT parsing code (YueHaibing, Wang Qing).
 
  - Serialize tools/power/acpi Makefile (Thomas Renninger).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl+F4IkSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx1gIQAIZrt09fquEIZhYulGZAkuYhSX2U/DZt
 poow5+TiGk36JNHlbZS19kZ3F0tJ1wA6CKSfF/bYyULxL+gYaUjdLXzv2kArTSAj
 nzDXQ2CystpySZI/sEkl4QjsMg0xuZlBhlnCfNHzJw049TgdsJHnxMkJXb8T90A+
 l2JKm2OpBkNvQGNpwd3djLg8xSDnHUmuevsWZPHDp92/fLMF9DUBk8dVuEwa0ndF
 hAUpWm+EL1tJQnhNwtfV/Akd9Ypqgk/7ROFWFHGDtHMZGnBjpyXZw68vHMX7SL6N
 Ej90GWGPHSJs/7Fsg4Hiaxxcph9WFNLPcpck5lVAMIrNHMKANjqQzCsmHavV/WTG
 STC9/qwJauA1EOjovlmlCFHctjKE/ya6Hm299WTlfBqB+Lu1L3oMR2CC+Uj0YfyG
 sv3264rJCsaSw610iwQOG807qHENopASO2q5DuKG0E9JpcaBUwn1N4qP5svvQciq
 4aA8Ma6xM/QHCO4CS0Se9C0+WSVtxWwOUichRqQmU4E6u1sXvKJxTeWo79rV7PAh
 L6BwoOxBLabEiyzpi6HPGs6DoKj/N6tOQenBh4ibdwpAwMtq7hIlBFa0bp19c2wT
 vx8F2Raa8vbQ2zZ1QEiPZnPLJUoy2DgaCtKJ6E0FTDXNs3VFlWgyhIUlIRqk5BS9
 OnAwVAUrTMkJ
 =feLU
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These add support for generic initiator-only proximity domains to the
  ACPI NUMA code and the architectures using it, clean up some
  non-ACPICA code referring to debug facilities from ACPICA, reduce the
  overhead related to accessing GPE registers, add a new DPTF (Dynamic
  Power and Thermal Framework) participant driver, update the ACPICA
  code in the kernel to upstream revision 20200925, add a new ACPI
  backlight whitelist entry, fix a few assorted issues and clean up some
  code.

  Specifics:

   - Add support for generic initiator-only proximity domains to the
     ACPI NUMA code and the architectures using it (Jonathan Cameron)

   - Clean up some non-ACPICA code referring to debug facilities from
     ACPICA that are not actually used in there (Hanjun Guo)

   - Add new DPTF driver for the PCH FIVR participant (Srinivas
     Pandruvada)

   - Reduce overhead related to accessing GPE registers in ACPICA and
     the OS interface layer and make it possible to access GPE registers
     using logical addresses if they are memory-mapped (Rafael Wysocki)

   - Update the ACPICA code in the kernel to upstream revision 20200925
     including changes as follows:
      + Add predefined names from the SMBus sepcification (Bob Moore)
      + Update acpi_help UUID list (Bob Moore)
      + Return exceptions for string-to-integer conversions in iASL (Bob
        Moore)
      + Add a new "ALL <NameSeg>" debugger command (Bob Moore)
      + Add support for 64 bit risc-v compilation (Colin Ian King)
      + Do assorted cleanups (Bob Moore, Colin Ian King, Randy Dunlap)

   - Add new ACPI backlight whitelist entry for HP 635 Notebook (Alex
     Hung)

   - Move TPS68470 OpRegion driver to drivers/acpi/pmic/ and split out
     Kconfig and Makefile specific for ACPI PMIC (Andy Shevchenko)

   - Clean up the ACPI SoC driver for AMD SoCs (Hanjun Guo)

   - Add missing config_item_put() to fix refcount leak (Hanjun Guo)

   - Drop lefrover field from struct acpi_memory_device (Hanjun Guo)

   - Make the ACPI extlog driver check for RDMSR failures (Ben
     Hutchings)

   - Fix handling of lid state changes in the ACPI button driver when
     input device is closed (Dmitry Torokhov)

   - Fix several assorted build issues (Barnabás Pőcze, John Garry,
     Nathan Chancellor, Tian Tao)

   - Drop unused inline functions and reduce code duplication by using
     kobj_to_dev() in the NFIT parsing code (YueHaibing, Wang Qing)

   - Serialize tools/power/acpi Makefile (Thomas Renninger)"

* tag 'acpi-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (64 commits)
  ACPICA: Update version to 20200925 Version 20200925
  ACPICA: Remove unnecessary semicolon
  ACPICA: Debugger: Add a new command: "ALL <NameSeg>"
  ACPICA: iASL: Return exceptions for string-to-integer conversions
  ACPICA: acpi_help: Update UUID list
  ACPICA: Add predefined names found in the SMBus sepcification
  ACPICA: Tree-wide: fix various typos and spelling mistakes
  ACPICA: Drop the repeated word "an" in a comment
  ACPICA: Add support for 64 bit risc-v compilation
  ACPI: button: fix handling lid state changes when input device closed
  tools/power/acpi: Serialize Makefile
  ACPI: scan: Replace ACPI_DEBUG_PRINT() with pr_debug()
  ACPI: memhotplug: Remove 'state' from struct acpi_memory_device
  ACPI / extlog: Check for RDMSR failure
  ACPI: Make acpi_evaluate_dsm() prototype consistent
  docs: mm: numaperf.rst Add brief description for access class 1.
  node: Add access1 class to represent CPU to memory characteristics
  ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3
  ACPI: Let ACPI know we support Generic Initiator Affinity Structures
  x86: Support Generic Initiator only proximity domains
  ...
2020-10-14 11:42:04 -07:00
Linus Torvalds
15cb5469fc platform-drivers-x86 for v5.10-1
Rather calm cycle for PDx86, all these have been in for-next for
 a couple of days with no bot complaints.
 
 Highlights:
 - PMC TigerLake fixes and new RocketLake support
 - Various small fixes / updates in other drivers/tools
 
 The following is an automated git shortlog grouped by driver:
 
 MAINTAINERS:
  -  update X86 PLATFORM DRIVERS entry with new kernel.org git repo
  -  Update maintainers for pmc_core driver
 
 hp-wmi:
  -  add support for thermal policy
 
 intel_pmc_core:
  -  fix: Replace dev_dbg macro with dev_info()
  -  Add Intel RocketLake (RKL) support
  -  Clean up: Remove the duplicate comments and reorganize
  -  Fix the slp_s0 counter displayed value
  -  Fix TigerLake power gating status map
 
 mlx-platform:
  -  Add capability field to platform FAN description
  -  Remove PSU EEPROM configuration
 
 platform_data/mlxreg:
  -  Extend core platform structure
  -  Update module license
 
 pmc_core:
  -  Use descriptive names for LPM registers
 
 tools/power/x86/intel-speed-select:
  -  Update version for v5.10
  -  Fix missing base-freq core IDs
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAl+FmAsUHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9x5awf/VWn0gcSw1i+y+Q/KPw/RCMXrEQQm
 Bqyt++IDSonvjBUmxE7QYtPvHK7lecPLXUzLkcfSoUmEZSPGoqe4F5Hj+814lj8x
 fveScf2DwUQyEfj26y4rmza1K4h7VohjJ7rQm0+t15KamrcogLiwqDpvel4v90lp
 YVvJUxDBOJxCrMs5fAziZAP7FxD42d8j664DFCPONH3EsY/vZMfOnsDRKhjahtFp
 LTtWXY5LyFf5HARKhubv/gmDddR7FzZB8/xc/G1CXpOmUBTcSgHgXH1OE/ypBXIe
 LOdchGqL2WRTq71IUKsvEXYbLSOHOMbIfBr7eCwZRKfmQLjQ8HXqI7xl9A==
 =luk4
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:
 "Rather calm cycle for x86 platform drivers, all these have been in
  for-next for a couple of days with no bot complaints.

  Highlights:

   - PMC TigerLake fixes and new RocketLake support

   - various small fixes / updates in other drivers/tools"

* tag 'platform-drivers-x86-v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  MAINTAINERS: update X86 PLATFORM DRIVERS entry with new kernel.org git repo
  platform/x86: mlx-platform: Add capability field to platform FAN description
  platform_data/mlxreg: Extend core platform structure
  platform_data/mlxreg: Update module license
  platform/x86: mlx-platform: Remove PSU EEPROM configuration
  MAINTAINERS: Update maintainers for pmc_core driver
  platform/x86: intel_pmc_core: fix: Replace dev_dbg macro with dev_info()
  platform/x86: intel_pmc_core: Add Intel RocketLake (RKL) support
  platform/x86: intel_pmc_core: Clean up: Remove the duplicate comments and reorganize
  platform/x86: intel_pmc_core: Fix the slp_s0 counter displayed value
  platform/x86: intel_pmc_core: Fix TigerLake power gating status map
  platform/x86: pmc_core: Use descriptive names for LPM registers
  tools/power/x86/intel-speed-select: Update version for v5.10
  tools/power/x86/intel-speed-select: Fix missing base-freq core IDs
  platform/x86: hp-wmi: add support for thermal policy
2020-10-14 10:43:24 -07:00
Rafael J. Wysocki
8be2362d10 Merge branches 'acpi-extlog', 'acpi-memhotplug', 'acpi-button', 'acpi-tools' and 'acpi-pci'
* acpi-extlog:
  ACPI / extlog: Check for RDMSR failure

* acpi-memhotplug:
  ACPI: memhotplug: Remove 'state' from struct acpi_memory_device

* acpi-button:
  ACPI: button: fix handling lid state changes when input device closed

* acpi-tools:
  tools/power/acpi: Serialize Makefile

* acpi-pci:
  ACPI: PCI: update kernel-doc line comments
2020-10-13 14:45:36 +02:00
Colin Ian King
465e490d29 ACPICA: Tree-wide: fix various typos and spelling mistakes
ACPICA commit 6648a6ac8410813bcfedb5c8345259dd155ea851

Fix spelling issues found using the codespell checker

Link: https://github.com/acpica/acpica/commit/6648a6ac
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-10-08 18:03:55 +02:00
Srinivas Pandruvada
e529412f32 tools/power/x86/intel-speed-select: Update version for v5.10
Update version for changes released with v5.10 kernel release.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-10-07 22:54:35 +02:00
Jonathan Doman
7566616fb9 tools/power/x86/intel-speed-select: Fix missing base-freq core IDs
The reported base-freq high-priority-cpu-list was potentially omitting
some cpus, due to incorrectly using a logical core count to constrain
the size of a physical punit core ID mask. We may need to read both high
and low PBF CORE_MASK values regardless of the logical core count.

Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-10-07 22:54:16 +02:00
Thomas Renninger
05c36e5adf tools/power/acpi: Serialize Makefile
Before this patch you get tools/power/acpi/Makefile.rules
included in parallel trying to copy KERNEL_INCLUDE multiple
times:

make -j20 acpi
  DESCEND  power/acpi
  DESCEND  tools/acpidbg
  DESCEND  tools/acpidump
  DESCEND  tools/ec
  MKDIR    include
  MKDIR    include
  MKDIR    include
  CP       include
  CP       include
cp: cannot create directory '/home/abuild/rpmbuild/BUILD/linux-5.7.7+git20200917.10b82d517648/tools/power/acpi/include/acpi': File exists
make[2]: *** [../../Makefile.rules:20: /home/abuild/rpmbuild/BUILD/linux-5.7.7+git20200917.10b82d517648/tools/power/acpi/include] Error 1
make[1]: *** [Makefile:16: acpidbg] Error 2
make[1]: *** Waiting for unfinished jobs....

with this patch each subdirectory will be processed serialized:

  DESCEND  power/acpi
  DESCEND  tools/acpidbg
  MKDIR    include
  CP       include
  CC       tools/acpidbg/acpidbg.o
  LD       acpidbg
  STRIP    acpidbg
  DESCEND  tools/acpidump
  CC       tools/acpidump/apdump.o
...
  LD       acpidump
  STRIP    acpidump
  DESCEND  tools/ec
  CC       tools/ec/ec_access.o
  LD       ec
  STRIP    ec

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-10-02 19:18:31 +02:00
Joe Perches
aa803771a8 tools: Avoid comma separated statements
Use semicolons and braces.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-10-02 10:36:36 -06:00
Alexander Monakov
4be61e6b76 tools/power turbostat: Build with _FILE_OFFSET_BITS=64
For compatibility reasons, Glibc off_t is a 32-bit type on 32-bit x86
unless _FILE_OFFSET_BITS=64 is defined. Add this define, as otherwise
reading MSRs with index 0x80000000 and above attempts a pread with a
negative offset, which fails.

Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
Tested-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:59:10 -04:00
Kim Phillips
33eb82251a tools/power turbostat: Support AMD Family 19h
Family 19h processors have the same RAPL (Running average power limit)
hardware register interface as Family 17h processors.

Change the family checks to succeed for Family 17h and above to enable
core and package energy measurement on Family 19h machines.

Also update the TDP to the largest found at the bottom of the page at
amd.com->processors->servers->epyc->2nd-gen-epyc, i.e., the EPYC 7H12.

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:59:10 -04:00
Antti Laakso
20de0dab23 tools/power turbostat: Remove empty columns for Jacobsville
Jacobsville doesn't have Package C2 and C6. Also
Core and DRAM RAPL are not available. Adjust output
accordingly.

Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:59:10 -04:00
Rafael Antognolli
b4b9156953 tools/power turbostat: Add a new GFXAMHz column that exposes gt_act_freq_mhz.
The column already present called GFXMHz reads from gt_cur_freq_mhz,
which represents the GT frequency that was requested, but power
management might not be able to do that. So the new column will display
what the actual frequency GT is running at.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:59:10 -04:00
Ondřej Lysoněk
0936cdfbb5 tools/power x86_energy_perf_policy: Input/output error in a VM
I've encountered an issue with x86_energy_perf_policy. If I run it on a
machine that I'm told is a qemu-kvm virtual machine running inside a
privileged container, I get the following error:

x86_energy_perf_policy: /dev/cpu/0/msr offset 0x1ad read failed: Input/output error

I get the same error in a Digital Ocean droplet, so that might be a
similar environment.

I created the following patch which is intended to give a more
user-friendly message. It's based on a patch for turbostat from Prarit
Bhargava that was posted some time ago. The patch is "[v2] turbostat:
Running on virtual machine is not supported" [1].

Given my limited knowledge of the topic, I can't say with confidence
that this is the right solution, though (that's why this is not an
official patch submission). Also, I'm not sure what the convention with
exit codes is in this tool. Also, instead of the error message, perhaps
the tool should just not print anything in this case, which is how it
behaves in a "regular" VM?

[1] https://patchwork.kernel.org/patch/9868587/

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:58:38 -04:00
Len Brown
c315a09b1b tools/power turbostat: Skip pc8, pc9, pc10 columns, if they are disabled
Like we skip PC3 and PC6 columns when the package C-state limit
disables them, skip PC8/PC9/CP10 under analogous conditions.

Reported-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:58:38 -04:00
Len Brown
e7af1ed3fa tools/power turbostat: Support additional CPU model numbers
Initial support for models recently added to intel-family.h.

Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:58:37 -04:00
David Arcari
fecb3bc839 tools/power turbostat: Fix output formatting for ACPI CST enumeration
turbostat formatting is broken with ACPI CST for enumeration.  The
problem is that the CX_ACPI% is eight characters long which does not
work with tab formatting.  One simple solution is to remove the underbar
from the state name such that C1_ACPI will be displayed as C1ACPI.

Signed-off-by: David Arcari <darcari@redhat.com>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:58:37 -04:00
Alexander A. Klimov
b88cad57d4 tools/power turbostat: Replace HTTP links with HTTPS ones: TURBOSTAT UTILITY
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:58:37 -04:00
Prarit Bhargava
8201a02857 tools/power turbostat: Use sched_getcpu() instead of hardcoded cpu 0
Disabling cpu 0 results in an error

turbostat: /sys/devices/system/cpu/cpu0/topology/thread_siblings: open failed: No such file or directory

Use sched_getcpu() instead of a hardcoded cpu 0 to get the max cpu number.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:57:47 -04:00
Chen Yu
9972d5d84d tools/power turbostat: Enable accumulate RAPL display
Enable the accumulated RAPL display by default.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:57:47 -04:00
Chen Yu
87e15da957 tools/power turbostat: Introduce functions to accumulate RAPL consumption
Since the RAPL Joule Counter is 32 bit, turbostat would
only print a *star* instead of printing the actual energy
consumed to indicate the overflow due to long duration.
This does not meet the requirement from servers as the
sampling time of turbostat is usually very long on servers.

So maintain a set of MSR buffer, and update them
periodically before the 32bit MSR register is wrapped round,
so as to avoid the overflow.

The idea is similar to the implementation of ktime_get():

Periodical MSR timer:
total_rapl_sum += (current_rapl_msr - last_rapl_msr);

Using get_msr_sum() to get the accumulated RAPL:
return (current_rapl_msr - last_rapl_msr) + total_rapl_sum;

The accumulated RAPL mechanism will be turned on in next patch.

Originally-by: Aaron Lu <aaron.lwe@gmail.com>
Reviewed-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:57:47 -04:00
Chen Yu
7c2ccc507b tools/power turbostat: Make the energy variable to be 64 bit
Change the energy variable from 32bit to 64bit,
so that it can record long time duration.
After this conversion, adjust the DELTA_WRAP32() accordingly.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:57:07 -04:00
Doug Smythies
9aefc2cda6 tools/power turbostat: Always print idle in the system configuration header
If the --quiet option is not used, turbostat prints a useful system
configuration header during startup.

But inclusion of idle system configuration information in this header
is currently a function of inclusion in the columns chosen to be displayed.

Always list this idle system configuration.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:55:17 -04:00
Len Brown
d76bb7a09b tools/power turbostat: Print /dev/cpu_dma_latency
Users are puzzled when they use tuned performance and all their
C-states vanish.  Dump /dev/cpu_dma_latency and state
whether the value is default, or constraining,
to explain this situation.

Signed-off-by: Len Brown <len.brown@intel.com>
2020-09-03 13:48:07 -04:00
Peter Zijlstra
70d9329857 notifier: Fix broken error handling pattern
The current notifiers have the following error handling pattern all
over the place:

	int err, nr;

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

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

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

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

Note: software_resume() error handling was broken afaict.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20200818135804.325626653@infradead.org
2020-09-01 09:58:03 +02:00
Martin Kaistra
527b7779e5 cpupower: speed up generating git version string
The variable VERSION is expanded for every use of CFLAGS. This causes
"git describe" to get called multiple times on the kernel tree, which
can be quite slow.

The git revision does not change during build, so we can use simple
variable expansion to set VERSION.

Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-08-20 13:04:47 -06:00
Colin Ian King
d1876f3596 cpupowerutils: fix spelling mistake "dependant" -> "dependent"
There is a spelling mistake in a message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-08-20 11:19:23 -06:00
Linus Torvalds
2baa85d692 ACPI updates for 5.9-rc1
- Eliminate significant AML processing overhead related to using
    operation regions in system memory by reworking the management
    of memory mappings in the ACPI code to defer unmap operations
    (to do them outside of the ACPICA locks, among other things) and
    making the memory operation reagion handler avoid releasing memory
    mappings created by it too early (Rafael Wysocki).
 
  - Update the ACPICA code in the kernel to upstream revision
    20200717:
 
    * Prevent operation region reference counts from overflowing in
      some cases (Erik Kaneda).
 
    * Replace one-element array with flexible-array (Gustavo A. R.
      Silva).
 
  - Fix ACPI PCI hotplug reference counting (Rafael Wysocki).
 
  - Drop last bits of the ACPI procfs interface (Thomas Renninger).
 
  - Drop some redundant checks from the code parsing ACPI tables
    related to NUMA (Hanjun Guo).
 
  - Avoid redundant object evaluation in the ACPI device properties
    handling code (Heikki Krogerus).
 
  - Avoid unecessary memory overhead related to storing the signatures
    of the ACPI tables recognized by the kernel (Ard Biesheuvel).
 
  - Add missing newline characters when printing module parameter
    values in some places (Xiongfeng Wang).
 
  - Update the link to the ACPI specifications in some places (Tiezhu
    Yang).
 
  - Use the fallthrough pseudo-keyword in the ACPI code (Gustavo A. R.
    Silva).
 
  - Drop redundant variable initialization from the APEI code (Colin
    Ian King).
 
  - Drop uninitialized_var() from the ACPI PAD driver (Jason Yan).
 
  - Replace HTTP links with HTTPS ones in the ACPI code (Alexander A.
    Klimov).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl8oO8gSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx2nUP/iSRAW0DK4PYDNLDV1Q+y5RrQw44iMDf
 yfLQu3agardM1KGtPuYw5zmU0UoEYtW8s2r027bxw9Hvn0IzBh5TiDvcVjMEnbVC
 +6m/fWg3EStfZ9w2dxDzXDMIk/oiEZsjtWSRaDTfAIH2jc/xVcSXDojlMgBPQDu5
 hIITjMbGGx783o4PNCYbIZy1ReJgd8MNQ+Xp3MCpTgbFgHMHKBOJ6B/nS8aTfilO
 eE5JvzhXED7qITaXYWxI9OZpRTPTNQ3eaEPbWvnw4KJ5boMfyREMGdTBipXO+kSA
 SwKhFysYEUAZM7Ffq0eTnWSCU7VWogAsTauIgs4+d9z8VrGhWi5+b6N/E/uwTKtj
 HF98xtk+Loe8V24LwN0snvv51O7P5nAH47QxwIBvQssfR8ZSgdwHtUQcckybAJhx
 LLmPtJrM8ZAefc9H4o0eVqumjoh1amGKC9dTY0g1j0UIE0y3ZIFHTvDNvhpTzgBk
 5uUHHEiolGNWHVrs1LIMOEejqx62m+EjVc9b8XUdJqHoboTccMM73DRk/00meP/7
 br/VfMI0aTjPLssvSC/ZSlTZt+ddrBm+cXw9eqruDQwdQaqxpJu+D3odjdaYSjpg
 luiYQrQdoDmIDh4UNuJbvG/Hub3CLzvJSqGWLExNbX7nWXxH4HIx/8PcNtVkKZRV
 qBXotIc+i4VD
 =Nn2Q
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These eliminate significant AML processing overhead related to using
  operation regions in system memory, update the ACPICA code in the
  kernel to upstream revision 20200717 (including a fix to prevent
  operation region reference counts from overflowing in some cases),
  remove the last bits of the (long deprecated) ACPI procfs interface
  and do some assorted cleanups.

  Specifics:

   - Eliminate significant AML processing overhead related to using
     operation regions in system memory by reworking the management of
     memory mappings in the ACPI code to defer unmap operations (to do
     them outside of the ACPICA locks, among other things) and making
     the memory operation reagion handler avoid releasing memory
     mappings created by it too early (Rafael Wysocki).

   - Update the ACPICA code in the kernel to upstream revision 20200717:

       * Prevent operation region reference counts from overflowing in
         some cases (Erik Kaneda).

       * Replace one-element array with flexible-array (Gustavo A. R.
         Silva).

   - Fix ACPI PCI hotplug reference counting (Rafael Wysocki).

   - Drop last bits of the ACPI procfs interface (Thomas Renninger).

   - Drop some redundant checks from the code parsing ACPI tables
     related to NUMA (Hanjun Guo).

   - Avoid redundant object evaluation in the ACPI device properties
     handling code (Heikki Krogerus).

   - Avoid unecessary memory overhead related to storing the signatures
     of the ACPI tables recognized by the kernel (Ard Biesheuvel).

   - Add missing newline characters when printing module parameter
     values in some places (Xiongfeng Wang).

   - Update the link to the ACPI specifications in some places (Tiezhu
     Yang).

   - Use the fallthrough pseudo-keyword in the ACPI code (Gustavo A. R.
     Silva).

   - Drop redundant variable initialization from the APEI code (Colin
     Ian King).

   - Drop uninitialized_var() from the ACPI PAD driver (Jason Yan).

   - Replace HTTP links with HTTPS ones in the ACPI code (Alexander A.
     Klimov)"

* tag 'acpi-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits)
  ACPI: APEI: remove redundant assignment to variable rc
  ACPI: NUMA: Remove the useless 'node >= MAX_NUMNODES' check
  ACPI: NUMA: Remove the useless sub table pointer check
  ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array()
  ACPICA: Update version to 20200717
  ACPICA: Do not increment operation_region reference counts for field units
  ACPICA: Replace one-element array with flexible-array
  ACPI: Replace HTTP links with HTTPS ones
  ACPI: Use valid link to the ACPI specification
  ACPI: OSL: Clean up the removal of unused memory mappings
  ACPI: OSL: Use deferred unmapping in acpi_os_unmap_iomem()
  ACPI: OSL: Use deferred unmapping in acpi_os_unmap_generic_address()
  ACPICA: Preserve memory opregion mappings
  ACPI: OSL: Implement deferred unmapping of ACPI memory
  ACPI: Use fallthrough pseudo-keyword
  PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()
  ACPI: tables: avoid relocations for table signature array
  ACPI: PAD: Eliminate usage of uninitialized_var() macro
  ACPI: sysfs: add newlines when printing module parameters
  ACPI: EC: add newline when printing 'ec_event_clearing' module parameter
  ...
2020-08-03 20:37:22 -07:00
Linus Torvalds
0408497800 Power management updates for 5.9-rc1
- Make the Energy Model cover non-CPU devices (Lukasz Luba).
 
  - Add Ice Lake server idle states table to the intel_idle driver
    and eliminate a redundant static variable from it (Chen Yu,
    Rafael Wysocki).
 
  - Eliminate all W=1 build warnings from cpufreq (Lee Jones).
 
  - Add support for Sapphire Rapids and for Power Limit 4 to the
    Intel RAPL power capping driver (Sumeet Pawnikar, Zhang Rui).
 
  - Fix function name in kerneldoc comments in the idle_inject power
    capping driver (Yangtao Li).
 
  - Fix locking issues with cpufreq governors and drop a redundant
    "weak" function definition from cpufreq (Viresh Kumar).
 
  - Rearrange cpufreq to register non-modular governors at the
    core_initcall level and allow the default cpufreq governor to
    be specified in the kernel command line (Quentin Perret).
 
  - Extend, fix and clean up the intel_pstate driver (Srinivas
    Pandruvada, Rafael Wysocki):
 
    * Add a new sysfs attribute for disabling/enabling CPU
      energy-efficiency optimizations in the processor.
 
    * Make the driver avoid enabling HWP if EPP is not supported.
 
    * Allow the driver to handle numeric EPP values in the sysfs
      interface and fix the setting of EPP via sysfs in the active
      mode.
 
    * Eliminate a static checker warning and clean up a kerneldoc
      comment.
 
  - Clean up some variable declarations in the powernv cpufreq
    driver (Wei Yongjun).
 
  - Fix up the ->enter_s2idle callback definition to cover the case
    when it points to the same function as ->idle correctly (Neal
    Liu).
 
  - Rearrange and clean up the PSCI cpuidle driver (Ulf Hansson).
 
  - Make the PM core emit "changed" uevent when adding/removing the
    "wakeup" sysfs attribute of devices (Abhishek Pandit-Subedi).
 
  - Add a helper macro for declaring PM callbacks and use it in the
    MMC jz4740 driver (Paul Cercueil).
 
  - Fix white space in some places in the hibernate code and make the
    system-wide PM code use "const char *" where appropriate (Xiang
    Chen, Alexey Dobriyan).
 
  - Add one more "unsafe" helper macro to the freezer to cover the NFS
    use case (He Zhe).
 
  - Change the language in the generic PM domains framework to use
    parent/child terminology and clean up a typo and some comment
    fromatting in that code (Kees Cook, Geert Uytterhoeven).
 
  - Update the operating performance points OPP framework (Lukasz
    Luba, Andrew-sh.Cheng, Valdis Kletnieks):
 
    * Refactor dev_pm_opp_of_register_em() and update related drivers.
 
    * Add a missing function export.
 
    * Allow disabled OPPs in dev_pm_opp_get_freq().
 
  - Update devfreq core and drivers (Chanwoo Choi, Lukasz Luba, Enric
    Balletbo i Serra, Dmitry Osipenko, Kieran Bingham, Marc Zyngier):
 
    * Add support for delayed timers to the devfreq core and make the
      Samsung exynos5422-dmc driver use it.
 
    * Unify sysfs interface to use "df-" as a prefix in instance names
      consistently.
 
    * Fix devfreq_summary debugfs node indentation.
 
    * Add the rockchip,pmu phandle to the rk3399_dmc driver DT
      bindings.
 
    * List Dmitry Osipenko as the Tegra devfreq driver maintainer.
 
    * Fix typos in the core devfreq code.
 
  - Update the pm-graph utility to version 5.7 including a number of
    fixes related to suspend-to-idle (Todd Brandt).
 
  - Fix coccicheck errors and warnings in the cpupower utility (Shuah
    Khan).
 
  - Replace HTTP links with HTTPs ones in multiple places (Alexander
    A. Klimov).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl8oO24SHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx7ZQP/0lQ0yABnASnwomdOH6+K/m7rvc+e9FE
 zx5pTDQswhU5tM7SQAIKqe0uSI+okF2UrBrT5onA16F+JUbnrbexJLazBPfVTTGF
 AKpKEQ7Wh69Wz+Y6cQZjm1dTuRL+dlBJuBrzR2tLSnONPMMHuFcO3xd7lgE9UAxC
 oGEf393taA6OqcUNRQIa2gqbq+k1qhKjeDucGkbOaoJ6CL0ZyWI+Tfw1WWaBBGv0
 /2wBd6V513OH8WtQCW6H3YpHmhYW6OwL8w19KyGcjPRGJaeaIP4W/Ng7mkvgL5ZB
 vZqg3XiufFV9uTe8W1NQaVv/NjlN256OteuK809aosTVjD0dhFkhBYg5TLu6HbQq
 C/NciZ+78oLedWLT73EUfw3NyS+V0jk6X2EIlBUwNi0Qw1B1pCifGOCKzWFFe5cr
 ci4xr4FG7dBkxScOxwFAU2s5TdPHLOkGkQtg4jZr0OYDrzkyLEdsnZEUjLPORo+0
 6EBXGfTOSy2CBHcYswRtzJr/1pUTzj7oejhTAMCCuYW2r3VyQtnYcVjlehtp20if
 6BfmGisk8nmtxlSm+/Y2FqKa4bNnSTMmr0UJQ+Rjp0tHs47QeucI0ORfZ5nPaBac
 +ptvIjWmn3xejT/+oAehpH9066Iuy66vzHdnj7x5+WAsmYS8n8OFtlBFkYELmLJB
 3xI5hIl7WtGo
 =8cUO
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "The most significant change here is the extension of the Energy Model
  to cover non-CPU devices (as well as CPUs) from Lukasz Luba.

  There is also some new hardware support (Ice Lake server idle states
  table for intel_idle, Sapphire Rapids and Power Limit 4 support in the
  RAPL driver), some new functionality in the existing drivers (eg. a
  new switch to disable/enable CPU energy-efficiency optimizations in
  intel_pstate, delayed timers in devfreq), some assorted fixes (cpufreq
  core, intel_pstate, intel_idle) and cleanups (eg. cpuidle-psci,
  devfreq), including the elimination of W=1 build warnings from cpufreq
  done by Lee Jones.

  Specifics:

   - Make the Energy Model cover non-CPU devices (Lukasz Luba).

   - Add Ice Lake server idle states table to the intel_idle driver and
     eliminate a redundant static variable from it (Chen Yu, Rafael
     Wysocki).

   - Eliminate all W=1 build warnings from cpufreq (Lee Jones).

   - Add support for Sapphire Rapids and for Power Limit 4 to the Intel
     RAPL power capping driver (Sumeet Pawnikar, Zhang Rui).

   - Fix function name in kerneldoc comments in the idle_inject power
     capping driver (Yangtao Li).

   - Fix locking issues with cpufreq governors and drop a redundant
     "weak" function definition from cpufreq (Viresh Kumar).

   - Rearrange cpufreq to register non-modular governors at the
     core_initcall level and allow the default cpufreq governor to be
     specified in the kernel command line (Quentin Perret).

   - Extend, fix and clean up the intel_pstate driver (Srinivas
     Pandruvada, Rafael Wysocki):

       * Add a new sysfs attribute for disabling/enabling CPU
         energy-efficiency optimizations in the processor.

       * Make the driver avoid enabling HWP if EPP is not supported.

       * Allow the driver to handle numeric EPP values in the sysfs
         interface and fix the setting of EPP via sysfs in the active
         mode.

       * Eliminate a static checker warning and clean up a kerneldoc
         comment.

   - Clean up some variable declarations in the powernv cpufreq driver
     (Wei Yongjun).

   - Fix up the ->enter_s2idle callback definition to cover the case
     when it points to the same function as ->idle correctly (Neal Liu).

   - Rearrange and clean up the PSCI cpuidle driver (Ulf Hansson).

   - Make the PM core emit "changed" uevent when adding/removing the
     "wakeup" sysfs attribute of devices (Abhishek Pandit-Subedi).

   - Add a helper macro for declaring PM callbacks and use it in the MMC
     jz4740 driver (Paul Cercueil).

   - Fix white space in some places in the hibernate code and make the
     system-wide PM code use "const char *" where appropriate (Xiang
     Chen, Alexey Dobriyan).

   - Add one more "unsafe" helper macro to the freezer to cover the NFS
     use case (He Zhe).

   - Change the language in the generic PM domains framework to use
     parent/child terminology and clean up a typo and some comment
     fromatting in that code (Kees Cook, Geert Uytterhoeven).

   - Update the operating performance points OPP framework (Lukasz Luba,
     Andrew-sh.Cheng, Valdis Kletnieks):

       * Refactor dev_pm_opp_of_register_em() and update related drivers.

       * Add a missing function export.

       * Allow disabled OPPs in dev_pm_opp_get_freq().

   - Update devfreq core and drivers (Chanwoo Choi, Lukasz Luba, Enric
     Balletbo i Serra, Dmitry Osipenko, Kieran Bingham, Marc Zyngier):

       * Add support for delayed timers to the devfreq core and make the
         Samsung exynos5422-dmc driver use it.

       * Unify sysfs interface to use "df-" as a prefix in instance
         names consistently.

       * Fix devfreq_summary debugfs node indentation.

       * Add the rockchip,pmu phandle to the rk3399_dmc driver DT
         bindings.

       * List Dmitry Osipenko as the Tegra devfreq driver maintainer.

       * Fix typos in the core devfreq code.

   - Update the pm-graph utility to version 5.7 including a number of
     fixes related to suspend-to-idle (Todd Brandt).

   - Fix coccicheck errors and warnings in the cpupower utility (Shuah
     Khan).

   - Replace HTTP links with HTTPs ones in multiple places (Alexander A.
     Klimov)"

* tag 'pm-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (71 commits)
  cpuidle: ACPI: fix 'return' with no value build warning
  cpufreq: intel_pstate: Fix EPP setting via sysfs in active mode
  cpufreq: intel_pstate: Rearrange the storing of new EPP values
  intel_idle: Customize IceLake server support
  PM / devfreq: Fix the wrong end with semicolon
  PM / devfreq: Fix indentaion of devfreq_summary debugfs node
  PM / devfreq: Clean up the devfreq instance name in sysfs attr
  memory: samsung: exynos5422-dmc: Add module param to control IRQ mode
  memory: samsung: exynos5422-dmc: Adjust polling interval and uptreshold
  memory: samsung: exynos5422-dmc: Use delayed timer as default
  PM / devfreq: Add support delayed timer for polling mode
  dt-bindings: devfreq: rk3399_dmc: Add rockchip,pmu phandle
  PM / devfreq: tegra: Add Dmitry as a maintainer
  PM / devfreq: event: Fix trivial spelling
  PM / devfreq: rk3399_dmc: Fix kernel oops when rockchip,pmu is absent
  cpuidle: change enter_s2idle() prototype
  cpuidle: psci: Prevent domain idlestates until consumers are ready
  cpuidle: psci: Convert PM domain to platform driver
  cpuidle: psci: Fix error path via converting to a platform driver
  cpuidle: psci: Fail cpuidle registration if set OSI mode failed
  ...
2020-08-03 20:28:08 -07:00
Tiezhu Yang
0585c1c06a ACPI: Use valid link to the ACPI specification
Currently, acpi.info is an invalid link to access ACPI specification,
the new valid link is https://uefi.org/specifications.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-07-27 14:11:22 +02:00
Todd Brandt
68f9b22842 pm-graph v5.7 - important s2idle fixes
Important fixes:

 - in s2idle, use timekeeping_freeze trace mark instead of
   machine_suspend to denote entry into s2idle mode.

 - in s2idle, use machine_suspend trace mark to create a new virtual
   device called "s2idle_enter_<n>x". It denotes an s2idle_enter call
   loop of <n> iterations where s2idle was never actually achieved.
   It isn't counted as "freeze time" in the header.

 - in s2idle, only show multiple freeze times if s2idle went in and
   out of resume_noirq. Otherwise multiple freezes are shown with
   "waking" time subtracted (waking time is time spent outside s2idle
   dealing with wakeups).

 - in s2idle summaries, include "FREEZEWAKE" as an issue when at
   least 1ms is spent waking from s2idle. A clean run should only
   wake for the rtc timer.

 - add support for device callbacks with matching names in the same
   phase. In rare cases some devices register multiple callbacks from
   separate drivers using the same name. Without this fix only one is
   shown.

 - add kparamsfmt string back to fix bootgraph

General updates:

 - when suspend_machine is missing, error says "failed in
   suspend_machine"

 - extract target count/time and add to summary title if -multi
   used

 - include any instances of "timeout" in dmesg as issues to be
   logged.

 - fix ftrace parse to handle any number of flags (instead of
   just 4).

 - remove sync/async_device string from device detail, remains in
   hover.

 - when using callgraph (-f) add driver name to callgraph titles.

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-07-27 13:03:36 +02:00
Alexander A. Klimov
fa0866a1d1 cpupower: Replace HTTP links with HTTPS ones
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-07-17 11:58:04 -06:00
Srinivas Pandruvada
f65e1311e9 tools/power/x86/intel-speed-select: Update version for v5.9
Update version for changes released with v5.9 kernel release.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16 10:18:06 -07:00
Srinivas Pandruvada
32279be7e1 tools/power/x86/intel-speed-select: Add retries for mail box commands
Retry mail box command on failure. The default retry count is 3. This can
be changed by "-r|--retry" options. This helps during early bring up of
platforms.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16 10:17:55 -07:00
Srinivas Pandruvada
a85a35fc1d tools/power/x86/intel-speed-select: Add option to delay mbox commands
Add option "p|--pause" to introduce delay between two mail box commands
for test purpose. This delay can be specified in milliseconds. By default
there is no delay between two mailbox commands.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16 10:17:42 -07:00
Srinivas Pandruvada
6374de8489 tools/power/x86/intel-speed-select: Ignore -o option processing on error
When for some reason, CONFIG_TDP_GET_CORE_MASK mailbox command fails, then
don't continue online/offline operation for perf-profile set-config-level
with "-o" option.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16 10:17:33 -07:00
Srinivas Pandruvada
b1d12cef7c tools/power/x86/intel-speed-select: Change path for caching topology info
We want to cache the topology info to a file, which is not preserved
across boot cycle. The current storage in /tmp is getting preserved.
So change the path from /tmp/isst_cpu_topology.dat to
/var/run/isst_cpu_topology.dat.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-07-16 10:17:24 -07:00
Shuah Khan
cbf2527093 cpupower: Fix NULL but dereferenced coccicheck errors
Fix NULL but dereferenced coccicheck errors found by:

make coccicheck MODE=report M=tools/power/cpupower

tools/power/cpupower/lib/cpufreq.c:384:19-23: ERROR: first is NULL but dereferenced.
tools/power/cpupower/lib/cpufreq.c:440:19-23: ERROR: first is NULL but dereferenced.
tools/power/cpupower/lib/cpufreq.c:308:19-23: ERROR: first is NULL but dereferenced.
tools/power/cpupower/lib/cpufreq.c:753:19-23: ERROR: first is NULL but dereferenced.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-07-06 16:11:04 -06:00
Shuah Khan
8e022709c4 cpupower: Fix comparing pointer to 0 coccicheck warns
Fix cocciccheck wanrns found by:
make coccicheck MODE=report M=tools/power/cpupower/

tools/power/cpupower/utils/helpers/bitmask.c:29:12-13: WARNING comparing pointer to 0, suggest !E
tools/power/cpupower/utils/helpers/bitmask.c:29:12-13: WARNING comparing pointer to 0
tools/power/cpupower/utils/helpers/bitmask.c:43:12-13: WARNING comparing pointer to 0

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-07-06 16:10:40 -06:00
Rafael J. Wysocki
ede439be68 Merge branch 'acpica'
* acpica:
  ACPICA: Update version to 20200528
  ACPICA: iASL: add new OperationRegion subtype keyword PlatformRtMechanism
  ACPICA: acpidump: Removed dead code from oslinuxtbl.c
2020-06-10 17:27:28 +02:00
Bob Moore
d82faa0825 ACPICA: acpidump: Removed dead code from oslinuxtbl.c
ACPICA commit 4d938d048790983b8b4252b0f4aeec59dabb476c

ACPICA BZ 1119.

Link: https://github.com/acpica/acpica/commit/4d938d04
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-06-05 13:34:23 +02:00
Linus Torvalds
355ba37d75 Power management updates for 5.8-rc1
- Rework the system-wide PM driver flags to make them easier to
    understand and use and update their documentation (Rafael Wysocki,
    Alan Stern).
 
  - Allow cpuidle governors to be switched at run time regardless of
    the kernel configuration and update the related documentation
    accordingly (Hanjun Guo).
 
  - Improve the resume device handling in the user space hibernarion
    interface code (Domenico Andreoli).
 
  - Document the intel-speed-select sysfs interface (Srinivas
    Pandruvada).
 
  - Make the ACPI code handing suspend to idle print more debug
    messages to help diagnose issues with it (Rafael Wysocki).
 
  - Fix a helper routine in the cpufreq core and correct a typo in
    the struct cpufreq_driver kerneldoc comment (Rafael Wysocki, Wang
    Wenhu).
 
  - Update cpufreq drivers:
 
    * Make the intel_pstate driver start in the passive mode by
      default on systems without HWP (Rafael Wysocki).
 
    * Add i.MX7ULP support to the imx-cpufreq-dt driver and add
      i.MX7ULP to the cpufreq-dt-platdev blacklist (Peng Fan).
 
    * Convert the qoriq cpufreq driver to a platform one, make the
      platform code create a suitable device object for it and add
      platform dependencies to it (Mian Yousaf Kaukab, Geert
      Uytterhoeven).
 
    * Fix wrong compatible binding in the qcom driver (Ansuel Smith).
 
    * Build the omap driver by default for ARCH_OMAP2PLUS (Anders
      Roxell).
 
    * Add r8a7742 SoC support to the dt cpufreq driver (Lad Prabhakar).
 
  - Update cpuidle core and drivers:
 
    * Fix three reference count leaks in error code paths in the
      cpuidle core (Qiushi Wu).
 
    * Convert Qualcomm SPM to a generic cpuidle driver (Stephan
      Gerhold).
 
    * Fix up the execution order when entering a domain idle state in
      the PSCI driver (Ulf Hansson).
 
  - Fix a reference counting issue related to clock management and
    clean up two oddities in the PM-runtime framework (Rafael Wysocki,
    Andy Shevchenko).
 
  - Add ElkhartLake support to the Intel RAPL power capping driver
    and remove an unused local MSR definition from it (Jacob Pan,
    Sumeet Pawnikar).
 
  - Update devfreq core and drivers:
 
    * Replace strncpy() with strscpy() in the devfreq core and use
      lockdep asserts instead of manual checks for a locked mutex in
      it (Dmitry Osipenko, Krzysztof Kozlowski).
 
    * Add a generic imx bus scaling driver and make it register an
      interconnect device (Leonard Crestez, Gustavo A. R. Silva).
 
    * Make the cpufreq notifier in the tegra30 driver take boosting
      into account and delete an unuseful error message from that
      driver (Dmitry Osipenko, Markus Elfring).
 
  - Remove unneeded semicolon from the cpupower code (Zou Wei).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl7VGjwSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx46gP/jGAXlddFEQswi6qUT3Cff0A9mb8CdcX
 dyKrjX4xxo/wtBIAwSN4achxrgse//ayo2dYTzWRDd31W9Azbv+5F+46XsDRz4hL
 pH29u/E66NMtFWnHCmt78NEJn0FzSa0YBC43ZzwFwKktCK9skYIpGN2z6iuXUBSX
 Q5GHqop3zvDsdKQFBGL62xvUw/AmOTPG7ohIZvqWBN2mbOqEqMcoFHT+aUF/NbLj
 +i14dvTH767eDZGRVASmXWQyljjaRWm+SIw4+m8zT1D1Y3d5IFObuMN+9RQl1Tif
 BYjkgJ2oDDMhCJLW7TBuJB+g7exiyaSQds3nMr2ZR+eZbJipICjU4eehNEKIUopU
 DM17tHQfnwZfS/7YbCx3vYQwLkNq37AJyXS9uqCAIFM+0n4xN4/mIVmgWYISLDTs
 1v9olFxtwMRNpjGGQWPJAO7ebB8Zz9qhQv7pIkSQEfwp93/SzvlVf4vvruTeFN9J
 qqG60cDumXWAm+s43eQHJNn5nOd5ocWv0FBpo/cxqKbzxFVWwdB42Cm0SY+rK2ID
 uHdnc2DJcK2c78UVbz3Cmk4272foJt2zxchqjFXXAZPLrOsFfzmti4B28VxGxjmP
 LG3MhH5sdbF4yl/1aSC1Bnrt+PV9Lus6ut/VKhjwIpw8cqiXgpwSbMoDoaBd9UMQ
 ubGz2rplGAtB
 =APdj
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "These rework the system-wide PM driver flags, make runtime switching
  of cpuidle governors easier, improve the user space hibernation
  interface code, add intel-speed-select interface documentation, add
  more debug messages to the ACPI code handling suspend to idle, update
  the cpufreq core and drivers, fix a minor issue in the cpuidle core
  and update two cpuidle drivers, improve the PM-runtime framework,
  update the Intel RAPL power capping driver, update devfreq core and
  drivers, and clean up the cpupower utility.

  Specifics:

   - Rework the system-wide PM driver flags to make them easier to
     understand and use and update their documentation (Rafael Wysocki,
     Alan Stern).

   - Allow cpuidle governors to be switched at run time regardless of
     the kernel configuration and update the related documentation
     accordingly (Hanjun Guo).

   - Improve the resume device handling in the user space hibernarion
     interface code (Domenico Andreoli).

   - Document the intel-speed-select sysfs interface (Srinivas
     Pandruvada).

   - Make the ACPI code handing suspend to idle print more debug
     messages to help diagnose issues with it (Rafael Wysocki).

   - Fix a helper routine in the cpufreq core and correct a typo in the
     struct cpufreq_driver kerneldoc comment (Rafael Wysocki, Wang
     Wenhu).

   - Update cpufreq drivers:

      - Make the intel_pstate driver start in the passive mode by
        default on systems without HWP (Rafael Wysocki).

      - Add i.MX7ULP support to the imx-cpufreq-dt driver and add
        i.MX7ULP to the cpufreq-dt-platdev blacklist (Peng Fan).

      - Convert the qoriq cpufreq driver to a platform one, make the
        platform code create a suitable device object for it and add
        platform dependencies to it (Mian Yousaf Kaukab, Geert
        Uytterhoeven).

      - Fix wrong compatible binding in the qcom driver (Ansuel Smith).

      - Build the omap driver by default for ARCH_OMAP2PLUS (Anders
        Roxell).

      - Add r8a7742 SoC support to the dt cpufreq driver (Lad
        Prabhakar).

   - Update cpuidle core and drivers:

      - Fix three reference count leaks in error code paths in the
        cpuidle core (Qiushi Wu).

      - Convert Qualcomm SPM to a generic cpuidle driver (Stephan
        Gerhold).

      - Fix up the execution order when entering a domain idle state in
        the PSCI driver (Ulf Hansson).

   - Fix a reference counting issue related to clock management and
     clean up two oddities in the PM-runtime framework (Rafael Wysocki,
     Andy Shevchenko).

   - Add ElkhartLake support to the Intel RAPL power capping driver and
     remove an unused local MSR definition from it (Jacob Pan, Sumeet
     Pawnikar).

   - Update devfreq core and drivers:

      - Replace strncpy() with strscpy() in the devfreq core and use
        lockdep asserts instead of manual checks for a locked mutex in
        it (Dmitry Osipenko, Krzysztof Kozlowski).

      - Add a generic imx bus scaling driver and make it register an
        interconnect device (Leonard Crestez, Gustavo A. R. Silva).

      - Make the cpufreq notifier in the tegra30 driver take boosting
        into account and delete an unuseful error message from that
        driver (Dmitry Osipenko, Markus Elfring).

   - Remove unneeded semicolon from the cpupower code (Zou Wei)"

* tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (51 commits)
  cpuidle: Fix three reference count leaks
  PM: runtime: Replace pm_runtime_callbacks_present()
  PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex
  PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR
  PM / devfreq: Replace strncpy with strscpy
  PM / devfreq: imx: Register interconnect device
  PM / devfreq: Add generic imx bus scaling driver
  PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe()
  PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting
  PM: hibernate: Restrict writes to the resume device
  PM: runtime: clk: Fix clk_pm_runtime_get() error path
  cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver
  ACPI: EC: PM: s2idle: Extend GPE dispatching debug message
  ACPI: PM: s2idle: Print type of wakeup debug messages
  powercap: RAPL: remove unused local MSR define
  PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend()
  Documentation: admin-guide: pm: Document intel-speed-select
  PM: hibernate: Split off snapshot dev option
  PM: hibernate: Incorporate concurrency handling
  Documentation: ABI: make current_governer_ro as a candidate for removal
  ...
2020-06-02 13:17:23 -07:00
Linus Torvalds
a5a82e0a59 platform-drivers-x86 for v5.8-1
* Add a support of  the media keys on the ASUS laptop UX325JA/UX425JA
 * ASUS WMI driver can now handle 2-in-1 models T100TA, T100CHI, T100HA, T200TA
 * Big refactoring of Intel SCU driver with Elkhart Lake support has been added
 * Slim Bootloarder firmware update signaling WMI driver has been added
 * Thinkpad ACPI driver can handle dual fan configuration on new P and X models
 * Touchscreen DMI driver has been extended to support
   - MP-man MPWIN895CL tablet
   - ONDA V891 v5 tablet
   - techBite Arc 11.6
   - Trekstor Twin 10.1
   - Trekstor Yourbook C11B
   - Vinga J116
 * Virtual Button driver got a few fixes to detect mode of 2-in-1 tablet models
 * Intel Speed Select tools update
 * Plenty of small cleanups here and there
 
 The following is an automated git shortlog grouped by driver:
 
 acerhdf:
  -  replace space by * in modalias
 
 New drivers:
  - Add Elkhart Lake SCU/PMC support
  - Add Slim Bootloader firmware update signaling driver
 
 asus-laptop:
  -  Drop duplicate check for led_classdev_unregister()
 
 asus-nb-wmi:
  -  Revert "Do not load on Asus T100TA and T200TA"
  -  Do not load on Asus T100TA and T200TA
 
 asus-wmi:
  -  Ignore WMI events with code 0x79
  -  Add support for SW_TABLET_MODE
  -  Move asus_wmi_input_init and _exit lower in the file
  -  Drop duplicate check for led_classdev_unregister()
  -  Reserve more space for struct bias_args
  -  remove redundant initialization of variable status
 
 dcdbas:
  -  Check SMBIOS for protected buffer address
 
 dell-laptop:
  -  don't register micmute LED if there is no token
 
 dell-wmi:
  -  Ignore keyboard attached / detached events
 
 device property:
  -  export set_secondary_fwnode() to modules
 
 eeepc-laptop:
  -  Drop duplicate check for led_classdev_unregister()
 
 hp-wmi:
  -  Introduce HPWMI_POWER_FW_OR_HW as convenient shortcut
  -  Convert simple_strtoul() to kstrtou32()
  -  Refactor postcode_store() to follow standard patterns
 
 intel_cht_int33fe:
  -  Fix spelling issues
  -  Switch to use acpi_dev_hid_uid_match()
  -  Convert to use set_secondary_fwnode()
  -  Convert software node array to group
 
 intel-hid:
  -  Add a quirk to support HP Spectre X2 (2015)
 
 intel_mid_powerbtn:
  -  Convert to use new SCU IPC API
 
 intel_pmc_core:
  -  avoid unused-function warnings
  -  Change Jasper Lake S0ix debug reg map back to ICL
 
 intel_pmc_ipc:
  -  Convert to MFD
  -  Move PCI IDs to intel_scu_pcidrv.c
  -  Drop intel_pmc_ipc_command()
  -  Start using SCU IPC
 
 intel_scu_ipc:
  -  Add managed function to register SCU IPC
  -  Introduce new SCU IPC API
  -  Move legacy SCU IPC API to a separate header
  -  Log more information if SCU IPC command fails
  -  Split out SCU IPC functionality from the SCU driver
 
 intel_scu_ipcutil:
  -  Convert to use new SCU IPC API
 
 intel-speed-select:
  -  Fix speed-select-base-freq-properties output on CLX-N
 
 intel_telemetry:
  -  Add telemetry_get_pltdata()
  -  Convert to use new SCU IPC API
 
 intel-vbtn:
  -  Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type
  -  Detect switch position before registering the input-device
  -  Move detect_tablet_mode() to higher in the file
  -  Fix probe failure on devices with only switches
  -  Also handle tablet-mode switch on "Detachable" and "Portable" chassis-types
  -  Do not advertise switches to userspace if they are not there
  -  Split keymap into buttons and switches parts
  -  Use acpi_evaluate_integer()
 
 ISST:
  -  Increase timeout
 
 lg-laptop:
  -  Drop duplicate check for led_classdev_unregister()
 
 MAINTAINERS:
  -  Add me as maintainer of Intel SCU drivers
  -  Update entry for Intel Broxton PMC driver
 
 Merges of immutable branches:
  - Merge branch 'for-next'
  - Merge branch 'ib-mfd-x86-usb-watchdog-v5.7'
  - Merge branch 'ib-pdx86-properties'
 
 mfd:
  -  intel_soc_pmic_mrfld: Convert to use new SCU IPC API
  -  intel_soc_pmic_bxtwc: Convert to use new SCU IPC API
  -  intel_soc_pmic: Add SCU IPC member to struct intel_soc_pmic
 
 samsung-laptop:
  -  Drop duplicate check for led_classdev_unregister()
 
 software node:
  -  Allow register and unregister software node groups
 
 sony-laptop:
  -  Make resuming thermal profile safer
  -  SNC calls should handle BUFFER types
 
 thinkpad_acpi:
  -  Replace custom approach by kstrtoint()
  -  Use strndup_user() in dispatch_proc_write()
  -  Replace next_cmd(&buf) with strsep(&buf, ",")
  -  Drop duplicate check for led_classdev_unregister()
  -  Remove always false 'value < 0' statement
  -  Add support for dual fan control
 
 tools/power/x86/intel-speed-select:
  -  Fix invalid core mask
  -  Increase CPU count
  -  Fix json perf-profile output output
  -  Update version
  -  Enable clos for turbo-freq enable
  -  Fix CLX-N package information output
  -  Check support status before enable
  -  Change debug to error
 
 toshiba_acpi:
  -  Drop duplicate check for led_classdev_unregister()
 
 touchscreen_dmi:
  -  Update Trekstor Twin 10.1 entry
  -  Add info for the Trekstor Yourbook C11B
  -  Drop comma in terminator line
  -  add Vinga J116 touchscreen
  -  Add info for the ONDA V891 v5 tablet
  -  Add touchscreen info for techBite Arc 11.6.
  -  Add info for the MP-man MPWIN895CL tablet
 
 usb:
  -  typec: mux: Convert the Intel PMC Mux driver to use new SCU IPC API
 
 watchdog:
  -  iTCO: fix link error
  -  intel-mid_wdt: Convert to use new SCU IPC API
 
 wmi:
  -  Describe function parameters
  -  Fix indentation in some cases
  -  Replace UUID redefinitions by their originals
 
 x86/platform/intel-mid:
  -  Add empty stubs for intel_scu_devices_[create|destroy]()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl7WCcoACgkQb7wzTHR8
 rCi+Pg//dDpMXTxCcXivHZPJHwuAxbwPeJRV9uDKKBSnKqfxyYu37oQf8AQiLTsL
 PZOAIiwlrXw0Jd+EH79zN2DyCujBg16B6mf4dx3fMK95OWhPoslofyKRwl8kOBP5
 QRZVpuwo6ayKwXV3cyFwWjXyWYJFL7+J3x+jjBmufBsoDJTn9edOCUa3oeHG0BYB
 4A91pVKwtfNqqdL/pwd+A9mEZrFJnVilyPRoxTipbpPJqvWQi9dYgb3wHKt/1NM3
 xPNd1GQHCI0Of4NGChszY0XdN4SyxFuyLmn1mogYq82r084QA4pLROb0+VFD2npd
 DQ4jxJqOwQDtC3gm789OeN6bZ0qnkO9HBwEmzVH7rwiajZxGW7U5rCgNYBahlTgr
 gY4kXIBXyOCO2/bItmrSvWDNBvVxD/THCfL4Q/cn6bNTy4TLTHAl2psQcsXIBT6/
 Z5SdmHMhxc80eDAOTtSJj0ODeDGvAgbV20n+X260FFAsefDBuXkYMHEaRBf9n2LJ
 8k9tauXZ6JdIc4K8/K+BaVl761Okl6PJPMTL7JsFqueHpyzZS7WclCYH5QQ1iN56
 10QzddSGp+4HfFFCG2cVkjXG2AnUgT3kQgEOHyLIxp6yKY1PghFXHTEmrLuheYum
 jK93qSva5tvvZzy9UejXXsIkDyg76zaIla3rmEEYAmgzPDawR9I=
 =pprB
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.8-1' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver updates from Andy Shevchenko:

 - Add a support of the media keys on the ASUS laptop UX325JA/UX425JA

 - ASUS WMI driver can now handle 2-in-1 models T100TA, T100CHI, T100HA,
   T200TA

 - Big refactoring of Intel SCU driver with Elkhart Lake support has
   been added

 - Slim Bootloarder firmware update signaling WMI driver has been added

 - Thinkpad ACPI driver can handle dual fan configuration on new P and X
   models

 - Touchscreen DMI driver has been extended to support
    - MP-man MPWIN895CL tablet
    - ONDA V891 v5 tablet
    - techBite Arc 11.6
    - Trekstor Twin 10.1
    - Trekstor Yourbook C11B
    - Vinga J116

 - Virtual Button driver got a few fixes to detect mode of 2-in-1 tablet
   models

 - Intel Speed Select tools update

 - Plenty of small cleanups here and there

* tag 'platform-drivers-x86-v5.8-1' of git://git.infradead.org/linux-platform-drivers-x86: (89 commits)
  platform/x86: dcdbas: Check SMBIOS for protected buffer address
  platform/x86: asus_wmi: Reserve more space for struct bias_args
  platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type
  platform/x86: intel-hid: Add a quirk to support HP Spectre X2 (2015)
  platform/x86: touchscreen_dmi: Update Trekstor Twin 10.1 entry
  platform/x86: touchscreen_dmi: Add info for the Trekstor Yourbook C11B
  platform/x86: hp-wmi: Introduce HPWMI_POWER_FW_OR_HW as convenient shortcut
  platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32()
  platform/x86: hp-wmi: Refactor postcode_store() to follow standard patterns
  platform/x86: acerhdf: replace space by * in modalias
  platform/x86: ISST: Increase timeout
  tools/power/x86/intel-speed-select: Fix invalid core mask
  tools/power/x86/intel-speed-select: Increase CPU count
  tools/power/x86/intel-speed-select: Fix json perf-profile output output
  platform/x86: dell-wmi: Ignore keyboard attached / detached events
  platform/x86: dell-laptop: don't register micmute LED if there is no token
  platform/x86: thinkpad_acpi: Replace custom approach by kstrtoint()
  platform/x86: thinkpad_acpi: Use strndup_user() in dispatch_proc_write()
  platform/x86: thinkpad_acpi: Replace next_cmd(&buf) with strsep(&buf, ",")
  platform/x86: intel-vbtn: Detect switch position before registering the input-device
  ...
2020-06-02 12:56:58 -07:00
Linus Torvalds
d861f6e682 Misc cleanups in the SMP hotplug and cross-call code.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAl7VJfsRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1ihcA/+Ko18kdGRPAlShM9qkDWO5N80p1LEp7F0
 ku1OxPAz9ii7K/jlnGr9wYYPxsIL3lbFeqFE7q5q5socXufaN8MUj9sVCmN7ScmR
 zO84aTHtxrJJhKIPM6HkUTbVl5KrQaud3F/J56CCjuKPsJWy9iuCGnKtfKK38bx+
 qJEfVKVm95Bv0NSEvqvci3DKKPYjzpKzuuttHXQ8Z80zG94FEkwj0JwZzttIjLl1
 rgRMgWTH7+3tQCMnZEfXG8xBxbXS9i3hKyr/v5QTNgIICyXGquPkf5MiwjJFS2Xb
 wpPqNh8HTo5kUJstYygRjcftatU7K72h2Rz/CoUkN2roNYlvRAhdBaBMwN0cGaG8
 pPhnLHHHRYZjl4fiROgRwVV3A6LcAHSrIcKzwGrvpCSpqyVozPGsmD/e8ZG1JYpC
 vxESTZbCDywng2Ls8jqQBut+dFGElvopXl1s004bCak89IFR4p15qojMJK2MSsqu
 BxhjIoqp8/f1fsAX+1p0RBEYnEr1KFtWa+nY8aVKL6bEx+Y7Qyq0ypMGtKavP06X
 VMcPMm1gYeXoGpLaTLYBRL5t7Rmm7i+xufuDQKUJetenfh2YS4aQ9lfV+rsQH1YE
 wavQrbwThfBZ9K1XkEmOkSqONysZ2YAtK9slKzciQIZvY3V8NbKAmBudCgqTgarp
 xqeW9NFfeFc=
 =Rr2n
 -----END PGP SIGNATURE-----

Merge tag 'smp-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull SMP updates from Ingo Molnar:
 "Misc cleanups in the SMP hotplug and cross-call code"

* tag 'smp-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  cpu/hotplug: Remove __freeze_secondary_cpus()
  cpu/hotplug: Remove disable_nonboot_cpus()
  cpu/hotplug: Fix a typo in comment "broadacasted"->"broadcasted"
  smp: Use smp_call_func_t in on_each_cpu()
2020-06-01 13:38:55 -07:00
Srinivas Pandruvada
873e391ff3 tools/power/x86/intel-speed-select: Fix invalid core mask
The core mask display is wrong in some cases. This is showing more
cpus than the mask has. This is because mask is 64 bit but it used
with BIT() macro to get the presence of CPU which doesn't support
unsigned long long. Added a new macro for BIT_ULL and use that
to get the presence of a CPU.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-22 11:18:15 -07:00
Srinivas Pandruvada
e16ea66365 tools/power/x86/intel-speed-select: Increase CPU count
Increase CPU count so that more than 64 is supported in one request.

For example:
sudo ./intel-speed-select -d --cpu 0-66 core-power assoc -clos 0
The above command stops at 63. With this change, it can support more
CPU numbers from 0-255.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-22 11:18:15 -07:00
Prarit Bhargava
aa8b650b1a tools/power/x86/intel-speed-select: Fix json perf-profile output output
The 'intel-speed-select -f json perf-profile get-lock-status' command
outputs the package, die, and cpu data as separate fields.

ex)

  "package-0": {
    "die-0": {
      "cpu-0": {

Commit 74062363f8 ("tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json") prettied this output so that it is a single line for
some json output commands and the same should be done for other commands.

Output package, die, and cpu info in a single line when using json output.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-22 11:18:15 -07:00
Srinivas Pandruvada
b14cd9d598 tools/power/x86/intel-speed-select: Update version
Update version to include 5.8 series enhancements.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11 11:30:55 -07:00
Srinivas Pandruvada
7983ed6f86 tools/power/x86/intel-speed-select: Enable clos for turbo-freq enable
turbo-freq enable, requires clos enable. So this is a two step process,
when "-a" option is used. This is causing confusion to users. So enable
clos by default for turbo-freq enable.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11 11:30:39 -07:00
Prarit Bhargava
4c35527a92 intel-speed-select: Fix speed-select-base-freq-properties output on CLX-N
On CLX-N, the perf-profile-level's output is terminated before the
speed-select-base-freq-properties are output which results in a corrupt
json file.

Adjust the output of speed-select-base-freq-properties by one on CLX-N.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11 11:30:25 -07:00
Prarit Bhargava
28c59ae696 tools/power/x86/intel-speed-select: Fix CLX-N package information output
On CLX-N the perf-profile output is missing the package, die, and cpu
output.  On CLX-N the pkg_dev struct will never be evaluated by the core
code so pkg_dev.processed is always 0 and the package, die, and cpu
information is never output.

Set the pkg_dev.processed flag to 1 for CLX-N processors.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: andriy.shevchenko@linux.intel.com
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org
2020-05-11 11:30:16 -07:00
Srinivas Pandruvada
3d904f066f tools/power/x86/intel-speed-select: Check support status before enable
When turbo-freq or base-freq feature is not supported, the enable will
fail. So first check support status and print error.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11 11:30:07 -07:00
Srinivas Pandruvada
e78fded4ca tools/power/x86/intel-speed-select: Change debug to error
When turbo-freq is enabled, we can't disable core-power. Currently
it prints debug message to warn. Change this to error message.

While here remove "\n" from calls to isst_display_error_info_message(),
as it will be added again during actual print.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2020-05-11 11:29:52 -07:00
Zou Wei
7b0bf99b9e cpupower: Remove unneeded semicolon
Fixes coccicheck warnings:

tools/power/cpupower/utils/cpupower-info.c:65:2-3: Unneeded semicolon
tools/power/cpupower/utils/cpupower-set.c:75:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c:120:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:175:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:56:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:75:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c:82:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/nhm_idle.c:94:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/snb_idle.c:80:2-3: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-05-08 10:13:26 -06:00
Qais Yousef
5655585589 cpu/hotplug: Remove disable_nonboot_cpus()
The single user could have called freeze_secondary_cpus() directly.

Since this function was a source of confusion, remove it as it's
just a pointless wrapper.

While at it, rename enable_nonboot_cpus() to thaw_secondary_cpus() to
preserve the naming symmetry.

Done automatically via:

	git grep -l enable_nonboot_cpus | xargs sed -i 's/enable_nonboot_cpus/thaw_secondary_cpus/g'

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Link: https://lkml.kernel.org/r/20200430114004.17477-1-qais.yousef@arm.com
2020-05-07 15:18:40 +02:00
Todd Brandt
2c9a583be1 pm-graph v5.6
sleepgraph:
 - force usage of python3 instead of using system default
 - fix bugzilla 204773 (https://bugzilla.kernel.org/show_bug.cgi?id=204773)
 - fix issue of platform info not being reset in -multi (logs fill up)
 - change -ftop call to "pm_suspend", this is one level below state_store
 - add -wificheck command to read out the current wifi device details
 - change -wifi behavior to poll /proc/net/wireless for wifi connect
 - add wifi reconnect time to timeline, include time in summary column
 - add "fail on wifi_resume" to timeline and summary when wifi fails
 - add a set of commands to collect data before/after suspend in the log
 - add "-cmdinfo" command which prints out all the data collected
 - check for cmd info tools at start, print found/missing in green/red
 - fix kernel suspend time calculation: tool used to look for start of
    pm_suspend_console, but the order has changed. latest kernel starts
    with ksys_sync, use this instead
 - include time spent in mem/disk in the header (same as freeze/standby)
 - ignore turbostat 32-bit capability warnings
 - print to result.txt when -skiphtml is used, just say result: pass
 - don't exit on SIGTSTP, it's a ctrl-Z and the tool may come back
 - -multi argument supports duration as well as count: hours, minutes, seconds
 - update the -multi status output to be more informative
 - -maxfail sets maximum consecutive fails before a -multi run is aborted
 - in -summary, ignore dmesg/ftrace/html files that are 0 size

bootgraph:
 - force usage of python3 instead of using system default

README:
 - add endurance testing instructions

Makefile:
 - remove pycache on uninstall

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-04-20 10:37:02 +02:00
Linus Torvalds
ff2ae607c6 SPDX patches for 5.7-rc1.
Here are 3 SPDX patches for 5.7-rc1.
 
 One fixes up the SPDX tag for a single driver, while the other two go
 through the tree and add SPDX tags for all of the .gitignore files as
 needed.
 
 Nothing too complex, but you will get a merge conflict with your current
 tree, that should be trivial to handle (one file modified by two things,
 one file deleted.)
 
 All 3 of these have been in linux-next for a while, with no reported
 issues other than the merge conflict.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCXodg5A8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykySQCgy9YDrkz7nWq6v3Gohl6+lW/L+rMAnRM4uTZm
 m5AuCzO3Azt9KBi7NL+L
 =2Lm5
 -----END PGP SIGNATURE-----

Merge tag 'spdx-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx

Pull SPDX updates from Greg KH:
 "Here are three SPDX patches for 5.7-rc1.

  One fixes up the SPDX tag for a single driver, while the other two go
  through the tree and add SPDX tags for all of the .gitignore files as
  needed.

  Nothing too complex, but you will get a merge conflict with your
  current tree, that should be trivial to handle (one file modified by
  two things, one file deleted.)

  All three of these have been in linux-next for a while, with no
  reported issues other than the merge conflict"

* tag 'spdx-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx:
  ASoC: MT6660: make spdxcheck.py happy
  .gitignore: add SPDX License Identifier
  .gitignore: remove too obvious comments
2020-04-03 13:12:26 -07:00
Linus Torvalds
dba43fc4ba platform-drivers-x86 for v5.7-1
* Fix for improper handling of fan_boost_mode in sysfs for ASUS laptops.
 * On newer ASUS laptops the 1st battery is named differently, here is a fix.
 * Fix Lex 2I385SW to allow both network cards to be used.
 * The power integrated circuit driver for Surface 3 has been added.
 * Refactor and clean up of Intel PMC driver and enable it on Intel Jasper Lake.
 * Clean up of Dell RBU driver.
 * Big update for Intel Speed Select technology support tool and driver.
 
 The following is an automated git shortlog grouped by driver:
 
 asus-wmi:
  -  Support laptops where the first battery is named BATT
  -  Fix return value of fan_boost_mode_store
 
 dell_rbu:
  -  Unify format of the printed messages
  -  Use max_t() to get rid of casting
  -  Simplify cleanup code in create_packet()
  -  don't open code list_for_each_entry*()
  -  Use sysfs_create_group() API
 
 GPD pocket fan:
  -  Fix error message when temp-limits are out of range
 
 i2c-multi-instantiate:
  -  Replace zero-length array with flexible-array member
 
 intel-hid:
  -  Move MODULE_DEVICE_TABLE() closer to the table
 
 intel_pmc_core:
  -  Make pmc_core_substate_res_show() generic
  -  Make pmc_core_lpm_display() generic for platforms that support sub-states
  -  Add slp_s0_offset attribute back to tgl_reg_map
  -  Remove duplicate 'if' to create debugfs entry
  -  Relocate pmc_core_*_display() to outside of CONFIG_DEBUG_FS
  -  Add debugfs support to access live status registers
  -  Dump low power status registers on an S0ix.y failure
  -  Add an additional parameter to pmc_core_lpm_display()
  -  Remove slp_s0 attributes from tgl_reg_map
  -  Refactor the driver by removing redundant code
  -  Add debugfs entry for low power mode status registers
  -  Add debugfs entry to access sub-state residencies
  -  Add Atom based Jasper Lake (JSL) platform support
 
 intel-vbtn:
  -  Move MODULE_DEVICE_TABLE() closer to the table
 
 ISST:
  -  Fix wrong unregister type
 
 PDx86:
  -  Kconfig: Fix a typo
  -  Kconfig: Group modules by companies and functions
  -  MAINTAINERS: Sort entries in database for PDx86
  -  Makefile: Group modules by companies and functions
 
 platform/x86/intel-uncore-freq:
  -  Add release callback
  -  Fix static checker issue and potential race condition
 
 pmc_atom:
  -  Add Lex 2I385SW to critclk_systems DMI table
 
 sony-laptop:
  -  Use scnprintf() for avoiding potential buffer overflow
 
 surface3_power:
  -  Fix always true condition in mshw0011_space_handler()
  -  Fix Kconfig section ordering
  -  Add missed headers
  -  Reformat GUID assignment
  -  Drop useless macro ACPI_PTR()
  -  Prefix POLL_INTERVAL with SURFACE_3
  -  Simplify mshw0011_adp_psr() to one liner
  -  Use dev_err() instead of pr_err()
  -  Drop unused structure definition
  -  MSHW0011 rev-eng implementation
 
 tools/power/x86/intel-speed-select:
  -  Fix a typo in error message
  -  Update version
  -  Avoid duplicate Package strings for json
  -  Add display for enabled cpus count
  -  Print friendly warning for bad command line
  -  Fix avx options for turbo-freq feature
  -  Improve CLX commands
  -  Show error for invalid CPUs in the options
  -  Improve core-power result and error display
  -  Kernel interface error handling
  -  Improve error display for turbo-freq feature
  -  Improve error display for base-freq feature
  -  Improve output of perf-profile commands
  -  Enhance help for core-power assoc
  -  Display error for invalid priority type
  -  Check feature status first
  -  Improve error display for perf-profile feature
  -  Add an API for error/information print
  -  Enhance --info option
  -  Enhance help
  -  Helpful warning for missing kernel interface
  -  Store topology information
  -  Max CPU count calculation when CPU0 is offline
  -  Special handling for CPU 0 online/offline
  -  Use more verbiage for clos information
  -  Enhance core-power info command
  -  Make target CPU optional for core-power info
  -  Warn for invalid package id
  -  Fix last cpu number
  -  Fix mailbox usage for CLOS_PM_QOS_CONFIG
  -  Avoid duplicate names for json parsing
  -  Fix display for turbo-freq auto mode
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl6DMoEACgkQb7wzTHR8
 rChW3w//WgzlhbKCl3EO8WjfSGmQHwszLq/Zcj+LLzoPQOl7t1nel1cEIWv7Y4+P
 /I24l2pqAD2JRgs03hNDg9i/YovPuqhLtS7t7hDNKFfNGdOhIJQkMwhrjXcapbBj
 UgE5cFbzXjf4400Tv1EkOylIZhOlpTmv5eGk/Dbw+5adTOlTH3MYLntv8ZfBulOh
 A6Dolto+zPvrbCyrMrgJSpQRIx1Rd8JV3YDXQRTpimmdsTJ7VFC55i1RLJSQ5sGw
 rF2qAekMExKScezSV8Yy9npDGJ1qUolhj/PciLPr71rmIuWqfdqc8eLeLmsJzIfY
 WO4TIQ3CTTY1FlZsOZyoeh+Kla//hRyaUoHAU0xEWDD9xKJBdzOIMEs4O/islWYL
 ILHs7ZdZPrHFI63mxyF0Mw5SgsSG1c6VNa19+H+YxpC4Pp8hbo891RRF7+7hBbdT
 YRT5yaQMD2M8QowMgxJQ7Xt3Kyz/jRO/8L59v202v3RzJvJ0UJhT+fmHV6OSz5MD
 SLOmLsXcWvgteNxM8TQ5yxmuDJdQVRuJqQpvPhysqlUEyhoTSLsII5evu/U/jXA4
 vIx+QfUejDiy0vMeQu2xUOzxIzSzja6gLO6hKgiAw2cvUMqbOi2CIG7qwbRZkIis
 uj/GxlwiNfIsEKUE4728ivOHwT9Yke1x+QLl/oVwMh7zSgb+noE=
 =G0jF
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.7-1' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver updates from Andy Shevchenko:

 - Fix for improper handling of fan_boost_mode in sysfs for ASUS
   laptops.

 - On newer ASUS laptops the 1st battery is named differently, here is a
   fix.

 - Fix Lex 2I385SW to allow both network cards to be used.

 - The power integrated circuit driver for Surface 3 has been added.

 - Refactor and clean up of Intel PMC driver and enable it on Intel
   Jasper Lake.

 - Clean up of Dell RBU driver.

 - Big update for Intel Speed Select technology support tool and driver.

* tag 'platform-drivers-x86-v5.7-1' of git://git.infradead.org/linux-platform-drivers-x86: (75 commits)
  platform/x86: surface3_power: Fix always true condition in mshw0011_space_handler()
  platform/x86: surface3_power: Fix Kconfig section ordering
  platform/x86: surface3_power: Add missed headers
  platform/x86: surface3_power: Reformat GUID assignment
  platform/x86: surface3_power: Drop useless macro ACPI_PTR()
  platform/x86: surface3_power: Prefix POLL_INTERVAL with SURFACE_3
  platform/x86: surface3_power: Simplify mshw0011_adp_psr() to one liner
  platform/x86: surface3_power: Use dev_err() instead of pr_err()
  platform/x86: surface3_power: Drop unused structure definition
  platform/x86: surface3_power: MSHW0011 rev-eng implementation
  platform/x86: intel_pmc_core: Make pmc_core_substate_res_show() generic
  platform/x86: intel_pmc_core: Make pmc_core_lpm_display() generic for platforms that support sub-states
  tools/power/x86/intel-speed-select: Fix a typo in error message
  tools/power/x86/intel-speed-select: Update version
  tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
  tools/power/x86/intel-speed-select: Add display for enabled cpus count
  tools/power/x86/intel-speed-select: Print friendly warning for bad command line
  tools/power/x86/intel-speed-select: Fix avx options for turbo-freq feature
  tools/power/x86/intel-speed-select: Improve CLX commands
  tools/power/x86/intel-speed-select: Show error for invalid CPUs in the options
  ...
2020-03-31 16:43:40 -07:00
Doug Smythies
2f6bdb05e0 tools/power/x86/intel_pstate_tracer: fix a broken y-axis scale
A fixed y-axis scale was missed during a change to autoscale.

Correct it.

Fixes: 709bd70d07 ("tools/power/x86/intel_pstate_tracer: change several graphs to autoscale y-axis")
Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-03-26 20:05:58 +01:00
Masahiro Yamada
d198b34f38 .gitignore: add SPDX License Identifier
Add SPDX License Identifier to all .gitignore files.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 11:50:48 +01:00
Len Brown
b95fffb9b4 tools/power turbostat: update version
A stitch in time saves nine.

Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-21 00:48:02 -04:00
Len Brown
abdcbdb265 tools/power turbostat: Print cpuidle information
Print cpuidle driver and governor.

Originally-by: Antti Laakso <antti.laakso@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-21 00:47:47 -04:00
Masanari Iida
9945a24798 tools/power/x86/intel-speed-select: Fix a typo in error message
This patch fix a spelling typo in error message.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:27 +02:00
Srinivas Pandruvada
1e46d1d59a tools/power/x86/intel-speed-select: Update version
Fair number of changes including bug fixes done to change version.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:23 +02:00
Srinivas Pandruvada
74062363f8 tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.

So "Package-0" key name will change to "Package-0-die-x:cpu-x".

For example:
$sudo ./intel-speed-select -f json  perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
  "package-0:die-0:cpu-0": {
    "perf-profile-level-0": {
      "cpu-count": "32",
      "enable-cpu-count": "32",
...
...
 "package-1:die-0:cpu-16": {

    "perf-profile-level-0": {
      "cpu-count": "32",
      "enable-cpu-count": "32",
      "enable-cpu-mask": "ffff0000,ffff0000",
...
...

For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:23 +02:00
Srinivas Pandruvada
e44d76569b tools/power/x86/intel-speed-select: Add display for enabled cpus count
In addition to total CPU count also display "enabled-cpu-count" for
perf-profile info command. This will show number of CPUs in the
"enable-cpu-mask".

For example:

 perf-profile-level-4
        cpu-count:32
        enable-cpu-count:16
        enable-cpu-mask:e42d0000,e42d0000

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:23 +02:00
Srinivas Pandruvada
4a9603534a tools/power/x86/intel-speed-select: Print friendly warning for bad command line
When user specifies invalid option, display "Unknown Option: ignore",
instead of "no match". Also display error for garbage on the command
line.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:23 +02:00
Srinivas Pandruvada
b86639e195 tools/power/x86/intel-speed-select: Fix avx options for turbo-freq feature
Specifying "avx2" and "avx512" option for display filter doesn't work
with short option "-r", only works with --try-type. Also compare full
6 characters for "avx512" string.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:22 +02:00
Srinivas Pandruvada
7fc9fefd99 tools/power/x86/intel-speed-select: Improve CLX commands
CLX doesn't have capability to change the feature in the hardware, but
this acts as "--auto | -a" option. So even if user didn't specify the
option, use this as --auto | -a to set cpufreq scaling frequency limits.

Also remove perror with debug_printf as they don't bring any value.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:22 +02:00
Srinivas Pandruvada
070fdea13d tools/power/x86/intel-speed-select: Show error for invalid CPUs in the options
When --cpu or -c is used to specify target CPUs and non of them are valid,
display error.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:22 +02:00
Srinivas Pandruvada
fe6fb2165a tools/power/x86/intel-speed-select: Improve core-power result and error display
This change adds improved error display and handling for commands related
to core-power feature. The changes include:
- Replace perror with helpful error message
- Use ordered priority for SKX based platform by default as the
proportional priority is not supported
- Don't show weight and epp in help and also give error when user
tries to set them in SKX based platforms
- Range check for epp and weights and display error

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:22 +02:00
Srinivas Pandruvada
95f8e56945 tools/power/x86/intel-speed-select: Kernel interface error handling
Treat a case when mailbox/mmio command can't be handled by the kernel
drivers when the module is removed or send a command which no driver can
handle. In this case ENOTTY result is returned, so print error.

Also when the isst_if_mmio module is removed, we can't send CLOS message
messages via Mailbox on non SKX based platforms. When this module is
removed,  isst_platform_info.mmio_supported is set to 0. So it can't be
used as a condition to send via mailbox. Here replace check for Skylake
based platform to send via mailbox, other platforms can't use mailbox in
lieu of MMIO.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:22 +02:00
Srinivas Pandruvada
a9fd6ae739 tools/power/x86/intel-speed-select: Improve error display for turbo-freq feature
This change adds improved error display and handling for commands related
to turbo-freq feature. The changes include:
- Replace perror/fprintf with helpful error message
- Error for not specifying TDP level when required
- Show error for invalid bucket number
- Show message to enable core-power before enabling turbo-freq feature

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:22 +02:00
Srinivas Pandruvada
39bae0fce4 tools/power/x86/intel-speed-select: Improve error display for base-freq feature
This change adds improved error display and handling for commands related
to base-freq feature. The changes include:
- Replace perror/fprintf with helpful error message
- Error for not specifying TDP level when required
- For CLX show help which shows limitation

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:21 +02:00
Srinivas Pandruvada
3d1a857981 tools/power/x86/intel-speed-select: Improve output of perf-profile commands
Improve output of perf-profile commands:
get-config-enabled
get-lock-status

Instead of showing 0/1, show meaningful strings. Also show error when
command is failed.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:21 +02:00
Srinivas Pandruvada
68e2f10971 tools/power/x86/intel-speed-select: Enhance help for core-power assoc
Enhance help to specify CPU and clos by an example.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:21 +02:00
Srinivas Pandruvada
6d1f2dc8a5 tools/power/x86/intel-speed-select: Display error for invalid priority type
When priority type for core-power enable command is anything more than 1
display error before change to 1, which is ordered priority.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:21 +02:00
Srinivas Pandruvada
6c8edba37c tools/power/x86/intel-speed-select: Check feature status first
Before looking for information about the base-freq or turbo-freq details,
first check if the feature is supported at that level. If not print error
and return.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:21 +02:00
Srinivas Pandruvada
ac9d05ea4c tools/power/x86/intel-speed-select: Improve error display for perf-profile feature
This change adds improved error display and handling for commands related
to perf-profile feature. The changes include:
- When invalid TDP level is passed. display error and exit
- Replace perror with helpful error message
- Show error when TDP level can't be set
- Print error when information can't be read for a level
- Validate user options for invalid level
- Display error for TDP lock status

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:21 +02:00
Srinivas Pandruvada
87e115b325 tools/power/x86/intel-speed-select: Add an API for error/information print
Add a common API which can be used to print all error and information
messages. In this way a common format can be used.

For json output an error index in suffixed to make unique error key.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
1ba148ae9e tools/power/x86/intel-speed-select: Enhance --info option
Add additional information, which will allow user to detect available
features. This will allow users to check presence of features before
continue to test.
A sample output:

$sudo ./intel-speed-select --info

Intel(R) Speed Select Technology
Executing on CPU model:85[0x55]
Platform: API version : 1
Platform: Driver version : 1
Platform: mbox supported : 1
Platform: mmio supported : 0
Intel(R) SST-PP (feature perf-profile) is not supported
Only performance level 0 (base level) is present
TDP level change control is locked
Intel(R) SST-TF (feature turbo-freq) is supported
Intel(R) SST-BF (feature base-freq) is supported
Intel(R) SST-CP (feature core-power) is supported

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
addd116d8d tools/power/x86/intel-speed-select: Enhance help
Enhance help message which adds some example. The changes include:
- Print help when options are not recognized.
- For CLX, display only options which are applicable.
- Sort options in alphatical order.
- Disply help() instead of error:
"Feature name and|or command not specified"
- Remove duplicate display of
Intel(R) Speed Select Technology

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
f362cdccca tools/power/x86/intel-speed-select: Helpful warning for missing kernel interface
When the device file "/dev/isst_interface" is not present, instead of
failing on access, check at the start and print a helpful warning.

Here CLX platform is an exception, which doesn't depend on the device
file. So continue for CLX platform.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
fb18615828 tools/power/x86/intel-speed-select: Store topology information
Once the CPU is offline, the topology information (core-id, package-id,
die-id) is not accessible via sysfs. So when user selects a config level
more than base config 0 and offlined CPUs to match the config level,
to return to base config he has to manually online CPUs before. Without
this CPUs information mapping from Punit CPU numbering will lot work
as it needs atlest package id for each CPU.

To avoid this additional steps store the topology information in a file
, which is created on the very first run after boot. Since system boots
in base config and all CPUs are online, we can get information about
every CPU.

Once any of the APIs like get_physical_package_id(),
get_physical_core_id() or get_physical_die_id() fails to read from
sysfs, read from the stored mapping file.

This mapping file is stored in /tmp file system. so on every boot
it is recreated to make sure that any new CPUs are added to the
system before boot are taken into account.

But don't use the stored physical device id  when trying to get
information for CPU to send message in for_each_online_package_in_set().
Here use the real value from syfs and in case fails try the next CPU.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
864dc09e69 tools/power/x86/intel-speed-select: Max CPU count calculation when CPU0 is offline
Currently /sys/devices/system/cpu/cpu0/topology/thread_siblings is used to
get the max CPU count. But when CPU0 is offline, then this file will be
absent.

So add processing so that we can get count from any first CPU in the
system. which is online.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
696691985c tools/power/x86/intel-speed-select: Special handling for CPU 0 online/offline
When "-o" option for force online/offline is used with command:
perf-profile set-config-level

If the config level calls for CPU 0 online/offline, then call fails
as there is special kernel setup required for CPU 0 online/offline
and the currently not setup for that.

But when call is for online CPU 0, then don't fail. Just warn that
this system is not setup for CPU 0 online/offline.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:20 +02:00
Srinivas Pandruvada
6320c9fb91 tools/power/x86/intel-speed-select: Use more verbiage for clos information
Instead of displaying 0 and 1 for enable status, display "disabled"
and "enabled" respectively.

Similarly for priority type, display "ordered or proportional" instead
of 0 and 1.

An example display:

$intel-speed-select -c 1 core-power info
Intel(R) Speed Select Technology
..
 package-0
  die-0
    cpu-1
      core-power
        support-status:supported
        enable-status:enabled
        clos-enable-status:enabled
        priority-type:proportional

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:19 +02:00
Srinivas Pandruvada
143ad32209 tools/power/x86/intel-speed-select: Enhance core-power info command
In addition to CLOS enable status, also show the core-power feature
status. This will help why clos enable status didn't give desired
results as the core-power feature may be disabled or unsupported.

The new display looks as follows:

$intel-speed-select core-power info
Intel(R) Speed Select Technology
..
 package-0
  die-0
    cpu-0
      core-power
        support-status:supported
        enable-status:enabled
        clos-enable-status:1
        priority-type:0

In the above display "support-status" and "enable-status", shows the
status of the core-power feature and "clos-enable-status", shows the
status of the clos.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:19 +02:00
Srinivas Pandruvada
f5205f4931 tools/power/x86/intel-speed-select: Make target CPU optional for core-power info
Currently "-c" is a mandatory option for "core-power info" command. Make
this optional as this is a per package/die property. When not specified,
it will print info for every package/die.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:19 +02:00
Srinivas Pandruvada
f0e0b4d17b tools/power/x86/intel-speed-select: Warn for invalid package id
When CPU is offline, we can't get package id. So print error for this
and don't use output.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:19 +02:00
Srinivas Pandruvada
ced2f5304d tools/power/x86/intel-speed-select: Fix last cpu number
Here topology_max_cpus is used for total CPU count, not the last CPU
number. So remove "-1".

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:01 +02:00
Srinivas Pandruvada
8ddbda7624 tools/power/x86/intel-speed-select: Fix mailbox usage for CLOS_PM_QOS_CONFIG
Even for the products using MMIO, this message needs to be sent via
mail box. The previous fix done for this didn't properly address this.
That fix simply removed sending command via MMIO, but still didn't
trigger sending via mailbox.

Add additional condition to check for CLOS_PM_QOS_CONFIG, when MMIO
is supported on a platform.

Fixes: cd0e637065 (tools/power/x86/intel-speed-select: Use mailbox for CLOS_PM_QOS_CONFIG)
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-20 14:46:01 +02:00
Len Brown
fcaa681c03 tools/power turbostat: Fix 32-bit capabilities warning
warning: `turbostat' uses 32-bit capabilities (legacy support in use)

Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:28 -04:00
Len Brown
1f81c5efc0 tools/power turbostat: Fix missing SYS_LPI counter on some Chromebooks
Some Chromebook BIOS' do not export an ACPI LPIT, which is how
Linux finds the residency counter for CPU and SYSTEM low power states,
that is exports in /sys/devices/system/cpu/cpuidle/*residency_us

When these sysfs attributes are missing, check the debugfs attrubte
from the pmc_core driver, which accesses the same counter value.

Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:28 -04:00
Chen Yu
f670840070 tools/power turbostat: Support Elkhart Lake
From a turbostat point of view the Tremont-based Elkhart Lake
is very similar to Goldmont, reuse the code of Goldmont.

Elkhart Lake does not support 'group turbo limit counter'
nor C3, adjust the code accordingly.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:27 -04:00
Chen Yu
d7814c3098 tools/power turbostat: Support Jasper Lake
Jasper Lake, like Elkhart Lake, uses a Tremont CPU.
So reuse the code.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:27 -04:00
Chen Yu
23274faf96 tools/power turbostat: Support Ice Lake server
From a turbostat point of view, Ice Lake server looks like Sky Lake server.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:27 -04:00
Chen Yu
4bf7132a0a tools/power turbostat: Support Tiger Lake
From a turbostat point of view, Tiger Lake looks like Ice Lake.

Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:27 -04:00
Len Brown
d8d005ba6a tools/power turbostat: Fix gcc build warnings
Warning: ‘__builtin_strncpy’ specified bound 20 equals destination size
	[-Wstringop-truncation]

reduce param to strncpy, to guarantee that a null byte is always copied
into destination buffer.

Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:27 -04:00
Chen Yu
081c54323b tools/power turbostat: Support Cometlake
From a turbostat point of view, Cometlake is like Kabylake.

Suggested-by: Rui Zhang <rui.zhang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2020-03-20 00:32:27 -04:00
Mike Gilbert
2de7fb60a4 cpupower: avoid multiple definition with gcc -fno-common
Building cpupower with -fno-common in CFLAGS results in errors due to
multiple definitions of the 'cpu_count' and 'start_time' variables.

./utils/idle_monitor/snb_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
multiple definition of `cpu_count';
./utils/idle_monitor/nhm_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
first defined here
...
./utils/idle_monitor/cpuidle_sysfs.o:./utils/idle_monitor/cpuidle_sysfs.c:22:
multiple definition of `start_time';
./utils/idle_monitor/amd_fam14h_idle.o:./utils/idle_monitor/amd_fam14h_idle.c:85:
first defined here

The -fno-common option will be enabled by default in GCC 10.

Bug: https://bugs.gentoo.org/707462
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-03-02 08:53:34 -07:00
Srinivas Pandruvada
3b0fe3bab3 tools/power/x86/intel-speed-select: Avoid duplicate names for json parsing
For the command
"intel-speed-select perf-profile info":

There are two instances of “speed-select-turbo-freq” underneath
“perf-profile-level-0” for each package. When we load the output into
python with json.load(), the second instance overwrites the first.

Result is that we can only access:
"speed-select-turbo-freq": {
            "bucket-0": {
              "high-priority-cores-count": "2",
              "high-priority-max-frequency(MHz)": "3000",
              "high-priority-max-avx2-frequency(MHz)": "2800",
              "high-priority-max-avx512-frequency(MHz)": "2600"
            },
Because it is a duplicate of "speed-select-turbo-freq": "disabled"
Same is true for "speed-select-base-freq".

To avoid this add "-properties" suffix for the second instance to
differentiate.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-02-10 17:47:38 +02:00
Srinivas Pandruvada
14a8aa4964 tools/power/x86/intel-speed-select: Fix display for turbo-freq auto mode
When mailbox command for the turbo-freq enable fails, then don't display
result for auto-mode. When turbo-freq enable fails, there is no point
to set CPU priorities.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-02-10 17:47:38 +02:00
Linus Torvalds
cf3c8f84d1 More power manadement updates for 5.6-rc1
Prevent cpufreq from creating excessively large stack frames and fix
 the handling of devices deleted during system-wide resume in the PM
 core (Rafael Wysocki), revert a problematic commit affecting the
 cpupower utility and correct its man page (Thomas Renninger,
 Brahadambal Srinivasan), and improve the intel_pstate_tracer
 utility (Doug Smythies).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl4z9xsSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxRDYQAJKGKxja7SWIeEMNAVb7ji9VM9qLFmDc
 sqDqUbqjB3Po2t/1RVN/7W1GUxA5cmvbd2gW3dNLddDd1HgM5LH+fzQSRCtxI10x
 Hw3sk1IoKBcH/wCJdBm8JJLDu5A8nU+bTWX1rLjz/qRu2AomLxlNzNQ0ocPfIHKX
 5ZQbtJRqMHan6tx9SAbrE5BA4WP6UrZ2lzQmKLFk7pBynV4wTAaUmixxc8FqA0Lv
 Dm+IIubi0X31CtcrcO8/jgsduLYJpRqJ0P/xievlph38I6nUZ0KrI/gGcHYRg/3y
 1jOtwvpQ+YZ15jXgBCjjB/w5acIzo5apcyOmsn5+wi/sGD5q5vjJs9+sQp98sjdC
 IdRLO8ooIGPptbS/juGZMcaF8YsqCMVlPcE0ybSAqyV82v6ozlFo2NgXXkIGrXiq
 682mx84jpWtpoFR4roDkGGS1/kZvH0cuKu0K48F//h+Sh+GLmsS0JUFdjEAfBGnh
 OEGsZmcuYf+VKGqQuXbWHe/xS4TbRAJ/SnEOX0Tqu4SPsIn2X7DvHfhOSzs5izrI
 euhjSNkRWgkABOIFvAtf0G8UFdRxNAU9+mBTjto3kPjaRwy+yGbVuhJPn0elng2h
 y4impgtyQ9dWPpSfnAX84F4qH2q3MLpskDTEbxovS7mCMsVxR6pvApzKLIfGhdfD
 cuk/ooyTuQG/
 =ctQq
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more power manadement updates from Rafael Wysocki:
 "Prevent cpufreq from creating excessively large stack frames and fix
  the handling of devices deleted during system-wide resume in the PM
  core (Rafael Wysocki), revert a problematic commit affecting the
  cpupower utility and correct its man page (Thomas Renninger,
  Brahadambal Srinivasan), and improve the intel_pstate_tracer utility
  (Doug Smythies)"

* tag 'pm-5.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  tools/power/x86/intel_pstate_tracer: change several graphs to autoscale y-axis
  tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility
  Correction to manpage of cpupower
  cpufreq: Avoid creating excessively large stack frames
  PM: core: Fix handling of devices deleted during system-wide resume
  cpupower: Revert library ABI changes from commit ae2917093f
2020-01-31 14:36:35 -08:00
Doug Smythies
709bd70d07 tools/power/x86/intel_pstate_tracer: change several graphs to autoscale y-axis
Processors have exceeded some of the fixed y-axis scale maximum values.
Change them to autoscale the y-axis.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-01-28 23:46:03 +01:00
Doug Smythies
e749e09db3 tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility
Some syntax needs to be more rigorous for python 3.
Backwards compatibility tested with python 2.7

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-01-28 23:46:03 +01:00
Rafael J. Wysocki
a7aebdeb13 linux-cpupower-5.6-rc1
This cpupower update for Linux 5.6-rc1 consists of a revert from
 Thomas Renninger and a manpage correction from Brahadambal Srinivasan.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAl4wdGEACgkQCwJExA0N
 QxxpHA/+PpX0rTNxsWfW5zu4jk0ggJ9+Ll5Ne/82VOSYEWgW6kchg6s0tDc2CcUk
 cW2Y88VFy5JA6rybi/ivVlEbjdDUej62fUjMgmMEWtkIBo7C7VrKoS7LX4rz5Hqb
 ry3B604LLwRprLcy9eEqRtdmW6NNRGkC0lkjCMgFEtt6/TFKOnEPasnP3+Dd9KlF
 M1bubMxipfjIAROFj5lR6W9zy+yuiID/NP8VneTkjB9IQwaMR5zShO+3xQ4iLimP
 WGjNhpF8aNIAD+gk+7Cu7OcczVcqgj2R/Atu+0i2mgZDdTFDR0XSegUsBXTmzEla
 2YPDO4qAXQK3HXFRC1yNW4SnA93PNtGOAJTxRL4HGCznwiO/mF8wfhP3x5hrlGqg
 OSoVIah5QERilH9TGyw+AEpzafYGgYK478537H16PSxcGKj1egjFeaC/6Rt9VOtr
 q2pOyLjx552xugsjgNTG5O706pFw2JMPDgd9qlRQgf4Bn6q97vw2aDq1wnK6OAkK
 QwB3zkPrdjkLspDNBfEj/rXYjsFiayvZY2QCydRouM7T8UeGZuoQFqk7mbfx3gA9
 oXC8jlivKT0LYJGVBkibGfiyNAYF2bvnXrlyEk5Y4anHZ8GSeA0krkLBTxDDz6GN
 YjbHH+6LpItgyp9ItUyoGOVDDxx7mUVEtRjlltdQmYZHu7yRrCY=
 =CjtJ
 -----END PGP SIGNATURE-----

Merge tag 'linux-cpupower-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Pull cpupower utility updates for v5.6 from Shuah Khan:

"This cpupower update for Linux 5.6-rc1 consists of a revert
 from Thomas Renninger and a manpage correction from Brahadambal
 Srinivasan."

* tag 'linux-cpupower-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  Correction to manpage of cpupower
  cpupower: Revert library ABI changes from commit ae2917093f
2020-01-28 23:38:45 +01:00
Linus Torvalds
c0275ae758 Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpu-features updates from Ingo Molnar:
 "The biggest change in this cycle was a large series from Sean
  Christopherson to clean up the handling of VMX features. This both
  fixes bugs/inconsistencies and makes the code more coherent and
  future-proof.

  There are also two cleanups and a minor TSX syslog messages
  enhancement"

* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
  x86/cpu: Remove redundant cpu_detect_cache_sizes() call
  x86/cpu: Print "VMX disabled" error message iff KVM is enabled
  KVM: VMX: Allow KVM_INTEL when building for Centaur and/or Zhaoxin CPUs
  perf/x86: Provide stubs of KVM helpers for non-Intel CPUs
  KVM: VMX: Use VMX_FEATURE_* flags to define VMCS control bits
  KVM: VMX: Check for full VMX support when verifying CPU compatibility
  KVM: VMX: Use VMX feature flag to query BIOS enabling
  KVM: VMX: Drop initialization of IA32_FEAT_CTL MSR
  x86/cpufeatures: Add flag to track whether MSR IA32_FEAT_CTL is configured
  x86/cpu: Set synthetic VMX cpufeatures during init_ia32_feat_ctl()
  x86/cpu: Print VMX flags in /proc/cpuinfo using VMX_FEATURES_*
  x86/cpu: Detect VMX features on Intel, Centaur and Zhaoxin CPUs
  x86/vmx: Introduce VMX_FEATURES_*
  x86/cpu: Clear VMX feature flag if VMX is not fully enabled
  x86/zhaoxin: Use common IA32_FEAT_CTL MSR initialization
  x86/centaur: Use common IA32_FEAT_CTL MSR initialization
  x86/mce: WARN once if IA32_FEAT_CTL MSR is left unlocked
  x86/intel: Initialize IA32_FEAT_CTL MSR at boot
  tools/x86: Sync msr-index.h from kernel sources
  selftests, kvm: Replace manual MSR defs with common msr-index.h
  ...
2020-01-28 12:46:42 -08:00
Linus Torvalds
55816dc1a5 ACPI updates for 5.6-rc1
- Update the ACPICA code in the kernel to upstream revision
    20200110 including:
 
    * Update of copyright notices to 2020 (Bob Moore).
 
    * Dispatcher fix to always generate buffer objects for the ASL
      create_field() operator (Maximilian Luz).
 
    * Debugger cleanup (Colin Ian King).
 
    * Disassembler change to create buffer fields in
      ACPI_PARSE_LOAD_PASS1 (Erik Kaneda).
 
    * UNIX line ending support for non-windows builds in acpisrc
      (Erik Kaneda).
 
  - Update the list of ACPICA maintainers (Rafael Wysocki).
 
  - Add Intel Tiger Lake ACPI device IDs to the ACPI DPTF, ACPI fan,
    int340x_thermal and intel-hid drivers (Gayatri Kammela).
 
  - Make the ACPI fan driver create additional sysfs attributes to
    expose power states information for fans (Srinivas Pandruvada).
 
  - Fix up the ACPI battery driver to deal with unexpected battery
    capacity information in a better way (Hans de Goede).
 
  - Add ACPI backlight quirks for Lenovo E41-25/45 and MSI MS-7721
    boards (Aaron Ma, Hans de Goede).
 
  - Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch
    to the ACPI button driver (Jason Ekstrand).
 
  - Drop TIMER_DEFERRABLE from the GHES polling mode timer function
    flags to make it run precisely at the configured time (Bhaskar
    Upadhaya).
 
  - Fix race condition related to the reference counting of query
    handlers in the ACPI EC driver (Rafael Wysocki).
 
  - Fix ACPI tools build issue (Zhengyuan Liu).
 
  - Replace dma_request_slave_channel() with dma_request_chan() in the
    firmware guide documentation for ACPI (Peter Ujfalusi).
 
  - Fix typo in a comment and clean up function parameter data type
    inconsistencies (Kacper Piwiński, Tian Tao).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl4u2n8SHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxT6MP/jjGgOHOLiw7pUxR0PZ0pr8VZ8NcSxp6
 8YpqfD5ABu/Y+/FYUacMRpMXQ1Jy6KMLLzb2uLInBi2f+BksucDpwpQoK1uRc6u3
 JS7Q78OrOr7RZHqWsUHWVdI1A+bpyhbkwyw2b45HRfY4tLRe9+X7s2Dh+i3qip4E
 A7jPM2fcHgkJV6V0EPwG2BG5bKudlfvWLvySsHl8d0AwDf+GbLrrGY7hbPArQW1C
 tBxt5DG/5WUT8RqJoXaCMHbuqGdihs71WHxU9nIOww04In6MfQHYgt7+FVT1J329
 KZXFfvJaJWBNO9u7QoUvSe8qpHLFpUC2/ZW9TawSkHXrYhAsIO8jKoJXZGSncKZZ
 huU4owh6cHhPJ3YMFj84I5C5YSUaMeX3sbZu0vqObTPMcwB4HIrkHyMAR5zgu+Zb
 kBDTTExeRSdSN6IzfvC2xbpW2G6Q3WuuyVd7klNN7E+7ZRkQAOuq5Pr+gdMejlza
 BrYkK0UdRN+V1YnjENxf+86hAbuTiD329tYNiQxzgyb+Y8dLrugLb9n0P5RWfLbt
 r2r/tBKMEq2Pzis55ICTEwMfSXixomJDdQ8+XWmV8Evdbq7O1zq1KHRZbFFYVclS
 aqWXimFCfSwPdXfvwN7xPa2khNtaKxcsKb7mxq3R31Thzs29iFmJMxFf6ousaMdf
 VoYkCQiwQTpC
 =qOut
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to the most recent upstream
  revision (20200110), add new hardware support to a handful of ACPI
  drivers, make the ACPI fan driver expose power states information for
  fans, add some more quirks, fix bugs and clean up assorted things.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20200110
     including:
      - Update of copyright notices to 2020 (Bob Moore).
      - Dispatcher fix to always generate buffer objects for the ASL
        create_field() operator (Maximilian Luz).
      - Debugger cleanup (Colin Ian King).
      - Disassembler change to create buffer fields in
        ACPI_PARSE_LOAD_PASS1 (Erik Kaneda).
      - UNIX line ending support for non-windows builds in acpisrc (Erik
        Kaneda).

   - Update the list of ACPICA maintainers (Rafael Wysocki).

   - Add Intel Tiger Lake ACPI device IDs to the ACPI DPTF, ACPI fan,
     int340x_thermal and intel-hid drivers (Gayatri Kammela).

   - Make the ACPI fan driver create additional sysfs attributes to
     expose power states information for fans (Srinivas Pandruvada).

   - Fix up the ACPI battery driver to deal with unexpected battery
     capacity information in a better way (Hans de Goede).

   - Add ACPI backlight quirks for Lenovo E41-25/45 and MSI MS-7721
     boards (Aaron Ma, Hans de Goede).

   - Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch to
     the ACPI button driver (Jason Ekstrand).

   - Drop TIMER_DEFERRABLE from the GHES polling mode timer function
     flags to make it run precisely at the configured time (Bhaskar
     Upadhaya).

   - Fix race condition related to the reference counting of query
     handlers in the ACPI EC driver (Rafael Wysocki).

   - Fix ACPI tools build issue (Zhengyuan Liu).

   - Replace dma_request_slave_channel() with dma_request_chan() in the
     firmware guide documentation for ACPI (Peter Ujfalusi).

   - Fix typo in a comment and clean up function parameter data type
     inconsistencies (Kacper Piwiński, Tian Tao)"

* tag 'acpi-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (25 commits)
  ACPICA: Update version to 20200110
  ACPICA: All acpica: Update copyrights to 2020 Including tool signons.
  apei/ghes: Do not delay GHES polling
  ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch
  ACPI: PPTT: Consistently use unsigned int as parameter type
  ACPI: EC: Reference count query handlers under lock
  ACPICA: Update the list of maintainers
  ACPICA: Update version to 20191213
  ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator
  ACPICA: acpisrc: add unix line ending support for non-windows build
  ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1
  ACPICA: debugger: fix spelling mistake "adress" -> "address"
  ACPI: video: Do not export a non working backlight interface on MSI MS-7721 boards
  docs: firmware-guide: ACPI: Replace dma_request_slave_channel() with dma_request_chan()
  thermal: int340x_thermal: Add Tiger Lake ACPI device IDs
  platform/x86: intel-hid: Add Tiger Lake ACPI device ID
  ACPI: fan: Add Tiger Lake ACPI device ID
  ACPI: DPTF: Add Tiger Lake ACPI device IDs
  ACPI: fan: Expose fan performance state information
  tools/power/acpi: fix compilation error
  ...
2020-01-27 11:48:47 -08:00
Brahadambal Srinivasan
8c30fa7666 Correction to manpage of cpupower
Manpage of cpupower is listing wrong sub-commands in "See Also"
section. The option for cpupower-idle(1) should actually be
cpupower-idle-info(1) and cpupower-idle-set(1). This patch corrects
this anomaly.

Signed-off-by: Brahadambal Srinivasan <latha@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-01-27 08:43:31 -07:00
Rafael J. Wysocki
ca11abf113 Merge branches 'acpi-tables', 'acpi-button', 'acpi-ec', 'acpi-doc' and 'acpi-tools'
* acpi-tables:
  ACPI: PPTT: Consistently use unsigned int as parameter type

* acpi-button:
  ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch

* acpi-ec:
  ACPI: EC: Reference count query handlers under lock

* acpi-doc:
  docs: firmware-guide: ACPI: Replace dma_request_slave_channel() with dma_request_chan()

* acpi-tools:
  tools/power/acpi: fix compilation error
2020-01-27 10:58:05 +01:00
Srinivas Pandruvada
19be0b2a2e tools/power/x86/intel-speed-select: Update version
As we added new set of mailbox commands, increment version.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-01-20 11:39:32 +02:00
Srinivas Pandruvada
097a522257 tools/power/x86/intel-speed-select: Change the order for clos disable
In turbo-freq or base-freq auto mode, for disable, first disable the feature and
then disable clos.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-01-20 11:39:31 +02:00
Srinivas Pandruvada
78e77b7dfd tools/power/x86/intel-speed-select: Fix result display for turbo-freq auto mode
The turbo-freq enable with auto mode, prints result for the last possible
CPU, which is not correct when either CPU is not present or user wants
command to be limited to a single die/package. For example, in the
below command user wants to limit to die/package 0, but the
"turbo-freq --auto" result is displayed using the other package.

$ sudo intel-speed-select -c 0 turbo-freq enable -a
Intel(R) Speed Select Technology
 package-0
  die-0
    cpu-0
      turbo-freq
        enable:success
 package--1
  die-0
    cpu-31
      turbo-freq --auto
        enable:success

Since we do have to traverse all CPUs, don't display CPU info for
"turbo-freq --auto", as we already displayed the result for
turbo-freq enable with the CPU information.

With the fix, the same command results in:

$ sudo intel-speed-select -c 0 turbo-freq enable -a
Intel(R) Speed Select Technology
package-0
  die-0
    cpu-0
      turbo-freq
        enable:success
      turbo-freq --auto
        enable:success

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-01-20 11:39:31 +02:00
Srinivas Pandruvada
645feeb2f5 tools/power/x86/intel-speed-select: Add support for core-power discovery
It is possible that BIOS may not enable core-power feature. In this case
this additional interface will allow to enable from this utility. Also
the information dump, includes the current status of core-power.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-01-20 11:39:31 +02:00
Thomas Renninger
41ddb7e1f7 cpupower: Revert library ABI changes from commit ae2917093f
Commit ae2917093f ("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: ae2917093f ("tools/power/cpupower: Display boost frequency separately")

Cc: stable@vger.kernel.org
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-01-17 15:21:42 -07:00
Sean Christopherson
f6505c88bf tools/x86: Sync msr-index.h from kernel sources
Sync msr-index.h to pull in recent renames of the IA32_FEATURE_CONTROL
MSR definitions.  Update KVM's VMX selftest and turbostat accordingly.
Keep the full name in turbostat's output to avoid breaking someone's
workflow, e.g. if a script is looking for the full name.

While using the renamed defines is by no means necessary, do the sync
now to avoid leaving a landmine that will get stepped on the next time
msr-index.h needs to be refreshed for some other reason.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20191221044513.21680-4-sean.j.christopherson@intel.com
2020-01-13 17:42:57 +01:00
Bob Moore
800ba7c5ea ACPICA: All acpica: Update copyrights to 2020 Including tool signons.
ACPICA commit 8b9c69d0984067051ffbe8526f871448ead6a26b

Link: https://github.com/acpica/acpica/commit/8b9c69d0
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-01-13 11:52:48 +01:00
Zhengyuan Liu
1985f8c7f9 tools/power/acpi: fix compilation error
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: d5a4b1a540 ("tools/power/acpi: Remove direct kernel source include reference")
Signed-off-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-12-17 23:44:33 +01:00
Linus Torvalds
67b8ed29e0 platform-drivers-x86 for v5.5-1
* 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.
 
 The following is an automated git shortlog grouped by driver:
 
 acerhdf:
  -  Add support for Acer Aspire 7551
  -  Rename Peter Feuerer to Peter Kaestle
 
 Add System76 ACPI driver:
  - Add System76 ACPI driver
 
 asus-laptop:
  -  switch to using polled mode of input devices
 
 classmate-laptop:
  -  remove unused variable
 
 dell-laptop:
  -  disable kbd backlight on Inspiron 10xx
 
 hdaps:
  -  switch to using polled mode of input devices
 
 hp-wmi:
  -  Fix ACPI errors caused by passing 0 as input size
  -  Fix ACPI errors caused by too small buffer
 
 huawei-wmi:
  -  Remove unnecessary battery mutex
  -  No need to check for battery name
  -  Stricter battery thresholds set
  -  Fix a precision vs width printf bug
  -  Avoid use of global variable when possible
  -  No need to keep pointer to platform device
  -  Don't leak memory on the exit
  -  huawei_wmi can be static
  -  Add debugfs support
  -  Add fn-lock support
  -  Add battery charging thresholds
  -  Implement huawei wmi management
  -  Add quirks and module parameters
  -  Move to platform driver
 
 i2c-multi-instantiate:
  -  Fail the probe if no IRQ provided
 
 intel_cht_int33fe:
  -  Split code to Micro-B and Type-C
 
 intel_int0002_vgpio:
  -  Pass irqchip when adding gpiochip
 
 intel_pmc_core:
  -  Add Comet Lake (CML) platform support to intel_pmc_core driver
  -  Fix the SoC naming inconsistency
 
 intel_punit_ipc:
  -  Drop useless label
  -  use devm_platform_ioremap_resource() to simplify code
  -  Avoid error message when retrieving IRQ
 
 peaq-wmi:
  -  switch to using polled mode of input devices
 
 platform/mellanox:
  -  Fix Kconfig indentation
  -  Add bootctl driver for Mellanox BlueField Soc
 
 tools/power/x86/intel-speed-select:
  -  Display TRL buckets for just base config level
  -  Ignore missing config level
  -  Increment version
  -  Use core count for base-freq mask
  -  Support platform with limited Intel(R) Speed Select
  -  Use Frequency weight for CLOS
  -  Make CLOS frequency in MHz
  -  Use mailbox for CLOS_PM_QOS_CONFIG
  -  Auto mode for CLX
  -  Correct CLX-N frequency units
  -  Change display of "avx" to "avx2"
  -  Extend command set for perf-profile
  -  Implement base-freq commands on CascadeLake-N
  -  Implement 'perf-profile info' on CascadeLake-N
  -  Implement CascadeLake-N help and command functions structures
  -  Add check for CascadeLake-N models
  -  Make process_command generic
  -  Add int argument to command functions
  -  Refuse to disable core-power when getting used
  -  Turbo-freq feature auto mode
  -  Base-freq feature auto mode
  -  Remove warning for unused result
 
 toshiba_acpi:
  -  do not select INPUT_POLLDEV
 
 touchscreen_dmi:
  -  Add info for the ezpad 6 m4 tablet
  -  Add touchscreen platform data for the Schneider SCT101CTM tablet
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl3f20sACgkQb7wzTHR8
 rChciA//cvV45JxTLdbadW55L3nCDqa0poqCVqoCWOl3HvpEYw0uDakzD7AaxayL
 E4Vow+5puH2O0qqhkJSY3ZXMzKVB+h7lbe/97HfBOKJbXENgI9uVSX7TRcJJ1Bfj
 lelcA2GYtEm2Ig+YhsPCVVGU1NEF7+qvtDFR8WCExVfz7KLAQFQpm3bKqsOzBE4/
 atMjZmdU3gFW8e6AVyGP28N8lSGKZeY5i9mGv/tRG2aRS6y1gZjRPFi81awk/Ptb
 ujl+KmyQX/h31hU9Nxr1jEaAVjSEKyie9lLMKobmZldfzrpqE8sA3xe6BCfZfrdL
 WV4Db/92KI78LJljdoUlTg4JNZMn+Mi/N7jgs7ufbaXP9z7nrICZ6DKSYGW4MPXg
 j6A7iejXCohhUwvEtK0Zk0FlVhUreh5JHFyDKFlVR/A0sG0o9KrzyqUcmsySLIqX
 0p9abBFBgzplyUm8unryg1gKIrH1Mw0/41qzsJ8Tt7TPQBY6EKNtc28TGKtdIihe
 QNArtJwOorE5V7Hlp0Kbvn7cOeMa/w+gyQ7Fm4i2m8EpXICukYDCER85hnhc+JLs
 hGxIrdEZlN6jYhbMzQ7ue7m19wsbVgiB4zjy9tCRQUwg+/Y5QtKQ3nLWXrP22cR2
 Kw0BsE0hByzJ5hFJl/RLo3G0vBDYdh5s+lNVGDatkj0Y6b9dqSw=
 =KkPQ
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.5-1' of git://git.infradead.org/linux-platform-drivers-x86

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-12-01 18:24:25 -08:00
Srinivas Pandruvada
1434a3d357 tools/power/x86/intel-speed-select: Display TRL buckets for just base config level
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-21 14:31:34 +02:00
Srinivas Pandruvada
20183ccd3e tools/power/x86/intel-speed-select: Ignore missing config level
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-21 14:27:32 +02:00
Srinivas Pandruvada
5c14aba778 tools/power/x86/intel-speed-select: Increment version
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-07 19:00:25 +02:00
Srinivas Pandruvada
de7f9d3ddc tools/power/x86/intel-speed-select: Use core count for base-freq mask
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-07 19:00:25 +02:00
Srinivas Pandruvada
7af5a95bb7 tools/power/x86/intel-speed-select: Support platform with limited Intel(R) Speed Select
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-07 19:00:25 +02:00
Srinivas Pandruvada
21c3390d61 tools/power/x86/intel-speed-select: Use Frequency weight for CLOS
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-07 19:00:25 +02:00
Srinivas Pandruvada
40dee9dda3 tools/power/x86/intel-speed-select: Make CLOS frequency in MHz
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-07 19:00:25 +02:00
Srinivas Pandruvada
cd0e637065 tools/power/x86/intel-speed-select: Use mailbox for CLOS_PM_QOS_CONFIG
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-07 19:00:25 +02:00
Srinivas Pandruvada
a9b2f8e2fa tools/power/x86/intel-speed-select: Auto mode for CLX
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-07 19:00:25 +02:00
Srinivas Pandruvada
91d928147b tools/power/x86/intel-speed-select: Correct CLX-N frequency units
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-07 19:00:25 +02:00
Srinivas Pandruvada
82d4a34ee6 tools/power/x86/intel-speed-select: Change display of "avx" to "avx2"
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-07 19:00:24 +02:00
Srinivas Pandruvada
263225c983 tools/power/x86/intel-speed-select: Extend command set for perf-profile
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-07 19:00:24 +02:00
Janakarajan Natarajan
4611a4fb0c cpupower: ToDo: Update ToDo with ideas for per_cpu_schedule handling
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-05 17:23:23 -07:00
Janakarajan Natarajan
6af2ed53f0 cpupower: mperf_monitor: Update cpupower to use the RDPRU instruction
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-05 17:22:56 -07:00
Janakarajan Natarajan
7adafe541f cpupower: mperf_monitor: Introduce per_cpu_schedule flag
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-05 17:22:46 -07:00
Janakarajan Natarajan
d3f5d2a192 cpupower: Move needs_root variable into a sub-struct
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-05 17:22:01 -07:00
Abhishek Goel
d80a4ac208 cpupower : Handle set and info subcommands correctly
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-11-04 13:11:57 -07:00
Prarit Bhargava
1aa7177cdc tools/power/x86/intel-speed-select: Implement base-freq commands on CascadeLake-N
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-15 11:02:30 +03:00
Prarit Bhargava
062e4aac92 tools/power/x86/intel-speed-select: Implement 'perf-profile info' on CascadeLake-N
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-15 11:02:30 +03:00
Prarit Bhargava
c829f0ef7b tools/power/x86/intel-speed-select: Implement CascadeLake-N help and command functions structures
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-15 11:02:29 +03:00
Prarit Bhargava
1c1d935c84 tools/power/x86/intel-speed-select: Add check for CascadeLake-N models
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-15 11:02:29 +03:00
Prarit Bhargava
210369dc73 tools/power/x86/intel-speed-select: Make process_command generic
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-15 11:02:29 +03:00
Prarit Bhargava
ce1326a2f9 tools/power/x86/intel-speed-select: Add int argument to command functions
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-15 11:02:29 +03:00
Srinivas Pandruvada
4e26fabfe1 tools/power/x86/intel-speed-select: Refuse to disable core-power when getting used
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-15 11:02:29 +03:00
Srinivas Pandruvada
a6a82f9bcd tools/power/x86/intel-speed-select: Turbo-freq feature auto mode
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-15 11:02:29 +03:00
Srinivas Pandruvada
354bd06f40 tools/power/x86/intel-speed-select: Base-freq feature auto mode
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-15 11:02:29 +03:00
Srinivas Pandruvada
abd120e3bd tools/power/x86/intel-speed-select: Remove warning for unused result
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-15 11:02:28 +03:00
Nathan Chancellor
7e5705c635 tools/power/cpupower: Fix initializer override in hsw_ext_cstates
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: 7ee767b69b ("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-10-01 17:38:12 -06:00
Linus Torvalds
baff384b0e platform-drivers-x86 for v5.4-2
* 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.
 
 The following is an automated git shortlog grouped by driver:
 
 asus-wmi:
  -  Make it depend on ACPI battery API
 
 i2c-multi-instantiate:
  -  Derive the device name from parent
 
 pmc_atom:
  -  Add Siemens SIMATIC IPC277E to critclk_systems DMI table
 
 tools/power/x86/intel-speed-select:
  -  Fix perf-profile command output
  -  Extend core-power command set
  -  Fix some debug prints
  -  Format get-assoc information
  -  Allow online/offline based on tdp
  -  Fix high priority core mask over count
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl2JyzMACgkQb7wzTHR8
 rChj1A//Uv4uFc5pWwYrvafvzho4uQ4TK0TDEvrDFEqxCcI7n2JGCWvXAuV8Lny4
 oJ7enVjqDDMWkmN4KcONR8BWhZii23TzB+CDr1enCKYQv5J//di9jezVHtANw5oC
 duKq2sPd7wkigpQmDk17sft5U2MPKOK9EgE/qMztNOSTm3XGcGSbD80Cr/o6P1w3
 3TAZy/lED5jqjwvKmkDq/6fB3GdCG/b6LK56jhay5lew9Xi+WK9bTO3rzPo9nlvx
 HKT3FuRhH3Dbx4EY4QO5ee1RVnwPG5swCjFw2ZPvpJoTsAxEMgbC2yaesRElLJvk
 odIZrGDh2LqP8GCvtg6CQACsnRHzrze3H8PK75sCkFLkVMmw5Tp0knDMEakDQ39T
 0lZWsHyN6x75Bmt15GIUCfYvDoBvvBar0UHwNwCQk4KS+IvH4F+CWC5gbCgHwvQZ
 6bw1OSkdpP/wjf99ad2HJ9yFKP19qeSPIMwDEyZUgyLZBJoU12kEOB66Yyrpskve
 djbsZe+hfBH8NFLMlgaBINFS4fISbUsYV+bOxPw2hSdbVdgajoOTPCaJOhfGEQap
 b//gWBrDoX8LyibDW/b2zRhUvp2X944Z+Ve+btC2+XSHNt7/oy8q3Kh33dLIlEic
 eMAyMKn3GhkxvT20AyxRoJf3Fy4W2KKPHu/QZ00VB/aKHz/6vc8=
 =Cd14
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86

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-24 12:39:40 -07:00