sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget&/translations/zh_CN/power/energy-modelmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/zh_TW/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/it_IT/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ja_JP/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ko_KR/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/pt_BR/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/sp_SP/power/energy-modelmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh@/var/lib/git/docbuild/linux/Documentation/power/energy-model.rsthKubhsection)}(hhh](htitle)}(hEnergy Model of devicesh]hEnergy Model of devices}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h 1. Overviewh]h 1. Overview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThe Energy Model (EM) framework serves as an interface between drivers knowing the power consumed by devices at various performance levels, and the kernel subsystems willing to use that information to make energy-aware decisions.h]hThe Energy Model (EM) framework serves as an interface between drivers knowing the power consumed by devices at various performance levels, and the kernel subsystems willing to use that information to make energy-aware decisions.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hX?The source of the information about the power consumed by devices can vary greatly from one platform to another. These power costs can be estimated using devicetree data in some cases. In others, the firmware will know better. Alternatively, userspace might be best positioned. In order to avoid having each and every client subsystem re-implement support for each and every possible source of information on its own, the EM framework intervenes as an abstraction layer which standardizes the format of power cost tables in the kernel, hence enabling to avoid redundant work.h]hX?The source of the information about the power consumed by devices can vary greatly from one platform to another. These power costs can be estimated using devicetree data in some cases. In others, the firmware will know better. Alternatively, userspace might be best positioned. In order to avoid having each and every client subsystem re-implement support for each and every possible source of information on its own, the EM framework intervenes as an abstraction layer which standardizes the format of power cost tables in the kernel, hence enabling to avoid redundant work.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe power values might be expressed in micro-Watts or in an 'abstract scale'. Multiple subsystems might use the EM and it is up to the system integrator to check that the requirements for the power value scale types are met. An example can be found in the Energy-Aware Scheduler documentation Documentation/scheduler/sched-energy.rst. For some subsystems like thermal or powercap power values expressed in an 'abstract scale' might cause issues. These subsystems are more interested in estimation of power used in the past, thus the real micro-Watts might be needed. An example of these requirements can be found in the Intelligent Power Allocation in Documentation/driver-api/thermal/power_allocator.rst. Kernel subsystems might implement automatic detection to check whether EM registered devices have inconsistent scale (based on EM internal flag). An important thing to keep in mind is that when the power values are expressed in an 'abstract scale' deriving real energy in micro-Joules would not be possible.h]hXThe power values might be expressed in micro-Watts or in an ‘abstract scale’. Multiple subsystems might use the EM and it is up to the system integrator to check that the requirements for the power value scale types are met. An example can be found in the Energy-Aware Scheduler documentation Documentation/scheduler/sched-energy.rst. For some subsystems like thermal or powercap power values expressed in an ‘abstract scale’ might cause issues. These subsystems are more interested in estimation of power used in the past, thus the real micro-Watts might be needed. An example of these requirements can be found in the Intelligent Power Allocation in Documentation/driver-api/thermal/power_allocator.rst. Kernel subsystems might implement automatic detection to check whether EM registered devices have inconsistent scale (based on EM internal flag). An important thing to keep in mind is that when the power values are expressed in an ‘abstract scale’ deriving real energy in micro-Joules would not be possible.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe figure below depicts an example of drivers (Arm-specific here, but the approach is applicable to any architecture) providing power costs to the EM framework, and interested clients reading the data from it::h]hThe figure below depicts an example of drivers (Arm-specific here, but the approach is applicable to any architecture) providing power costs to the EM framework, and interested clients reading the data from it:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubh literal_block)}(hX+---------------+ +-----------------+ +---------------+ | Thermal (IPA) | | Scheduler (EAS) | | Other | +---------------+ +-----------------+ +---------------+ | | em_cpu_energy() | | | em_cpu_get() | +---------+ | +---------+ | | | v v v +---------------------+ | Energy Model | | Framework | +---------------------+ ^ ^ ^ | | | em_dev_register_perf_domain() +----------+ | +---------+ | | | +---------------+ +---------------+ +--------------+ | cpufreq-dt | | arm_scmi | | Other | +---------------+ +---------------+ +--------------+ ^ ^ ^ | | | +--------------+ +---------------+ +--------------+ | Device Tree | | Firmware | | ? | +--------------+ +---------------+ +--------------+h]hX+---------------+ +-----------------+ +---------------+ | Thermal (IPA) | | Scheduler (EAS) | | Other | +---------------+ +-----------------+ +---------------+ | | em_cpu_energy() | | | em_cpu_get() | +---------+ | +---------+ | | | v v v +---------------------+ | Energy Model | | Framework | +---------------------+ ^ ^ ^ | | | em_dev_register_perf_domain() +----------+ | +---------+ | | | +---------------+ +---------------+ +--------------+ | cpufreq-dt | | arm_scmi | | Other | +---------------+ +---------------+ +--------------+ ^ ^ ^ | | | +--------------+ +---------------+ +--------------+ | Device Tree | | Firmware | | ? | +--------------+ +---------------+ +--------------+}hj*sbah}(h]h ]h"]h$]h&]hhuh1j(hhhK*hhhhubh)}(hXIn case of CPU devices the EM framework manages power cost tables per 'performance domain' in the system. A performance domain is a group of CPUs whose performance is scaled together. Performance domains generally have a 1-to-1 mapping with CPUFreq policies. All CPUs in a performance domain are required to have the same micro-architecture. CPUs in different performance domains can have different micro-architectures.h]hXIn case of CPU devices the EM framework manages power cost tables per ‘performance domain’ in the system. A performance domain is a group of CPUs whose performance is scaled together. Performance domains generally have a 1-to-1 mapping with CPUFreq policies. All CPUs in a performance domain are required to have the same micro-architecture. CPUs in different performance domains can have different micro-architectures.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChhhhubh)}(hXTo better reflect power variation due to static power (leakage) the EM supports runtime modifications of the power values. The mechanism relies on RCU to free the modifiable EM perf_state table memory. Its user, the task scheduler, also uses RCU to access this memory. The EM framework provides API for allocating/freeing the new memory for the modifiable EM table. The old memory is freed automatically using RCU callback mechanism when there are no owners anymore for the given EM runtime table instance. This is tracked using kref mechanism. The device driver which provided the new EM at runtime, should call EM API to free it safely when it's no longer needed. The EM framework will handle the clean-up when it's possible.h]hXTo better reflect power variation due to static power (leakage) the EM supports runtime modifications of the power values. The mechanism relies on RCU to free the modifiable EM perf_state table memory. Its user, the task scheduler, also uses RCU to access this memory. The EM framework provides API for allocating/freeing the new memory for the modifiable EM table. The old memory is freed automatically using RCU callback mechanism when there are no owners anymore for the given EM runtime table instance. This is tracked using kref mechanism. The device driver which provided the new EM at runtime, should call EM API to free it safely when it’s no longer needed. The EM framework will handle the clean-up when it’s possible.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhhhhubh)}(hThe kernel code which wants to modify the EM values is protected from concurrent access using a mutex. Therefore, the device driver code must run in sleeping context when it tries to modify the EM.h]hThe kernel code which wants to modify the EM values is protected from concurrent access using a mutex. Therefore, the device driver code must run in sleeping context when it tries to modify the EM.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhhhhubh)}(hWith the runtime modifiable EM we switch from a 'single and during the entire runtime static EM' (system property) design to a 'single EM which can be changed during runtime according e.g. to the workload' (system and workload property) design.h]hWith the runtime modifiable EM we switch from a ‘single and during the entire runtime static EM’ (system property) design to a ‘single EM which can be changed during runtime according e.g. to the workload’ (system and workload property) design.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhhhhubh)}(hIt is possible also to modify the CPU performance values for each EM's performance state. Thus, the full power and performance profile (which is an exponential curve) can be changed according e.g. to the workload or system property.h]hIt is possible also to modify the CPU performance values for each EM’s performance state. Thus, the full power and performance profile (which is an exponential curve) can be changed according e.g. to the workload or system property.}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hhhhubeh}(h]overviewah ]h"] 1. overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h 2. Core APIsh]h 2. Core APIs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKeubh)}(hhh](h)}(h2.1 Config optionsh]h2.1 Config options}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhubh)}(h tuples for each performance state. The callback function provided by the driver is free to fetch data from any relevant location (DT, firmware, ...), and by any mean deemed necessary. Only for CPU devices, drivers must specify the CPUs of the performance domains using cpumask. For other devices than CPUs the last argument must be set to NULL. The last argument 'microwatts' is important to set with correct value. Kernel subsystems which use EM might rely on this flag to check if all EM devices use the same scale. If there are different scales, these subsystems might decide to return warning/error, stop working or panic. See Section 3. for an example of driver implementing this callback, or Section 2.4 for further documentation on this APIh]hX5Drivers must provide a callback function returning tuples for each performance state. The callback function provided by the driver is free to fetch data from any relevant location (DT, firmware, ...), and by any mean deemed necessary. Only for CPU devices, drivers must specify the CPUs of the performance domains using cpumask. For other devices than CPUs the last argument must be set to NULL. The last argument ‘microwatts’ is important to set with correct value. Kernel subsystems which use EM might rely on this flag to check if all EM devices use the same scale. If there are different scales, these subsystems might decide to return warning/error, stop working or panic. See Section 3. for an example of driver implementing this callback, or Section 2.4 for further documentation on this API}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]registration-of-advanced-emah ]h"]registration of 'advanced' emah$]h&]uh1hhjhhhhhKqubh)}(hhh](h)}(hRegistration of EM using DTh]hRegistration of EM using DT}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXThe EM can also be registered using OPP framework and information in DT "operating-points-v2". Each OPP entry in DT can be extended with a property "opp-microwatt" containing micro-Watts power value. This OPP DT property allows a platform to register EM power values which are reflecting total power (static + dynamic). These power values might be coming directly from experiments and measurements.h]hXThe EM can also be registered using OPP framework and information in DT “operating-points-v2”. Each OPP entry in DT can be extended with a property “opp-microwatt” containing micro-Watts power value. This OPP DT property allows a platform to register EM power values which are reflecting total power (static + dynamic). These power values might be coming directly from experiments and measurements.}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]registration-of-em-using-dtah ]h"]registration of em using dtah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hRegistration of 'artificial' EMh]h#Registration of ‘artificial’ EM}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGhhhhhKubh)}(hXrThere is an option to provide a custom callback for drivers missing detailed knowledge about power value for each performance state. The callback .get_cost() is optional and provides the 'cost' values used by the EAS. This is useful for platforms that only provide information on relative efficiency between CPU types, where one could use the information to create an abstract power model. But even an abstract power model can sometimes be hard to fit in, given the input power value size restrictions. The .get_cost() allows to provide the 'cost' values which reflect the efficiency of the CPUs. This would allow to provide EAS information which has different relation than what would be forced by the EM internal formulas calculating 'cost' values. To register an EM for such platform, the driver must set the flag 'microwatts' to 0, provide .get_power() callback and provide .get_cost() callback. The EM framework would handle such platform properly during registration. A flag EM_PERF_DOMAIN_ARTIFICIAL is set for such platform. Special care should be taken by other frameworks which are using EM to test and treat this flag properly.h]hXThere is an option to provide a custom callback for drivers missing detailed knowledge about power value for each performance state. The callback .get_cost() is optional and provides the ‘cost’ values used by the EAS. This is useful for platforms that only provide information on relative efficiency between CPU types, where one could use the information to create an abstract power model. But even an abstract power model can sometimes be hard to fit in, given the input power value size restrictions. The .get_cost() allows to provide the ‘cost’ values which reflect the efficiency of the CPUs. This would allow to provide EAS information which has different relation than what would be forced by the EM internal formulas calculating ‘cost’ values. To register an EM for such platform, the driver must set the flag ‘microwatts’ to 0, provide .get_power() callback and provide .get_cost() callback. The EM framework would handle such platform properly during registration. A flag EM_PERF_DOMAIN_ARTIFICIAL is set for such platform. Special care should be taken by other frameworks which are using EM to test and treat this flag properly.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjGhhubeh}(h]registration-of-artificial-emah ]h"]registration of 'artificial' emah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hRegistration of 'simple' EMh]hRegistration of ‘simple’ EM}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjnhhhhhKubh)}(hThe 'simple' EM is registered using the framework helper function cpufreq_register_em_with_opp(). It implements a power model which is tied to a math formula::h]hThe ‘simple’ EM is registered using the framework helper function cpufreq_register_em_with_opp(). It implements a power model which is tied to a math formula:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjnhhubj))}(hPower = C * V^2 * fh]hPower = C * V^2 * f}hjsbah}(h]h ]h"]h$]h&]hhuh1j(hhhKhjnhhubh)}(hThe EM which is registered using this method might not reflect correctly the physics of a real device, e.g. when static power (leakage) is important.h]hThe EM which is registered using this method might not reflect correctly the physics of a real device, e.g. when static power (leakage) is important.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjnhhubeh}(h]registration-of-simple-emah ]h"]registration of 'simple' emah$]h&]uh1hhjhhhhhKubeh}(h]#registration-of-performance-domainsah ]h"]'2.2 registration of performance domainsah$]h&]uh1hhjhhhhhKnubh)}(hhh](h)}(h!2.3 Accessing performance domainsh]h!2.3 Accessing performance domains}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX:There are two API functions which provide the access to the energy model: em_cpu_get() which takes CPU id as an argument and em_pd_get() with device pointer as an argument. It depends on the subsystem which interface it is going to use, but in case of CPU devices both functions return the same performance domain.h]hX:There are two API functions which provide the access to the energy model: em_cpu_get() which takes CPU id as an argument and em_pd_get() with device pointer as an argument. It depends on the subsystem which interface it is going to use, but in case of CPU devices both functions return the same performance domain.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hSubsystems interested in the energy model of a CPU can retrieve it using the em_cpu_get() API. The energy model tables are allocated once upon creation of the performance domains, and kept in memory untouched.h]hSubsystems interested in the energy model of a CPU can retrieve it using the em_cpu_get() API. The energy model tables are allocated once upon creation of the performance domains, and kept in memory untouched.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX The energy consumed by a performance domain can be estimated using the em_cpu_energy() API. The estimation is performed assuming that the schedutil CPUfreq governor is in use in case of CPU device. Currently this calculation is not provided for other type of devices.h]hX The energy consumed by a performance domain can be estimated using the em_cpu_energy() API. The estimation is performed assuming that the schedutil CPUfreq governor is in use in case of CPU device. Currently this calculation is not provided for other type of devices.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h^More details about the above APIs can be found in ```` or in Section 2.5h](h2More details about the above APIs can be found in }(hjhhhNhNubhliteral)}(h````h]h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or in Section 2.5}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]accessing-performance-domainsah ]h"]!2.3 accessing performance domainsah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h2.4 Runtime modificationsh]h2.4 Runtime modifications}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hDrivers willing to update the EM at runtime should use the following dedicated function to allocate a new instance of the modified EM. The API is listed below::h]hDrivers willing to update the EM at runtime should use the following dedicated function to allocate a new instance of the modified EM. The API is listed below:}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj))}(hFstruct em_perf_table __rcu *em_table_alloc(struct em_perf_domain *pd);h]hFstruct em_perf_table __rcu *em_table_alloc(struct em_perf_domain *pd);}hj=sbah}(h]h ]h"]h$]h&]hhuh1j(hhhKhjhhubh)}(hXThis allows to allocate a structure which contains the new EM table with also RCU and kref needed by the EM framework. The 'struct em_perf_table' contains array 'struct em_perf_state state[]' which is a list of performance states in ascending order. That list must be populated by the device driver which wants to update the EM. The list of frequencies can be taken from existing EM (created during boot). The content in the 'struct em_perf_state' must be populated by the driver as well.h]hXThis allows to allocate a structure which contains the new EM table with also RCU and kref needed by the EM framework. The ‘struct em_perf_table’ contains array ‘struct em_perf_state state[]’ which is a list of performance states in ascending order. That list must be populated by the device driver which wants to update the EM. The list of frequencies can be taken from existing EM (created during boot). The content in the ‘struct em_perf_state’ must be populated by the driver as well.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hCThis is the API which does the EM update, using RCU pointers swap::h]hBThis is the API which does the EM update, using RCU pointers swap:}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj))}(hoint em_dev_update_perf_domain(struct device *dev, struct em_perf_table __rcu *new_table);h]hoint em_dev_update_perf_domain(struct device *dev, struct em_perf_table __rcu *new_table);}hjgsbah}(h]h ]h"]h$]h&]hhuh1j(hhhKhjhhubh)}(hXDrivers must provide a pointer to the allocated and initialized new EM 'struct em_perf_table'. That new EM will be safely used inside the EM framework and will be visible to other sub-systems in the kernel (thermal, powercap). The main design goal for this API is to be fast and avoid extra calculations or memory allocations at runtime. When pre-computed EMs are available in the device driver, then it should be possible to simply reuse them with low performance overhead.h]hXDrivers must provide a pointer to the allocated and initialized new EM ‘struct em_perf_table’. That new EM will be safely used inside the EM framework and will be visible to other sub-systems in the kernel (thermal, powercap). The main design goal for this API is to be fast and avoid extra calculations or memory allocations at runtime. When pre-computed EMs are available in the device driver, then it should be possible to simply reuse them with low performance overhead.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h}In order to free the EM, provided earlier by the driver (e.g. when the module is unloaded), there is a need to call the API::h]h|In order to free the EM, provided earlier by the driver (e.g. when the module is unloaded), there is a need to call the API:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj))}(h6void em_table_free(struct em_perf_table __rcu *table);h]h6void em_table_free(struct em_perf_table __rcu *table);}hjsbah}(h]h ]h"]h$]h&]hhuh1j(hhhKhjhhubh)}(hqIt will allow the EM framework to safely remove the memory, when there is no other sub-system using it, e.g. EAS.h]hqIt will allow the EM framework to safely remove the memory, when there is no other sub-system using it, e.g. EAS.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hTo use the power values in other sub-systems (like thermal, powercap) there is a need to call API which protects the reader and provide consistency of the EM table data::h]hTo use the power values in other sub-systems (like thermal, powercap) there is a need to call API which protects the reader and provide consistency of the EM table data:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj))}(hGstruct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd);h]hGstruct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd);}hjsbah}(h]h ]h"]h$]h&]hhuh1j(hhhKhjhhubh)}(hXIt returns the 'struct em_perf_state' pointer which is an array of performance states in ascending order. This function must be called in the RCU read lock section (after the rcu_read_lock()). When the EM table is not needed anymore there is a need to call rcu_read_unlock(). In this way the EM safely uses the RCU read section and protects the users. It also allows the EM framework to manage the memory and free it. More details how to use it can be found in Section 3.2 in the example driver.h]hXIt returns the ‘struct em_perf_state’ pointer which is an array of performance states in ascending order. This function must be called in the RCU read lock section (after the rcu_read_lock()). When the EM table is not needed anymore there is a need to call rcu_read_unlock(). In this way the EM safely uses the RCU read section and protects the users. It also allows the EM framework to manage the memory and free it. More details how to use it can be found in Section 3.2 in the example driver.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hSThere is dedicated API for device drivers to calculate em_perf_state::cost values::h]hRThere is dedicated API for device drivers to calculate em_perf_state::cost values:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj))}(hrint em_dev_compute_costs(struct device *dev, struct em_perf_state *table, int nr_states);h]hrint em_dev_compute_costs(struct device *dev, struct em_perf_state *table, int nr_states);}hjsbah}(h]h ]h"]h$]h&]hhuh1j(hhhMhjhhubh)}(hXThese 'cost' values from EM are used in EAS. The new EM table should be passed together with the number of entries and device pointer. When the computation of the cost values is done properly the return value from the function is 0. The function takes care for right setting of inefficiency for each performance state as well. It updates em_perf_state::flags accordingly. Then such prepared new EM can be passed to the em_dev_update_perf_domain() function, which will allow to use it.h]hXThese ‘cost’ values from EM are used in EAS. The new EM table should be passed together with the number of entries and device pointer. When the computation of the cost values is done properly the return value from the function is 0. The function takes care for right setting of inefficiency for each performance state as well. It updates em_perf_state::flags accordingly. Then such prepared new EM can be passed to the em_dev_update_perf_domain() function, which will allow to use it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubh)}(hMore details about the above APIs can be found in ```` or in Section 3.2 with an example code showing simple implementation of the updating mechanism in a device driver.h](h2More details about the above APIs can be found in }(hjhhhNhNubj)}(h````h]h}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhs or in Section 3.2 with an example code showing simple implementation of the updating mechanism in a device driver.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]runtime-modificationsah ]h"]2.4 runtime modificationsah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h#2.5 Description details of this APIh]h#2.5 Description details of this API}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)hhhhhMubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleem_perf_state (C struct)c.em_perf_statehNtauh1j:hj)hhhNhNubhdesc)}(hhh](hdesc_signature)}(h em_perf_stateh]hdesc_signature_line)}(hstruct em_perf_stateh](hdesc_sig_keyword)}(hstructh]hstruct}(hj^hhhNhNubah}(h]h ]kah"]h$]h&]uh1j\hjXhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubhdesc_sig_space)}(h h]h }(hjphhhNhNubah}(h]h ]wah"]h$]h&]uh1jnhjXhhhjmhKubh desc_name)}(h em_perf_stateh]h desc_sig_name)}(hjTh]h em_perf_state}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jhjXhhhjmhKubeh}(h]h ]h"]h$]h&]hhƌ add_permalinkuh1jVsphinx_line_type declaratorhjRhhhjmhKubah}(h]jIah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jPhjmhKhjMhhubh desc_content)}(hhh]h)}(h)Performance state of a performance domainh]h)Performance state of a performance domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhjMhhhjmhKubeh}(h]h ](cstructeh"]h$]h&]domainjobjtypejdesctypejnoindex noindexentrynocontentsentryuh1jKhhhj)hNhNubh container)}(hX**Definition**:: struct em_perf_state { unsigned long performance; unsigned long frequency; unsigned long power; unsigned long cost; unsigned long flags; }; **Members** ``performance`` CPU performance (capacity) at a given frequency ``frequency`` The frequency in KHz, for consistency with CPUFreq ``power`` The power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic. ``cost`` The cost coefficient associated with this level, used during energy calculation. Equal to: 10 * power * max_frequency / frequency ``flags`` see "em_perf_state flags" description below.h](h)}(h**Definition**::h](hstrong)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj))}(hstruct em_perf_state { unsigned long performance; unsigned long frequency; unsigned long power; unsigned long cost; unsigned long flags; };h]hstruct em_perf_state { unsigned long performance; unsigned long frequency; unsigned long power; unsigned long cost; unsigned long flags; };}hjsbah}(h]h ]h"]h$]h&]hhuh1j(h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubh)}(h **Members**h]j)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubhdefinition_list)}(hhh](hdefinition_list_item)}(h@``performance`` CPU performance (capacity) at a given frequency h](hterm)}(h``performance``h]j)}(hj4h]h performance}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj,ubh definition)}(hhh]h)}(h/CPU performance (capacity) at a given frequencyh]h/CPU performance (capacity) at a given frequency}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhKhjLubah}(h]h ]h"]h$]h&]uh1jJhj,ubeh}(h]h ]h"]h$]h&]uh1j*hjIhKhj'ubj+)}(hA``frequency`` The frequency in KHz, for consistency with CPUFreq h](j1)}(h ``frequency``h]j)}(hjoh]h frequency}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjiubjK)}(hhh]h)}(h2The frequency in KHz, for consistency with CPUFreqh]h2The frequency in KHz, for consistency with CPUFreq}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jJhjiubeh}(h]h ]h"]h$]h&]uh1j*hjhKhj'ubj+)}(h~``power`` The power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic. h](j1)}(h ``power``h]j)}(hjh]hpower}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubjK)}(hhh]h)}(hsThe power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic.h]hsThe power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhKhj'ubj+)}(h``cost`` The cost coefficient associated with this level, used during energy calculation. Equal to: 10 * power * max_frequency / frequency h](j1)}(h``cost``h]j)}(hjh]hcost}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubjK)}(hhh]h)}(hThe cost coefficient associated with this level, used during energy calculation. Equal to: 10 * power * max_frequency / frequencyh]hThe cost coefficient associated with this level, used during energy calculation. Equal to: 10 * power * max_frequency / frequency}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhKhj'ubj+)}(h6``flags`` see "em_perf_state flags" description below.h](j1)}(h ``flags``h]j)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubjK)}(hhh]h)}(h,see "em_perf_state flags" description below.h]h0see “em_perf_state flags” description below.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj2ubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hj1hKhj'ubeh}(h]h ]h"]h$]h&]uh1j%hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jGem_perf_table (C struct)c.em_perf_tablehNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(h em_perf_tableh]jW)}(hstruct em_perf_tableh](j])}(hj`h]hstruct}(hjvhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjrhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjrhhhjhKubj)}(h em_perf_tableh]j)}(hjph]h em_perf_table}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjrhhhjhKubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjnhhhjhKubah}(h]jiah ](jjeh"]h$]h&]jj)jhuh1jPhjhKhjkhhubj)}(hhh]h)}(hPerformance states tableh]hPerformance states table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK+hjhhubah}(h]h ]h"]h$]h&]uh1jhjkhhhjhKubeh}(h]h ](jstructeh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(hX4**Definition**:: struct em_perf_table { struct rcu_head rcu; struct kref kref; struct em_perf_state state[]; }; **Members** ``rcu`` RCU used for safe access and destruction ``kref`` Reference counter to track the users ``state`` List of performance states, in ascending orderh](h)}(h**Definition**::h](j)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK/hjubj))}(hjstruct em_perf_table { struct rcu_head rcu; struct kref kref; struct em_perf_state state[]; };h]hjstruct em_perf_table { struct rcu_head rcu; struct kref kref; struct em_perf_state state[]; };}hjsbah}(h]h ]h"]h$]h&]hhuh1j(h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK1hjubh)}(h **Members**h]j)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK7hjubj&)}(hhh](j+)}(h1``rcu`` RCU used for safe access and destruction h](j1)}(h``rcu``h]j)}(hj%h]hrcu}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK-hjubjK)}(hhh]h)}(h(RCU used for safe access and destructionh]h(RCU used for safe access and destruction}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:hK-hj;ubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hj:hK-hjubj+)}(h.``kref`` Reference counter to track the users h](j1)}(h``kref``h]j)}(hj^h]hkref}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj\ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK.hjXubjK)}(hhh]h)}(h$Reference counter to track the usersh]h$Reference counter to track the users}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjshK.hjtubah}(h]h ]h"]h$]h&]uh1jJhjXubeh}(h]h ]h"]h$]h&]uh1j*hjshK.hjubj+)}(h8``state`` List of performance states, in ascending orderh](j1)}(h ``state``h]j)}(hjh]hstate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK.hjubjK)}(hhh]h)}(h.List of performance states, in ascending orderh]h.List of performance states, in ascending order}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK/hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhK.hjubeh}(h]h ]h"]h$]h&]uh1j%hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jGem_perf_domain (C struct)c.em_perf_domainhNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hem_perf_domainh]jW)}(hstruct em_perf_domainh](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK5ubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhK5ubj)}(hem_perf_domainh]j)}(hjh]hem_perf_domain}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhK5ubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjhhhjhK5ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jPhjhK5hjhhubj)}(hhh]h)}(hPerformance domainh]hPerformance domain}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK7hj0hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhK5ubeh}(h]h ](jstructeh"]h$]h&]jjjjKjjKjjjuh1jKhhhj)hNhNubj)}(hXu**Definition**:: struct em_perf_domain { struct em_perf_table *em_table; struct list_head node; int id; int nr_perf_states; int min_perf_state; int max_perf_state; unsigned long flags; unsigned long cpus[]; }; **Members** ``em_table`` Pointer to the runtime modifiable em_perf_table ``node`` node in em_pd_list (in energy_model.c) ``id`` A unique ID number for each performance domain ``nr_perf_states`` Number of performance states ``min_perf_state`` Minimum allowed Performance State index ``max_perf_state`` Maximum allowed Performance State index ``flags`` See "em_perf_domain flags" ``cpus`` Cpumask covering the CPUs of the domain. It's here for performance reasons to avoid potential cache misses during energy calculations in the scheduler and simplifies allocating/freeing that memory region.h](h)}(h**Definition**::h](j)}(h**Definition**h]h Definition}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSubh:}(hjShhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK;hjOubj))}(hstruct em_perf_domain { struct em_perf_table *em_table; struct list_head node; int id; int nr_perf_states; int min_perf_state; int max_perf_state; unsigned long flags; unsigned long cpus[]; };h]hstruct em_perf_domain { struct em_perf_table *em_table; struct list_head node; int id; int nr_perf_states; int min_perf_state; int max_perf_state; unsigned long flags; unsigned long cpus[]; };}hjpsbah}(h]h ]h"]h$]h&]hhuh1j(h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK=hjOubh)}(h **Members**h]j)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKHhjOubj&)}(hhh](j+)}(h=``em_table`` Pointer to the runtime modifiable em_perf_table h](j1)}(h ``em_table``h]j)}(hjh]hem_table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK9hjubjK)}(hhh]h)}(h/Pointer to the runtime modifiable em_perf_tableh]h/Pointer to the runtime modifiable em_perf_table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK9hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhK9hjubj+)}(h0``node`` node in em_pd_list (in energy_model.c) h](j1)}(h``node``h]j)}(hjh]hnode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK:hjubjK)}(hhh]h)}(h&node in em_pd_list (in energy_model.c)h]h&node in em_pd_list (in energy_model.c)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK:hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhK:hjubj+)}(h6``id`` A unique ID number for each performance domain h](j1)}(h``id``h]j)}(hj h]hid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK;hj ubjK)}(hhh]h)}(h.A unique ID number for each performance domainh]h.A unique ID number for each performance domain}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj' hK;hj( ubah}(h]h ]h"]h$]h&]uh1jJhj ubeh}(h]h ]h"]h$]h&]uh1j*hj' hK;hjubj+)}(h0``nr_perf_states`` Number of performance states h](j1)}(h``nr_perf_states``h]j)}(hjK h]hnr_perf_states}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjI ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubjK)}(hhh]h)}(h'Maximum allowed Performance State indexh]h'Maximum allowed Performance State index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK>hj ubah}(h]h ]h"]h$]h&]uh1jJhj ubeh}(h]h ]h"]h$]h&]uh1j*hj hK>hjubj+)}(h%``flags`` See "em_perf_domain flags" h](j1)}(h ``flags``h]j)}(hj h]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK?hj ubjK)}(hhh]h)}(hSee "em_perf_domain flags"h]hSee “em_perf_domain flags”}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK?hj ubah}(h]h ]h"]h$]h&]uh1jJhj ubeh}(h]h ]h"]h$]h&]uh1j*hj hK?hjubj+)}(h``cpus`` Cpumask covering the CPUs of the domain. It's here for performance reasons to avoid potential cache misses during energy calculations in the scheduler and simplifies allocating/freeing that memory region.h](j1)}(h``cpus``h]j)}(hj/ h]hcpus}(hj1 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj- ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKBhj) ubjK)}(hhh]h)}(hCpumask covering the CPUs of the domain. It's here for performance reasons to avoid potential cache misses during energy calculations in the scheduler and simplifies allocating/freeing that memory region.h]hCpumask covering the CPUs of the domain. It’s here for performance reasons to avoid potential cache misses during energy calculations in the scheduler and simplifies allocating/freeing that memory region.}(hjH hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK@hjE ubah}(h]h ]h"]h$]h&]uh1jJhj) ubeh}(h]h ]h"]h$]h&]uh1j*hjD hKBhjubeh}(h]h ]h"]h$]h&]uh1j%hjOubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubh)}(h**Description**h]j)}(hjr h]h Description}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjp ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKFhj)hhubh)}(hX4In case of CPU device, a "performance domain" represents a group of CPUs whose performance is scaled together. All CPUs of a performance domain must have the same micro-architecture. Performance domains often have a 1-to-1 mapping with CPUFreq policies. In case of other devices the **cpus** field is unused.h](hXIn case of CPU device, a “performance domain” represents a group of CPUs whose performance is scaled together. All CPUs of a performance domain must have the same micro-architecture. Performance domains often have a 1-to-1 mapping with CPUFreq policies. In case of other devices the }(hj hhhNhNubj)}(h**cpus**h]hcpus}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh field is unused.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKChj)hhubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG&em_pd_get_efficient_state (C function)c.em_pd_get_efficient_statehNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hnint em_pd_get_efficient_state (struct em_perf_state *table, struct em_perf_domain *pd, unsigned long max_util)h]jW)}(hmint em_pd_get_efficient_state(struct em_perf_state *table, struct em_perf_domain *pd, unsigned long max_util)h](hdesc_sig_keyword_type)}(hinth]hint}(hj hhhNhNubah}(h]h ]ktah"]h$]h&]uh1j hj hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj hhhj hKubj)}(hem_pd_get_efficient_stateh]j)}(hem_pd_get_efficient_stateh]hem_pd_get_efficient_state}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhj hKubhdesc_parameterlist)}(hP(struct em_perf_state *table, struct em_perf_domain *pd, unsigned long max_util)h](hdesc_parameter)}(hstruct em_perf_state *tableh](j])}(hj`h]hstruct}(hj hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj ubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubh)}(hhh]j)}(h em_perf_stateh]h em_perf_state}(hj$ hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj! ubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetj& modnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j? ASTIdentifier)}j: j sbc.em_pd_get_efficient_stateasbuh1hhj ubjo)}(h h]h }(hjL hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubhdesc_sig_punctuation)}(h*h]h*}(hj\ hhhNhNubah}(h]h ]pah"]h$]h&]uh1jZ hj ubj)}(htableh]htable}(hjk hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj ubj )}(hstruct em_perf_domain *pdh](j])}(hj`h]hstruct}(hj hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj ubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj modnameN classnameNj> jA )}jD ]jH c.em_pd_get_efficient_stateasbuh1hhj ubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubj[ )}(hj^ h]h*}(hj hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hj ubj)}(hpdh]hpd}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj ubj )}(hunsigned long max_utilh](j )}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubj )}(hlongh]hlong}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubj)}(hmax_utilh]hmax_util}(hj, hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj ubeh}(h]h ]h"]h$]h&]hhuh1j hj hhhj hKubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj hhhj hKubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jPhj hKhj hhubj)}(hhh]h)}(h.Get an efficient performance state from the EMh]h.Get an efficient performance state from the EM}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjS hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hKubeh}(h]h ](jfunctioneh"]h$]h&]jjjjn jjn jjjuh1jKhhhj)hNhNubj)}(hX**Parameters** ``struct em_perf_state *table`` List of performance states, in ascending order ``struct em_perf_domain *pd`` performance domain for which this must be done ``unsigned long max_util`` Max utilization to map with the EM **Description** It is called from the scheduler code quite frequently and as a consequence doesn't implement any check. **Return** An efficient performance state id, high enough to meet **max_util** requirement.h](h)}(h**Parameters**h]j)}(hjx h]h Parameters}(hjz hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjv ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjr ubj&)}(hhh](j+)}(hO``struct em_perf_state *table`` List of performance states, in ascending order h](j1)}(h``struct em_perf_state *table``h]j)}(hj h]hstruct em_perf_state *table}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubjK)}(hhh]h)}(h.List of performance states, in ascending orderh]h.List of performance states, in ascending order}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jJhj ubeh}(h]h ]h"]h$]h&]uh1j*hj hKhj ubj+)}(hM``struct em_perf_domain *pd`` performance domain for which this must be done h](j1)}(h``struct em_perf_domain *pd``h]j)}(hj h]hstruct em_perf_domain *pd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubjK)}(hhh]h)}(h.performance domain for which this must be doneh]h.performance domain for which this must be done}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jJhj ubeh}(h]h ]h"]h$]h&]uh1j*hj hKhj ubj+)}(h>``unsigned long max_util`` Max utilization to map with the EM h](j1)}(h``unsigned long max_util``h]j)}(hj h]hunsigned long max_util}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubjK)}(hhh]h)}(h"Max utilization to map with the EMh]h"Max utilization to map with the EM}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jJhj ubeh}(h]h ]h"]h$]h&]uh1j*hj hKhj ubeh}(h]h ]h"]h$]h&]uh1j%hjr ubh)}(h**Description**h]j)}(hjD h]h Description}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjB ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjr ubh)}(hgIt is called from the scheduler code quite frequently and as a consequence doesn't implement any check.h]hiIt is called from the scheduler code quite frequently and as a consequence doesn’t implement any check.}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjr ubh)}(h **Return**h]j)}(hjk h]hReturn}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1jhji ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjr ubh)}(hPAn efficient performance state id, high enough to meet **max_util** requirement.h](h7An efficient performance state id, high enough to meet }(hj hhhNhNubj)}(h **max_util**h]hmax_util}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh requirement.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjr ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jGem_cpu_energy (C function)c.em_cpu_energyhNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hunsigned long em_cpu_energy (struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap)h]jW)}(hunsigned long em_cpu_energy(struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap)h](j )}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj hhhj hKubj )}(hlongh]hlong}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj hhhj hKubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj hhhj hKubj)}(h em_cpu_energyh]j)}(h em_cpu_energyh]h em_cpu_energy}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj hhhj hKubj )}(hj(struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap)h](j )}(hstruct em_perf_domain *pdh](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hj(hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj;modnameN classnameNj> jA )}jD ]jG )}j: jsbc.em_cpu_energyasbuh1hhjubjo)}(h h]h }(hjYhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj[ )}(hj^ h]h*}(hjghhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjubj)}(hpdh]hpd}(hjthhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hunsigned long max_utilh](j )}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj )}(hlongh]hlong}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj)}(hmax_utilh]hmax_util}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hunsigned long sum_utilh](j )}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj )}(hlongh]hlong}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj)}(hsum_utilh]hsum_util}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hunsigned long allowed_cpu_caph](j )}(hunsignedh]hunsigned}(hj/hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj+ubjo)}(h h]h }(hj=hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj+ubj )}(hlongh]hlong}(hjKhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj+ubjo)}(h h]h }(hjYhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj+ubj)}(hallowed_cpu_caph]hallowed_cpu_cap}(hjghhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubeh}(h]h ]h"]h$]h&]hhuh1j hj hhhj hKubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj hhhj hKubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jPhj hKhj hhubj)}(hhh]h)}(hAEstimates the energy consumed by the CPUs of a performance domainh]hAEstimates the energy consumed by the CPUs of a performance domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hKubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(hX**Parameters** ``struct em_perf_domain *pd`` performance domain for which energy has to be estimated ``unsigned long max_util`` highest utilization among CPUs of the domain ``unsigned long sum_util`` sum of the utilization of all CPUs in the domain ``unsigned long allowed_cpu_cap`` maximum allowed CPU capacity for the **pd**, which might reflect reduced frequency (due to thermal) **Description** This function must be used only for CPU devices. There is no validation, i.e. if the EM is a CPU type and has cpumask allocated. It is called from the scheduler code quite frequently and that is why there is not checks. **Return** the sum of the energy consumed by the CPUs of the domain assuming a capacity state satisfying the max utilization of the domain.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj&)}(hhh](j+)}(hV``struct em_perf_domain *pd`` performance domain for which energy has to be estimated h](j1)}(h``struct em_perf_domain *pd``h]j)}(hjh]hstruct em_perf_domain *pd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubjK)}(hhh]h)}(h7performance domain for which energy has to be estimatedh]h7performance domain for which energy has to be estimated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhKhjubj+)}(hH``unsigned long max_util`` highest utilization among CPUs of the domain h](j1)}(h``unsigned long max_util``h]j)}(hj h]hunsigned long max_util}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubjK)}(hhh]h)}(h,highest utilization among CPUs of the domainh]h,highest utilization among CPUs of the domain}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj!ubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hj hKhjubj+)}(hL``unsigned long sum_util`` sum of the utilization of all CPUs in the domain h](j1)}(h``unsigned long sum_util``h]j)}(hjDh]hunsigned long sum_util}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj>ubjK)}(hhh]h)}(h0sum of the utilization of all CPUs in the domainh]h0sum of the utilization of all CPUs in the domain}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjYhKhjZubah}(h]h ]h"]h$]h&]uh1jJhj>ubeh}(h]h ]h"]h$]h&]uh1j*hjYhKhjubj+)}(h``unsigned long allowed_cpu_cap`` maximum allowed CPU capacity for the **pd**, which might reflect reduced frequency (due to thermal) h](j1)}(h!``unsigned long allowed_cpu_cap``h]j)}(hj}h]hunsigned long allowed_cpu_cap}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj{ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjwubjK)}(hhh]h)}(hcmaximum allowed CPU capacity for the **pd**, which might reflect reduced frequency (due to thermal)h](h%maximum allowed CPU capacity for the }(hjhhhNhNubj)}(h**pd**h]hpd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh8, which might reflect reduced frequency (due to thermal)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubah}(h]h ]h"]h$]h&]uh1jJhjwubeh}(h]h ]h"]h$]h&]uh1j*hjhKhjubeh}(h]h ]h"]h$]h&]uh1j%hjubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubh)}(hThis function must be used only for CPU devices. There is no validation, i.e. if the EM is a CPU type and has cpumask allocated. It is called from the scheduler code quite frequently and that is why there is not checks.h]hThis function must be used only for CPU devices. There is no validation, i.e. if the EM is a CPU type and has cpumask allocated. It is called from the scheduler code quite frequently and that is why there is not checks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubh)}(h **Return**h]j)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubh)}(hthe sum of the energy consumed by the CPUs of the domain assuming a capacity state satisfying the max utilization of the domain.h]hthe sum of the energy consumed by the CPUs of the domain assuming a capacity state satisfying the max utilization of the domain.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG!em_pd_nr_perf_states (C function)c.em_pd_nr_perf_stateshNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(h4int em_pd_nr_perf_states (struct em_perf_domain *pd)h]jW)}(h3int em_pd_nr_perf_states(struct em_perf_domain *pd)h](j )}(hinth]hint}(hj7hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj3hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM?ubjo)}(h h]h }(hjFhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj3hhhjEhM?ubj)}(hem_pd_nr_perf_statesh]j)}(hem_pd_nr_perf_statesh]hem_pd_nr_perf_states}(hjXhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjTubah}(h]h ](jjeh"]h$]h&]hhuh1jhj3hhhjEhM?ubj )}(h(struct em_perf_domain *pd)h]j )}(hstruct em_perf_domain *pdh](j])}(hj`h]hstruct}(hjthhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjpubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjpubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jG )}j: jZsbc.em_pd_nr_perf_statesasbuh1hhjpubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjpubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjpubj)}(hpdh]hpd}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjpubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjlubah}(h]h ]h"]h$]h&]hhuh1j hj3hhhjEhM?ubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj/hhhjEhM?ubah}(h]j*ah ](jjeh"]h$]h&]jj)jhuh1jPhjEhM?hj,hhubj)}(hhh]h)}(h6Get the number of performance states of a perf. domainh]h6Get the number of performance states of a perf. domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM?hjhhubah}(h]h ]h"]h$]h&]uh1jhj,hhhjEhM?ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(h**Parameters** ``struct em_perf_domain *pd`` performance domain for which this must be done **Return** the number of performance states in the performance domain tableh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMChjubj&)}(hhh]j+)}(hM``struct em_perf_domain *pd`` performance domain for which this must be done h](j1)}(h``struct em_perf_domain *pd``h]j)}(hj8h]hstruct em_perf_domain *pd}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj6ubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMAhj2ubjK)}(hhh]h)}(h.performance domain for which this must be doneh]h.performance domain for which this must be done}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhMAhjNubah}(h]h ]h"]h$]h&]uh1jJhj2ubeh}(h]h ]h"]h$]h&]uh1j*hjMhMAhj/ubah}(h]h ]h"]h$]h&]uh1j%hjubh)}(h **Return**h]j)}(hjsh]hReturn}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMChjubh)}(h@the number of performance states in the performance domain tableh]h@the number of performance states in the performance domain table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMChjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG"em_perf_state_from_pd (C function)c.em_perf_state_from_pdhNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hHstruct em_perf_state * em_perf_state_from_pd (struct em_perf_domain *pd)h]jW)}(hFstruct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd)h](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMKubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhMKubh)}(hhh]j)}(h em_perf_stateh]h em_perf_state}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jG )}j: em_perf_state_from_pdsbc.em_perf_state_from_pdasbuh1hhjhhhjhMKubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhMKubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjhhhjhMKubj)}(hem_perf_state_from_pdh]j)}(hjh]hem_perf_state_from_pd}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhMKubj )}(h(struct em_perf_domain *pd)h]j )}(hstruct em_perf_domain *pdh](j])}(hj`h]hstruct}(hj2hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj.ubjo)}(h h]h }(hj?hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj.ubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hjPhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjRmodnameN classnameNj> jA )}jD ]jc.em_perf_state_from_pdasbuh1hhj.ubjo)}(h h]h }(hjnhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj.ubj[ )}(hj^ h]h*}(hj|hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hj.ubj)}(hpdh]hpd}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj*ubah}(h]h ]h"]h$]h&]hhuh1j hjhhhjhMKubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjhhhjhMKubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jPhjhMKhjhhubj)}(hhh]h)}(h0Get the performance states table of perf. domainh]h0Get the performance states table of perf. domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMKhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMKubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(hX]**Parameters** ``struct em_perf_domain *pd`` performance domain for which this must be done **Description** To use this function the rcu_read_lock() should be hold. After the usage of the performance states table is finished, the rcu_read_unlock() should be called. **Return** the pointer to performance states table of the performance domainh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMOhjubj&)}(hhh]j+)}(hM``struct em_perf_domain *pd`` performance domain for which this must be done h](j1)}(h``struct em_perf_domain *pd``h]j)}(hjh]hstruct em_perf_domain *pd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMMhjubjK)}(hhh]h)}(h.performance domain for which this must be doneh]h.performance domain for which this must be done}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMMhj ubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hj hMMhjubah}(h]h ]h"]h$]h&]uh1j%hjubh)}(h**Description**h]j)}(hj/h]h Description}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMOhjubh)}(hTo use this function the rcu_read_lock() should be hold. After the usage of the performance states table is finished, the rcu_read_unlock() should be called.h]hTo use this function the rcu_read_lock() should be hold. After the usage of the performance states table is finished, the rcu_read_unlock() should be called.}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMNhjubh)}(h **Return**h]j)}(hjVh]hReturn}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMRhjubh)}(hAthe pointer to performance states table of the performance domainh]hAthe pointer to performance states table of the performance domain}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMShjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG&em_dev_update_perf_domain (C function)c.em_dev_update_perf_domainhNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hSint em_dev_update_perf_domain (struct device *dev, struct em_perf_table *new_table)h]jW)}(hRint em_dev_update_perf_domain(struct device *dev, struct em_perf_table *new_table)h](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM;ubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhM;ubj)}(hem_dev_update_perf_domainh]j)}(hem_dev_update_perf_domainh]hem_dev_update_perf_domain}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhM;ubj )}(h5(struct device *dev, struct em_perf_table *new_table)h](j )}(hstruct device *devh](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubh)}(hhh]j)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jG )}j: jsbc.em_dev_update_perf_domainasbuh1hhjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj[ )}(hj^ h]h*}(hj$hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjubj)}(hdevh]hdev}(hj1hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hstruct em_perf_table *new_tableh](j])}(hj`h]hstruct}(hjJhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjFubjo)}(h h]h }(hjWhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjFubh)}(hhh]j)}(h em_perf_tableh]h em_perf_table}(hjhhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjjmodnameN classnameNj> jA )}jD ]jc.em_dev_update_perf_domainasbuh1hhjFubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjFubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjFubj)}(h new_tableh]h new_table}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubeh}(h]h ]h"]h$]h&]hhuh1j hjhhhjhM;ubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjhhhjhM;ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jPhjhM;hjhhubj)}(hhh]h)}(h$Update runtime EM table for a deviceh]h$Update runtime EM table for a device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM;hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM;ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(hX**Parameters** ``struct device *dev`` Device for which the EM is to be updated ``struct em_perf_table *new_table`` The new EM table that is going to be used from now **Description** Update EM runtime modifiable table for the **dev** using the provided **table**. This function uses a mutex to serialize writers, so it must not be called from a non-sleeping context. Return 0 on success or an error code on failure.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM?hjubj&)}(hhh](j+)}(h@``struct device *dev`` Device for which the EM is to be updated h](j1)}(h``struct device *dev``h]j)}(hj h]hstruct device *dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM<hjubjK)}(hhh]h)}(h(Device for which the EM is to be updatedh]h(Device for which the EM is to be updated}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hM<hj"ubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hj!hM<hjubj+)}(hW``struct em_perf_table *new_table`` The new EM table that is going to be used from now h](j1)}(h#``struct em_perf_table *new_table``h]j)}(hjEh]hstruct em_perf_table *new_table}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM=hj?ubjK)}(hhh]h)}(h2The new EM table that is going to be used from nowh]h2The new EM table that is going to be used from now}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZhM=hj[ubah}(h]h ]h"]h$]h&]uh1jJhj?ubeh}(h]h ]h"]h$]h&]uh1j*hjZhM=hjubeh}(h]h ]h"]h$]h&]uh1j%hjubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM?hjubh)}(hPUpdate EM runtime modifiable table for the **dev** using the provided **table**.h](h+Update EM runtime modifiable table for the }(hjhhhNhNubj)}(h**dev**h]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh using the provided }(hjhhhNhNubj)}(h **table**h]htable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM>hjubh)}(hfThis function uses a mutex to serialize writers, so it must not be called from a non-sleeping context.h]hfThis function uses a mutex to serialize writers, so it must not be called from a non-sleeping context.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM@hjubh)}(h0Return 0 on success or an error code on failure.h]h0Return 0 on success or an error code on failure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMChjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jGem_pd_get (C function) c.em_pd_gethNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(h6struct em_perf_domain * em_pd_get (struct device *dev)h]jW)}(h4struct em_perf_domain *em_pd_get(struct device *dev)h](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhMubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj(modnameN classnameNj> jA )}jD ]jG )}j: em_pd_getsb c.em_pd_getasbuh1hhjhhhjhMubjo)}(h h]h }(hjGhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhMubj[ )}(hj^ h]h*}(hjUhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjhhhjhMubj)}(h em_pd_geth]j)}(hjDh]h em_pd_get}(hjfhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjbubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhMubj )}(h(struct device *dev)h]j )}(hstruct device *devh](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj}ubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj}ubh)}(hhh]j)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jB c.em_pd_getasbuh1hhj}ubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj}ubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hj}ubj)}(hdevh]hdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjyubah}(h]h ]h"]h$]h&]hhuh1j hjhhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jPhjhMhjhhubj)}(hhh]h)}(h*Return the performance domain for a deviceh]h*Return the performance domain for a device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(h**Parameters** ``struct device *dev`` Device to find the performance domain for **Description** Returns the performance domain to which **dev** belongs, or NULL if it doesn't exist.h](h)}(h**Parameters**h]j)}(hj$h]h Parameters}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj&)}(hhh]j+)}(hA``struct device *dev`` Device to find the performance domain for h](j1)}(h``struct device *dev``h]j)}(hjCh]hstruct device *dev}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj=ubjK)}(hhh]h)}(h)Device to find the performance domain forh]h)Device to find the performance domain for}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhMhjYubah}(h]h ]h"]h$]h&]uh1jJhj=ubeh}(h]h ]h"]h$]h&]uh1j*hjXhMhj:ubah}(h]h ]h"]h$]h&]uh1j%hjubh)}(h**Description**h]j)}(hj~h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj|ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubh)}(hUReturns the performance domain to which **dev** belongs, or NULL if it doesn't exist.h](h(Returns the performance domain to which }(hjhhhNhNubj)}(h**dev**h]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh( belongs, or NULL if it doesn’t exist.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jGem_cpu_get (C function) c.em_cpu_gethNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(h,struct em_perf_domain * em_cpu_get (int cpu)h]jW)}(h*struct em_perf_domain *em_cpu_get(int cpu)h](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM#ubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhM#ubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jG )}j: em_cpu_getsb c.em_cpu_getasbuh1hhjhhhjhM#ubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhM#ubj[ )}(hj^ h]h*}(hj#hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjhhhjhM#ubj)}(h em_cpu_geth]j)}(hjh]h em_cpu_get}(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0ubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhM#ubj )}(h (int cpu)h]j )}(hint cpuh](j )}(hinth]hint}(hjOhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjKubjo)}(h h]h }(hj]hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjKubj)}(hcpuh]hcpu}(hjkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjKubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjGubah}(h]h ]h"]h$]h&]hhuh1j hjhhhjhM#ubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjhhhjhM#ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jPhjhM#hjhhubj)}(hhh]h)}(h'Return the performance domain for a CPUh]h'Return the performance domain for a CPU}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM#hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM#ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(h**Parameters** ``int cpu`` CPU to find the performance domain for **Description** Returns the performance domain to which **cpu** belongs, or NULL if it doesn't exist.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM'hjubj&)}(hhh]j+)}(h3``int cpu`` CPU to find the performance domain for h](j1)}(h ``int cpu``h]j)}(hjh]hint cpu}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM$hjubjK)}(hhh]h)}(h&CPU to find the performance domain forh]h&CPU to find the performance domain for}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM$hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhM$hjubah}(h]h ]h"]h$]h&]uh1j%hjubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM&hjubh)}(hUReturns the performance domain to which **cpu** belongs, or NULL if it doesn't exist.h](h(Returns the performance domain to which }(hj'hhhNhNubj)}(h**cpu**h]hcpu}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubh( belongs, or NULL if it doesn’t exist.}(hj'hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM%hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG(em_dev_register_perf_domain (C function)c.em_dev_register_perf_domainhNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hint em_dev_register_perf_domain (struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h]jW)}(hint em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h](j )}(hinth]hint}(hjhhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjdhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM6ubjo)}(h h]h }(hjwhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjdhhhjvhM6ubj)}(hem_dev_register_perf_domainh]j)}(hem_dev_register_perf_domainh]hem_dev_register_perf_domain}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjdhhhjvhM6ubj )}(hw(struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h](j )}(hstruct device *devh](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubh)}(hhh]j)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jG )}j: jsbc.em_dev_register_perf_domainasbuh1hhjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjubj)}(hdevh]hdev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hunsigned int nr_statesh](j )}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjo)}(h h]h }(hj%hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj )}(hinth]hint}(hj3hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjo)}(h h]h }(hjAhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj)}(h nr_statesh]h nr_states}(hjOhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(h!const struct em_data_callback *cbh](j])}(hconsth]hconst}(hjhhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjdubjo)}(h h]h }(hjvhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjdubj])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjdubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjdubh)}(hhh]j)}(hem_data_callbackh]hem_data_callback}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jc.em_dev_register_perf_domainasbuh1hhjdubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjdubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjdubj)}(hcbh]hcb}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjdubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hconst cpumask_t *cpush](j])}(hjjh]hconst}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubh)}(hhh]j)}(h cpumask_th]h cpumask_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jc.em_dev_register_perf_domainasbuh1hhjubjo)}(h h]h }(hj0hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj[ )}(hj^ h]h*}(hj>hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjubj)}(hcpush]hcpus}(hjKhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hbool microwattsh](j )}(hboolh]hbool}(hjdhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj`ubjo)}(h h]h }(hjrhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj`ubj)}(h microwattsh]h microwatts}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj`ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubeh}(h]h ]h"]h$]h&]hhuh1j hjdhhhjvhM6ubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj`hhhjvhM6ubah}(h]j[ah ](jjeh"]h$]h&]jj)jhuh1jPhjvhM6hj]hhubj)}(hhh]h)}(h+Register the Energy Model (EM) for a deviceh]h+Register the Energy Model (EM) for a device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM6hjhhubah}(h]h ]h"]h$]h&]uh1jhj]hhhjvhM6ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1jKhhhj)hNhNubj)}(hX**Parameters** ``struct device *dev`` Device for which the EM is to register ``unsigned int nr_states`` Number of performance states to register ``const struct em_data_callback *cb`` Callback functions providing the data of the Energy Model ``const cpumask_t *cpus`` Pointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. 'policy->cpus'. For other type of devices this should be set to NULL. ``bool microwatts`` Flag indicating that the power values are in micro-Watts or in some other scale. It must be set properly. **Description** Create Energy Model tables for a performance domain using the callbacks defined in cb. The **microwatts** is important to set with correct value. Some kernel sub-systems might rely on this flag and check if all devices in the EM are using the same scale. If multiple clients register the same performance domain, all but the first registration will be ignored. Return 0 on successh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM:hjubj&)}(hhh](j+)}(h>``struct device *dev`` Device for which the EM is to register h](j1)}(h``struct device *dev``h]j)}(hjh]hstruct device *dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM7hjubjK)}(hhh]h)}(h&Device for which the EM is to registerh]h&Device for which the EM is to register}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM7hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhM7hjubj+)}(hD``unsigned int nr_states`` Number of performance states to register h](j1)}(h``unsigned int nr_states``h]j)}(hj$h]hunsigned int nr_states}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM8hjubjK)}(hhh]h)}(h(Number of performance states to registerh]h(Number of performance states to register}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hM8hj:ubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hj9hM8hjubj+)}(h```const struct em_data_callback *cb`` Callback functions providing the data of the Energy Model h](j1)}(h%``const struct em_data_callback *cb``h]j)}(hj]h]h!const struct em_data_callback *cb}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM9hjWubjK)}(hhh]h)}(h9Callback functions providing the data of the Energy Modelh]h9Callback functions providing the data of the Energy Model}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrhM9hjsubah}(h]h ]h"]h$]h&]uh1jJhjWubeh}(h]h ]h"]h$]h&]uh1j*hjrhM9hjubj+)}(h``const cpumask_t *cpus`` Pointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. 'policy->cpus'. For other type of devices this should be set to NULL. h](j1)}(h``const cpumask_t *cpus``h]j)}(hjh]hconst cpumask_t *cpus}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM<hjubjK)}(hhh]h)}(hPointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. 'policy->cpus'. For other type of devices this should be set to NULL.h]hPointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. ‘policy->cpus’. For other type of devices this should be set to NULL.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM:hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhM<hjubj+)}(h~``bool microwatts`` Flag indicating that the power values are in micro-Watts or in some other scale. It must be set properly. h](j1)}(h``bool microwatts``h]j)}(hjh]hbool microwatts}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM>hjubjK)}(hhh]h)}(hiFlag indicating that the power values are in micro-Watts or in some other scale. It must be set properly.h]hiFlag indicating that the power values are in micro-Watts or in some other scale. It must be set properly.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM=hjubah}(h]h ]h"]h$]h&]uh1jJhjubeh}(h]h ]h"]h$]h&]uh1j*hjhM>hjubeh}(h]h ]h"]h$]h&]uh1j%hjubh)}(h**Description**h]j)}(hj h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM@hjubh)}(hVCreate Energy Model tables for a performance domain using the callbacks defined in cb.h]hVCreate Energy Model tables for a performance domain using the callbacks defined in cb.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM?hjubh)}(hThe **microwatts** is important to set with correct value. Some kernel sub-systems might rely on this flag and check if all devices in the EM are using the same scale.h](hThe }(hj1hhhNhNubj)}(h**microwatts**h]h microwatts}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubh is important to set with correct value. Some kernel sub-systems might rely on this flag and check if all devices in the EM are using the same scale.}(hj1hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMBhjubh)}(hiIf multiple clients register the same performance domain, all but the first registration will be ignored.h]hiIf multiple clients register the same performance domain, all but the first registration will be ignored.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMFhjubh)}(hReturn 0 on successh]hReturn 0 on success}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMIhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG)em_dev_register_pd_no_update (C function)c.em_dev_register_pd_no_updatehNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(hint em_dev_register_pd_no_update (struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h]jW)}(hint em_dev_register_pd_no_update(struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h](j )}(hinth]hint}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMZubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjhhhjhMZubj)}(hem_dev_register_pd_no_updateh]j)}(hem_dev_register_pd_no_updateh]hem_dev_register_pd_no_update}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]hhuh1jhjhhhjhMZubj )}(hw(struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h](j )}(hstruct device *devh](j])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubh)}(hhh]j)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jG )}j: jsbc.em_dev_register_pd_no_updateasbuh1hhjubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjubj)}(hdevh]hdev}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hunsigned int nr_statesh](j )}(hunsignedh]hunsigned}(hj?hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj;ubjo)}(h h]h }(hjMhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj;ubj )}(hinth]hint}(hj[hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj;ubjo)}(h h]h }(hjihhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj;ubj)}(h nr_statesh]h nr_states}(hjwhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(h!const struct em_data_callback *cbh](j])}(hjjh]hconst}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj])}(hj`h]hstruct}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubh)}(hhh]j)}(hem_data_callbackh]hem_data_callback}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetjmodnameN classnameNj> jA )}jD ]jc.em_dev_register_pd_no_updateasbuh1hhjubjo)}(h h]h }(hjhhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjubj[ )}(hj^ h]h*}(hjhhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hjubj)}(hcbh]hcb}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hconst cpumask_t *cpush](j])}(hjjh]hconst}(hj hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj ubjo)}(h h]h }(hj( hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubh)}(hhh]j)}(h cpumask_th]h cpumask_t}(hj9 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6 ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj; modnameN classnameNj> jA )}jD ]jc.em_dev_register_pd_no_updateasbuh1hhj ubjo)}(h h]h }(hjW hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubj[ )}(hj^ h]h*}(hje hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hj ubj)}(hcpush]hcpus}(hjr hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubj )}(hbool microwattsh](j )}(hjfh]hbool}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjo)}(h h]h }(hj hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj ubj)}(h microwattsh]h microwatts}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hjubeh}(h]h ]h"]h$]h&]hhuh1j hjhhhjhMZubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhjhhhjhMZubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jPhjhMZhjhhubj)}(hhh]h)}(h#Register a perf domain for a deviceh]h#Register a perf domain for a device}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMZhj hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMZubeh}(h]h ](jfunctioneh"]h$]h&]jjjj jj jjjuh1jKhhhj)hNhNubj)}(hX8**Parameters** ``struct device *dev`` Device to register the PD for ``unsigned int nr_states`` Number of performance states in the new PD ``const struct em_data_callback *cb`` Callback functions for populating the energy model ``const cpumask_t *cpus`` CPUs to include in the new PD (mandatory if **dev** is a CPU device) ``bool microwatts`` Whether or not the power values in the EM will be in uW **Description** Like em_dev_register_perf_domain(), but does not trigger a CPU capacity update after registering the PD, even if **dev** is a CPU device.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM^hj ubj&)}(hhh](j+)}(h5``struct device *dev`` Device to register the PD for h](j1)}(h``struct device *dev``h]j)}(hj!h]hstruct device *dev}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM[hj !ubjK)}(hhh]h)}(hDevice to register the PD forh]hDevice to register the PD for}(hj*!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&!hM[hj'!ubah}(h]h ]h"]h$]h&]uh1jJhj !ubeh}(h]h ]h"]h$]h&]uh1j*hj&!hM[hj!ubj+)}(hF``unsigned int nr_states`` Number of performance states in the new PD h](j1)}(h``unsigned int nr_states``h]j)}(hjJ!h]hunsigned int nr_states}(hjL!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjH!ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM\hjD!ubjK)}(hhh]h)}(h*Number of performance states in the new PDh]h*Number of performance states in the new PD}(hjc!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_!hM\hj`!ubah}(h]h ]h"]h$]h&]uh1jJhjD!ubeh}(h]h ]h"]h$]h&]uh1j*hj_!hM\hj!ubj+)}(hY``const struct em_data_callback *cb`` Callback functions for populating the energy model h](j1)}(h%``const struct em_data_callback *cb``h]j)}(hj!h]h!const struct em_data_callback *cb}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM]hj}!ubjK)}(hhh]h)}(h2Callback functions for populating the energy modelh]h2Callback functions for populating the energy model}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hM]hj!ubah}(h]h ]h"]h$]h&]uh1jJhj}!ubeh}(h]h ]h"]h$]h&]uh1j*hj!hM]hj!ubj+)}(h_``const cpumask_t *cpus`` CPUs to include in the new PD (mandatory if **dev** is a CPU device) h](j1)}(h``const cpumask_t *cpus``h]j)}(hj!h]hconst cpumask_t *cpus}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM^hj!ubjK)}(hhh]h)}(hDCPUs to include in the new PD (mandatory if **dev** is a CPU device)h](h,CPUs to include in the new PD (mandatory if }(hj!hhhNhNubj)}(h**dev**h]hdev}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh is a CPU device)}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj!hM^hj!ubah}(h]h ]h"]h$]h&]uh1jJhj!ubeh}(h]h ]h"]h$]h&]uh1j*hj!hM^hj!ubj+)}(hL``bool microwatts`` Whether or not the power values in the EM will be in uW h](j1)}(h``bool microwatts``h]j)}(hj"h]hbool microwatts}(hj "hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM_hj"ubjK)}(hhh]h)}(h7Whether or not the power values in the EM will be in uWh]h7Whether or not the power values in the EM will be in uW}(hj "hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hM_hj"ubah}(h]h ]h"]h$]h&]uh1jJhj"ubeh}(h]h ]h"]h$]h&]uh1j*hj"hM_hj!ubeh}(h]h ]h"]h$]h&]uh1j%hj ubh)}(h**Description**h]j)}(hjB"h]h Description}(hjD"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@"uba{h}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMahj ubh)}(hLike em_dev_register_perf_domain(), but does not trigger a CPU capacity update after registering the PD, even if **dev** is a CPU device.h](hqLike em_dev_register_perf_domain(), but does not trigger a CPU capacity update after registering the PD, even if }(hjX"hhhNhNubj)}(h**dev**h]hdev}(hj`"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjX"ubh is a CPU device.}(hjX"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM`hj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG*em_dev_unregister_perf_domain (C function)c.em_dev_unregister_perf_domainhNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(h7void em_dev_unregister_perf_domain (struct device *dev)h]jW)}(h6void em_dev_unregister_perf_domain(struct device *dev)h](j )}(hvoidh]hvoid}(hj"hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj"hhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubjo)}(h h]h }(hj"hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj"hhhj"hMubj)}(hem_dev_unregister_perf_domainh]j)}(hem_dev_unregister_perf_domainh]hem_dev_unregister_perf_domain}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj"hhhj"hMubj )}(h(struct device *dev)h]j )}(hstruct device *devh](j])}(hj`h]hstruct}(hj"hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj"ubjo)}(h h]h }(hj"hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj"ubh)}(hhh]j)}(hdeviceh]hdevice}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj"modnameN classnameNj> jA )}jD ]jG )}j: j"sbc.em_dev_unregister_perf_domainasbuh1hhj"ubjo)}(h h]h }(hj#hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj"ubj[ )}(hj^ h]h*}(hj"#hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hj"ubj)}(hdevh]hdev}(hj/#hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj"ubah}(h]h ]h"]h$]h&]hhuh1j hj"hhhj"hMubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj"hhhj"hMubah}(h]j"ah ](jjeh"]h$]h&]jj)jhuh1jPhj"hMhj"hhubj)}(hhh]h)}(h)Unregister Energy Model (EM) for a deviceh]h)Unregister Energy Model (EM) for a device}(hjY#hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjV#hhubah}(h]h ]h"]h$]h&]uh1jhj"hhhj"hMubeh}(h]h ](jfunctioneh"]h$]h&]jjjjq#jjq#jjjuh1jKhhhj)hNhNubj)}(h**Parameters** ``struct device *dev`` Device for which the EM is registered **Description** Unregister the EM for the specified **dev** (but not a CPU device).h](h)}(h**Parameters**h]j)}(hj{#h]h Parameters}(hj}#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy#ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhju#ubj&)}(hhh]j+)}(h=``struct device *dev`` Device for which the EM is registered h](j1)}(h``struct device *dev``h]j)}(hj#h]hstruct device *dev}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj#ubjK)}(hhh]h)}(h%Device for which the EM is registeredh]h%Device for which the EM is registered}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hMhj#ubah}(h]h ]h"]h$]h&]uh1jJhj#ubeh}(h]h ]h"]h$]h&]uh1j*hj#hMhj#ubah}(h]h ]h"]h$]h&]uh1j%hju#ubh)}(h**Description**h]j)}(hj#h]h Description}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhju#ubh)}(hCUnregister the EM for the specified **dev** (but not a CPU device).h](h$Unregister the EM for the specified }(hj#hhhNhNubj)}(h**dev**h]hdev}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh (but not a CPU device).}(hj#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhju#ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG'em_dev_update_chip_binning (C function)c.em_dev_update_chip_binninghNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(h3int em_dev_update_chip_binning (struct device *dev)h]jW)}(h2int em_dev_update_chip_binning(struct device *dev)h](j )}(hinth]hint}(hj,$hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj($hhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubjo)}(h h]h }(hj;$hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj($hhhj:$hMubj)}(hem_dev_update_chip_binningh]j)}(hem_dev_update_chip_binningh]hem_dev_update_chip_binning}(hjM$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjI$ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj($hhhj:$hMubj )}(h(struct device *dev)h]j )}(hstruct device *devh](j])}(hj`h]hstruct}(hji$hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hje$ubjo)}(h h]h }(hjv$hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhje$ubh)}(hhh]j)}(hdeviceh]hdevice}(hj$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj$modnameN classnameNj> jA )}jD ]jG )}j: jO$sbc.em_dev_update_chip_binningasbuh1hhje$ubjo)}(h h]h }(hj$hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhje$ubj[ )}(hj^ h]h*}(hj$hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hje$ubj)}(hdevh]hdev}(hj$hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhje$ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hja$ubah}(h]h ]h"]h$]h&]hhuh1j hj($hhhj:$hMubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj$$hhhj:$hMubah}(h]j$ah ](jjeh"]h$]h&]jj)jhuh1jPhj:$hMhj!$hhubj)}(hhh]h)}(hMUpdate Energy Model after the new voltage information is present in the OPPs.h]hMUpdate Energy Model after the new voltage information is present in the OPPs.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj$hhubah}(h]h ]h"]h$]h&]uh1jhj!$hhhj:$hMubeh}(h]h ](jfunctioneh"]h$]h&]jjjj%jj%jjjuh1jKhhhj)hNhNubj)}(hXP**Parameters** ``struct device *dev`` Device for which the Energy Model has to be updated. **Description** This function allows to update easily the EM with new values available in the OPP framework and DT. It can be used after the chip has been properly verified by device drivers and the voltages adjusted for the 'chip binning'.h](h)}(h**Parameters**h]j)}(hj%h]h Parameters}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj %ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj%ubj&)}(hhh]j+)}(hL``struct device *dev`` Device for which the Energy Model has to be updated. h](j1)}(h``struct device *dev``h]j)}(hj-%h]hstruct device *dev}(hj/%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+%ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj'%ubjK)}(hhh]h)}(h4Device for which the Energy Model has to be updated.h]h4Device for which the Energy Model has to be updated.}(hjF%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjB%hMhjC%ubah}(h]h ]h"]h$]h&]uh1jJhj'%ubeh}(h]h ]h"]h$]h&]uh1j*hjB%hMhj$%ubah}(h]h ]h"]h$]h&]uh1j%hj%ubh)}(h**Description**h]j)}(hjh%h]h Description}(hjj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjf%ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj%ubh)}(hThis function allows to update easily the EM with new values available in the OPP framework and DT. It can be used after the chip has been properly verified by device drivers and the voltages adjusted for the 'chip binning'.h]hThis function allows to update easily the EM with new values available in the OPP framework and DT. It can be used after the chip has been properly verified by device drivers and the voltages adjusted for the ‘chip binning’.}(hj~%hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj%ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubj;)}(hhh]h}(h]h ]h"]h$]h&]entries](jG)em_update_performance_limits (C function)c.em_update_performance_limitshNtauh1j:hj)hhhNhNubjL)}(hhh](jQ)}(htint em_update_performance_limits (struct em_perf_domain *pd, unsigned long freq_min_khz, unsigned long freq_max_khz)h]jW)}(hsint em_update_performance_limits(struct em_perf_domain *pd, unsigned long freq_min_khz, unsigned long freq_max_khz)h](j )}(hinth]hint}(hj%hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj%hhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubjo)}(h h]h }(hj%hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj%hhhj%hMubj)}(hem_update_performance_limitsh]j)}(hem_update_performance_limitsh]hem_update_performance_limits}(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj%ubah}(h]h ](jjeh"]h$]h&]hhuh1jhj%hhhj%hMubj )}(hS(struct em_perf_domain *pd, unsigned long freq_min_khz, unsigned long freq_max_khz)h](j )}(hstruct em_perf_domain *pdh](j])}(hj`h]hstruct}(hj%hhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hj%ubjo)}(h h]h }(hj%hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj%ubh)}(hhh]j)}(hem_perf_domainh]hem_perf_domain}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&] refdomainjreftypej: reftargetj &modnameN classnameNj> jA )}jD ]jG )}j: j%sbc.em_update_performance_limitsasbuh1hhj%ubjo)}(h h]h }(hj(&hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj%ubj[ )}(hj^ h]h*}(hj6&hhhNhNubah}(h]h ]jg ah"]h$]h&]uh1jZ hj%ubj)}(hpdh]hpd}(hjC&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj%ubj )}(hunsigned long freq_min_khzh](j )}(hunsignedh]hunsigned}(hj\&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjX&ubjo)}(h h]h }(hjj&hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjX&ubj )}(hlongh]hlong}(hjx&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjX&ubjo)}(h h]h }(hj&hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhjX&ubj)}(h freq_min_khzh]h freq_min_khz}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjX&ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj%ubj )}(hunsigned long freq_max_khzh](j )}(hunsignedh]hunsigned}(hj&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj&ubjo)}(h h]h }(hj&hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj&ubj )}(hlongh]hlong}(hj&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj&ubjo)}(h h]h }(hj&hhhNhNubah}(h]h ]j{ah"]h$]h&]uh1jnhj&ubj)}(h freq_max_khzh]h freq_max_khz}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]noemphhhuh1j hj%ubeh}(h]h ]h"]h$]h&]hhuh1j hj%hhhj%hMubeh}(h]h ]h"]h$]h&]hhjuh1jVjjhj%hhhj%hMubah}(h]j%ah ](jjeh"]h$]h&]jj)jhuh1jPhj%hMhj%hhubj)}(hhh]h)}(h8Update Energy Model with performance limits information.h]h8Update Energy Model with performance limits information.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj 'hhubah}(h]h ]h"]h$]h&]uh1jhj%hhhj%hMubeh}(h]h ](jfunctioneh"]h$]h&]jjjj''jj''jjjuh1jKhhhj)hNhNubj)}(hX**Parameters** ``struct em_perf_domain *pd`` Performance Domain with EM that has to be updated. ``unsigned long freq_min_khz`` New minimum allowed frequency for this device. ``unsigned long freq_max_khz`` New maximum allowed frequency for this device. **Description** This function allows to update the EM with information about available performance levels. It takes the minimum and maximum frequency in kHz and does internal translation to performance levels. Returns 0 on success or -EINVAL when failed.h](h)}(h**Parameters**h]j)}(hj1'h]h Parameters}(hj3'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/'ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj+'ubj&)}(hhh](j+)}(hQ``struct em_perf_domain *pd`` Performance Domain with EM that has to be updated. h](j1)}(h``struct em_perf_domain *pd``h]j)}(hjP'h]hstruct em_perf_domain *pd}(hjR'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjN'ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjJ'ubjK)}(hhh]h)}(h2Performance Domain with EM that has to be updated.h]h2Performance Domain with EM that has to be updated.}(hji'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhje'hMhjf'ubah}(h]h ]h"]h$]h&]uh1jJhjJ'ubeh}(h]h ]h"]h$]h&]uh1j*hje'hMhjG'ubj+)}(hN``unsigned long freq_min_khz`` New minimum allowed frequency for this device. h](j1)}(h``unsigned long freq_min_khz``h]j)}(hj'h]hunsigned long freq_min_khz}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj'ubjK)}(hhh]h)}(h.New minimum allowed frequency for this device.h]h.New minimum allowed frequency for this device.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hMhj'ubah}(h]h ]h"]h$]h&]uh1jJhj'ubeh}(h]h ]h"]h$]h&]uh1j*hj'hMhjG'ubj+)}(hN``unsigned long freq_max_khz`` New maximum allowed frequency for this device. h](j1)}(h``unsigned long freq_max_khz``h]j)}(hj'h]hunsigned long freq_max_khz}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1j0h_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj'ubjK)}(hhh]h)}(h.New maximum allowed frequency for this device.h]h.New maximum allowed frequency for this device.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hMhj'ubah}(h]h ]h"]h$]h&]uh1jJhj'ubeh}(h]h ]h"]h$]h&]uh1j*hj'hMhjG'ubeh}(h]h ]h"]h$]h&]uh1j%hj+'ubh)}(h**Description**h]j)}(hj'h]h Description}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj+'ubh)}(hThis function allows to update the EM with information about available performance levels. It takes the minimum and maximum frequency in kHz and does internal translation to performance levels. Returns 0 on success or -EINVAL when failed.h]hThis function allows to update the EM with information about available performance levels. It takes the minimum and maximum frequency in kHz and does internal translation to performance levels. Returns 0 on success or -EINVAL when failed.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj+'ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhj)hhhNhNubeh}(h]description-details-of-this-apiah ]h"]#2.5 description details of this apiah$]h&]uh1hhjhhhhhMubeh}(h] core-apisah ]h"] 2. core apisah$]h&]uh1hhhhhhhhKeubh)}(hhh](h)}(h 3. Examplesh]h 3. Examples}(hj<(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9(hhhhhM ubh)}(hhh](h)}(h'3.1 Example driver with EM registrationh]h'3.1 Example driver with EM registration}(hjM(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJ(hhhhhM#ubh)}(hXThe CPUFreq framework supports dedicated callback for registering the EM for a given CPU(s) 'policy' object: cpufreq_driver::register_em(). That callback has to be implemented properly for a given driver, because the framework would call it at the right time during setup. This section provides a simple example of a CPUFreq driver registering a performance domain in the Energy Model framework using the (fake) 'foo' protocol. The driver implements an est_power() function to be provided to the EM framework::h]hXThe CPUFreq framework supports dedicated callback for registering the EM for a given CPU(s) ‘policy’ object: cpufreq_driver::register_em(). That callback has to be implemented properly for a given driver, because the framework would call it at the right time during setup. This section provides a simple example of a CPUFreq driver registering a performance domain in the Energy Model framework using the (fake) ‘foo’ protocol. The driver implements an est_power() function to be provided to the EM framework:}(hj[(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hjJ(hhubj))}(hX-> drivers/cpufreq/foo_cpufreq.c 01 static int est_power(struct device *dev, unsigned long *mW, 02 unsigned long *KHz) 03 { 04 long freq, power; 05 06 /* Use the 'foo' protocol to ceil the frequency */ 07 freq = foo_get_freq_ceil(dev, *KHz); 08 if (freq < 0) 09 return freq; 10 11 /* Estimate the power cost for the dev at the relevant freq. */ 12 power = foo_estimate_power(dev, freq); 13 if (power < 0) 14 return power; 15 16 /* Return the values to the EM framework */ 17 *mW = power; 18 *KHz = freq; 19 20 return 0; 21 } 22 23 static void foo_cpufreq_register_em(struct cpufreq_policy *policy) 24 { 25 struct em_data_callback em_cb = EM_DATA_CB(est_power); 26 struct device *cpu_dev; 27 int nr_opp; 28 29 cpu_dev = get_cpu_device(cpumask_first(policy->cpus)); 30 31 /* Find the number of OPPs for this policy */ 32 nr_opp = foo_get_nr_opp(policy); 33 34 /* And register the new performance domain */ 35 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus, 36 true); 37 } 38 39 static struct cpufreq_driver foo_cpufreq_driver = { 40 .register_em = foo_cpufreq_register_em, 41 };h]hX-> drivers/cpufreq/foo_cpufreq.c 01 static int est_power(struct device *dev, unsigned long *mW, 02 unsigned long *KHz) 03 { 04 long freq, power; 05 06 /* Use the 'foo' protocol to ceil the frequency */ 07 freq = foo_get_freq_ceil(dev, *KHz); 08 if (freq < 0) 09 return freq; 10 11 /* Estimate the power cost for the dev at the relevant freq. */ 12 power = foo_estimate_power(dev, freq); 13 if (power < 0) 14 return power; 15 16 /* Return the values to the EM framework */ 17 *mW = power; 18 *KHz = freq; 19 20 return 0; 21 } 22 23 static void foo_cpufreq_register_em(struct cpufreq_policy *policy) 24 { 25 struct em_data_callback em_cb = EM_DATA_CB(est_power); 26 struct device *cpu_dev; 27 int nr_opp; 28 29 cpu_dev = get_cpu_device(cpumask_first(policy->cpus)); 30 31 /* Find the number of OPPs for this policy */ 32 nr_opp = foo_get_nr_opp(policy); 33 34 /* And register the new performance domain */ 35 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus, 36 true); 37 } 38 39 static struct cpufreq_driver foo_cpufreq_driver = { 40 .register_em = foo_cpufreq_register_em, 41 };}hji(sbah}(h]h ]h"]h$]h&]hhuh1j(hhhM.hjJ(hhubeh}(h]#example-driver-with-em-registrationah ]h"]'3.1 example driver with em registrationah$]h&]uh1hhj9(hhhhhM#ubh)}(hhh](h)}(h'3.2 Example driver with EM modificationh]h'3.2 Example driver with EM modification}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhM\ubh)}(hThis section provides a simple example of a thermal driver modifying the EM. The driver implements a foo_thermal_em_update() function. The driver is woken up periodically to check the temperature and modify the EM data::h]hThis section provides a simple example of a thermal driver modifying the EM. The driver implements a foo_thermal_em_update() function. The driver is woken up periodically to check the temperature and modify the EM data:}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj(hhubj))}(hX-> drivers/soc/example/example_em_mod.c 01 static void foo_get_new_em(struct foo_context *ctx) 02 { 03 struct em_perf_table __rcu *em_table; 04 struct em_perf_state *table, *new_table; 05 struct device *dev = ctx->dev; 06 struct em_perf_domain *pd; 07 unsigned long freq; 08 int i, ret; 09 10 pd = em_pd_get(dev); 11 if (!pd) 12 return; 13 14 em_table = em_table_alloc(pd); 15 if (!em_table) 16 return; 17 18 new_table = em_table->state; 19 20 rcu_read_lock(); 21 table = em_perf_state_from_pd(pd); 22 for (i = 0; i < pd->nr_perf_states; i++) { 23 freq = table[i].frequency; 24 foo_get_power_perf_values(dev, freq, &new_table[i]); 25 } 26 rcu_read_unlock(); 27 28 /* Calculate 'cost' values for EAS */ 29 ret = em_dev_compute_costs(dev, new_table, pd->nr_perf_states); 30 if (ret) { 31 dev_warn(dev, "EM: compute costs failed %d\n", ret); 32 em_table_free(em_table); 33 return; 34 } 35 36 ret = em_dev_update_perf_domain(dev, em_table); 37 if (ret) { 38 dev_warn(dev, "EM: update failed %d\n", ret); 39 em_table_free(em_table); 40 return; 41 } 42 43 /* 44 * Since it's one-time-update drop the usage counter. 45 * The EM framework will later free the table when needed. 46 */ 47 em_table_free(em_table); 48 } 49 50 /* 51 * Function called periodically to check the temperature and 52 * update the EM if needed 53 */ 54 static void foo_thermal_em_update(struct foo_context *ctx) 55 { 56 struct device *dev = ctx->dev; 57 int cpu; 58 59 ctx->temperature = foo_get_temp(dev, ctx); 60 if (ctx->temperature < FOO_EM_UPDATE_TEMP_THRESHOLD) 61 return; 62 63 foo_get_new_em(ctx); 64 }h]hX-> drivers/soc/example/example_em_mod.c 01 static void foo_get_new_em(struct foo_context *ctx) 02 { 03 struct em_perf_table __rcu *em_table; 04 struct em_perf_state *table, *new_table; 05 struct device *dev = ctx->dev; 06 struct em_perf_domain *pd; 07 unsigned long freq; 08 int i, ret; 09 10 pd = em_pd_get(dev); 11 if (!pd) 12 return; 13 14 em_table = em_table_alloc(pd); 15 if (!em_table) 16 return; 17 18 new_table = em_table->state; 19 20 rcu_read_lock(); 21 table = em_perf_state_from_pd(pd); 22 for (i = 0; i < pd->nr_perf_states; i++) { 23 freq = table[i].frequency; 24 foo_get_power_perf_values(dev, freq, &new_table[i]); 25 } 26 rcu_read_unlock(); 27 28 /* Calculate 'cost' values for EAS */ 29 ret = em_dev_compute_costs(dev, new_table, pd->nr_perf_states); 30 if (ret) { 31 dev_warn(dev, "EM: compute costs failed %d\n", ret); 32 em_table_free(em_table); 33 return; 34 } 35 36 ret = em_dev_update_perf_domain(dev, em_table); 37 if (ret) { 38 dev_warn(dev, "EM: update failed %d\n", ret); 39 em_table_free(em_table); 40 return; 41 } 42 43 /* 44 * Since it's one-time-update drop the usage counter. 45 * The EM framework will later free the table when needed. 46 */ 47 em_table_free(em_table); 48 } 49 50 /* 51 * Function called periodically to check the temperature and 52 * update the EM if needed 53 */ 54 static void foo_thermal_em_update(struct foo_context *ctx) 55 { 56 struct device *dev = ctx->dev; 57 int cpu; 58 59 ctx->temperature = foo_get_temp(dev, ctx); 60 if (ctx->temperature < FOO_EM_UPDATE_TEMP_THRESHOLD) 61 return; 62 63 foo_get_new_em(ctx); 64 }}hj(sbah}(h]h ]h"]h$]h&]hhuh1j(hhhMbhj(hhubeh}(h]#example-driver-with-em-modificationah ]h"]'3.2 example driver with em modificationah$]h&]uh1hhj9(hhhhhM\ubeh}(h]examplesah ]h"] 3. examplesah$]h&]uh1hhhhhhhhM ubeh}(h]energy-model-of-devicesah ]h"]energy model of devicesah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj(error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j(j(jjj6(j3(jjjjjjjDjAjkjhjjjjj&j#j.(j+(j(j(j|(jy(j(j(u nametypes}(j(jj6(jjjjDjkjjj&j.(j(j|(j(uh}(j(hjhj3(jjjjjjjjAj jhjGjjnjjj#jj+(j)jIjRjijnjjj j j j j*j/jjjjjjjjj[j`jjj"j"j$j$$j%j%j(j9(jy(jJ(j(j(u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.