summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2023-08-29 02:23:44 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-09-14 21:52:19 +0200
commit4b029a81c24e6b249022bab37fa0b61bfcb5c242 (patch)
tree3b0b0c2895f7438298d48c26c88f2d9cf7bb8d2a /Documentation
parentthermal: int340x: Remove PROC_THERMAL_FEATURE_WLT_REQ for Meteor Lake (diff)
downloadlinux-4b029a81c24e6b249022bab37fa0b61bfcb5c242.tar.xz
linux-4b029a81c24e6b249022bab37fa0b61bfcb5c242.zip
thermal: int340x: processor_thermal: Add workload type hint interface
Prior to Meteor Lake processor generation, user space can pass workload type request to the firmware. Then firmware can optimize power based on the indicated workload type. User space also uses workload type requests to implement its own heuristics. The firmware in Meteor Lake processor generation is capable of predicting workload type without software help. To avoid duplicate processing, add a sysfs interface allowing user space to obtain the workload hint from the firmware instead of trying to predict the workload type by itself. This workload hint is passed from the firmware via MMIO offset 0x5B18 of the processor thermal PCI device. Before workload hints can be produced by the firmware, it needs to be configured via a mailbox command. This mailbox command turns ON the workload hint and it allows to program a notification delay to control the rate of notifications. The notification delay can be changed from user space vis sysfs. Attribute group 'workload_hint' in sysfs is used for implementing the workload hints interface between user space and the kernel. It contains the following attributes: workload_type_enable: Enables/disables workload type hints from the firmware. notification_delay_ms: Notification delay in milliseconds. workload_type_index: The current workload type index predicted by the firmware (see the documentation changes below for supported index values and their meaning). Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> [ rjw: Changelog edits, documentation edits, whitespace adjustments ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/driver-api/thermal/intel_dptf.rst54
1 files changed, 54 insertions, 0 deletions
diff --git a/Documentation/driver-api/thermal/intel_dptf.rst b/Documentation/driver-api/thermal/intel_dptf.rst
index 9ab4316322a1..2d11e74ac665 100644
--- a/Documentation/driver-api/thermal/intel_dptf.rst
+++ b/Documentation/driver-api/thermal/intel_dptf.rst
@@ -315,3 +315,57 @@ DPTF Fan Control
----------------------------------------
Refer to Documentation/admin-guide/acpi/fan_performance_states.rst
+
+Workload Type Hints
+----------------------------------------
+
+The firmware in Meteor Lake processor generation is capable of identifying
+workload type and passing hints regarding it to the OS. A special sysfs
+interface is provided to allow user space to obtain workload type hints from
+the firmware and control the rate at which they are provided.
+
+User space can poll attribute "workload_type_index" for the current hint or
+can receive a notification whenever the value of this attribute is updated.
+
+file:`/sys/bus/pci/devices/0000:00:04.0/workload_hint/`
+Segment 0, bus 0, device 4, function 0 is reserved for the processor thermal
+device on all Intel client processors. So, the above path doesn't change
+based on the processor generation.
+
+``workload_hint_enable`` (RW)
+ Enable firmware to send workload type hints to user space.
+
+``notification_delay_ms`` (RW)
+ Minimum delay in milliseconds before firmware will notify OS. This is
+ for the rate control of notifications. This delay is between changing
+ the workload type prediction in the firmware and notifying the OS about
+ the change. The default delay is 1024 ms. The delay of 0 is invalid.
+ The delay is rounded up to the nearest power of 2 to simplify firmware
+ programming of the delay value. The read of notification_delay_ms
+ attribute shows the effective value used.
+
+``workload_type_index`` (RO)
+ Predicted workload type index. User space can get notification of
+ change via existing sysfs attribute change notification mechanism.
+
+ The supported index values and their meaning for the Meteor Lake
+ processor generation are as follows:
+
+ 0 - Idle: System performs no tasks, power and idle residency are
+ consistently low for long periods of time.
+
+ 1 – Battery Life: Power is relatively low, but the processor may
+ still be actively performing a task, such as video playback for
+ a long period of time.
+
+ 2 – Sustained: Power level that is relatively high for a long period
+ of time, with very few to no periods of idleness, which will
+ eventually exhaust RAPL Power Limit 1 and 2.
+
+ 3 – Bursty: Consumes a relatively constant average amount of power, but
+ periods of relative idleness are interrupted by bursts of
+ activity. The bursts are relatively short and the periods of
+ relative idleness between them typically prevent RAPL Power
+ Limit 1 from being exhausted.
+
+ 4 – Unknown: Can't classify.