1.. _opal-psr:
2
3======================
4OPAL Power Shift Ratio
5======================
6
7Sometimes power management firmware needs to throttle power availability
8to system components in order to keep within power cap or thermal limits.
9It's possible to set a preference as to what trade-offs power management
10firmware will make. For example, certain workloads may heavily prefer
11throttling CPU over GPUs or vice-versa.
12
13.. _OPAL_GET_POWER_SHIFT_RATIO:
14
15OPAL_GET_POWER_SHIFT_RATIO
16==========================
17OPAL call to read the power-shifting-ratio using a handle to identify
18the type (e.g CPU vs. GPU, CPU vs. MEM) which is exported via
19device-tree.
20
21The call can be asynchronus, where the token parameter is used to wait
22for the completion.
23
24Parameters
25----------
26
27=== =======
28=== =======
29u32 handle
30int token
31u32 \*ratio
32=== =======
33
34Returns
35-------
36
37:ref:`OPAL_SUCCESS`
38  Success
39:ref:`OPAL_PARAMETER`
40  Invalid ratio pointer
41:ref:`OPAL_UNSUPPORTED`
42  No support for reading psr
43:ref:`OPAL_HARDWARE`
44  Unable to procced due to the current hardware state
45:ref:`OPAL_ASYNC_COMPLETION`
46  Request was sent and an async completion message will be sent with
47  token and status of the request.
48
49.. _OPAL_SET_POWER_SHIFT_RATIO:
50
51OPAL_SET_POWER_SHIFT_RATIO
52==========================
53OPAL call to set power-shifting-ratio using a handle to identify
54the type of PSR which is exported in device-tree. This call can be
55asynchronus where the token parameter is used to wait for the
56completion.
57
58Parameters
59----------
60
61=== ======
62=== ======
63u32 handle
64int token
65u32 ratio
66=== ======
67
68Returns
69-------
70
71:ref:`OPAL_SUCCESS`
72  Success
73:ref:`OPAL_PARAMETER`
74  Invalid ratio requested
75:ref:`OPAL_UNSUPPORTED`
76  No support for changing the ratio
77:ref:`OPAL_PERMISSION`
78  Hardware cannot take the request
79:ref:`OPAL_ASYNC_COMPLETION`
80  Request was sent and an async completion message will be sent with
81  token and status of the request.
82:ref:`OPAL_HARDWARE`
83  Unable to procced due to the current hardware state
84:ref:`OPAL_BUSY`
85  Previous request in progress
86:ref:`OPAL_INTERNAL_ERROR`
87  Error in request response
88:ref:`OPAL_TIMEOUT`
89  Timeout in request completion
90