thermal: netlink: Add a new event to notify CPU capabilities change
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thu, 27 Jan 2022 19:34:53 +0000 (11:34 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Feb 2022 18:50:49 +0000 (19:50 +0100)
commite4b1eb24ce5a696ef7229f9926ff34d7502f0582
tree81250d972e1b8f51d940c54e5ddbeecd1e286b44
parentab09b0744a9944cbdc0ac9a5cb00bef72adf79d5
thermal: netlink: Add a new event to notify CPU capabilities change

Add a new netlink event to notify change in CPU capabilities in terms of
performance and efficiency.

Firmware may change CPU capabilities as a result of thermal events in the
system or to account for changes in the TDP (thermal design power) level.

This notification type will allow user space to avoid running workloads
on certain CPUs or proactively adjust power limits to avoid future events.

The netlink message consists of a nested attribute
(THERMAL_GENL_ATTR_CPU_CAPABILITY) with three attributes:

 * THERMAL_GENL_ATTR_CPU_CAPABILITY_ID (type u32):
   -- logical CPU number
 * THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE (type u32):
   -- Scaled performance from 0-1023
 * THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY (type u32):
   -- Scaled efficiency from 0-1023

Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_netlink.c
drivers/thermal/thermal_netlink.h
include/uapi/linux/thermal.h