Commit b0b8a482 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Jun Tian
Browse files

thermal: intel: hfi: Notify user space for HFI events

mainline inclusion
from mainline-5.18
commit bd30cdfd
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I5DSOL



Intel_SIG: commit bd30cdfd thermal: intel: hfi: Notify user space for
HFI events.
Backport for Intel HFI (Hardware Feedback Interface) support

-------------------------------------

When the hardware issues an HFI event, relay a notification to user space.
This allows user space to respond by reading performance and efficiency of
each CPU and take appropriate action.

For example, when the performance and efficiency of a CPU is 0, user space
can either offline the CPU or inject idle. Also, if user space notices a
downward trend in performance, it may proactively adjust power limits to
avoid future situations in which performance drops to 0.

To avoid excessive notifications, the rate is limited by one HZ per event.
To limit the netlink message size, send parameters for up to 16 CPUs in a
single message. If there are more than 16 CPUs, issue as many messages as
needed to notify the status of all CPUs.

In the HFI specification, both performance and efficiency capabilities are
defined in the [0, 255] range. The existing implementations of HFI hardware
do not scale the maximum values to 255. Since userspace cares about
capability values that are either 0 or show a downward/upward trend, this
fact does not matter much. Relative changes in capabilities are enough. To
comply with the thermal netlink ABI, scale both performance and efficiency
capabilities to the [0, 1023] interval.

Reviewed-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avataryingbao jia <yingbao.jia@intel.com>
Signed-off-by: default avatarJun Tian <jun.j.tian@intel.com>
parent 07dc6e0b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment