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/pm_qos_interfacemodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/zh_TW/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/it_IT/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ja_JP/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ko_KR/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/pt_BR/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/sp_SP/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hPM Quality Of Service Interfaceh]hPM Quality Of Service Interface}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhD/var/lib/git/docbuild/linux/Documentation/power/pm_qos_interface.rsthKubh paragraph)}(hThis interface provides a kernel and user mode interface for registering performance expectations by drivers, subsystems and user space applications on one of the parameters.h]hThis interface provides a kernel and user mode interface for registering performance expectations by drivers, subsystems and user space applications on one of the parameters.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhdefinition_list)}(hhh]hdefinition_list_item)}(hTwo different PM QoS frameworks are available: * CPU latency QoS. * The per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags. h](hterm)}(h.Two different PM QoS frameworks are available:h]h.Two different PM QoS frameworks are available:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubh definition)}(hhh]h bullet_list)}(hhh](h list_item)}(hCPU latency QoS.h]h)}(hjh]hCPU latency QoS.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1jhhubj)}(hpThe per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags. h]h)}(hoThe per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags.h]hoThe per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1jhhubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhNhNubh)}(hHThe latency unit used in the PM QoS framework is the microsecond (usec).h]hHThe latency unit used in the PM QoS framework is the microsecond (usec).}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h1. PM QoS frameworkh]h1. PM QoS framework}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjYhhhhhKubh)}(hXAA global list of CPU latency QoS requests is maintained along with an aggregated (effective) target value. The aggregated target value is updated with changes to the request list or elements of the list. For CPU latency QoS, the aggregated target value is simply the min of the request values held in the list elements.h]hXAA global list of CPU latency QoS requests is maintained along with an aggregated (effective) target value. The aggregated target value is updated with changes to the request list or elements of the list. For CPU latency QoS, the aggregated target value is simply the min of the request values held in the list elements.}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjYhhubh)}(hNote: the aggregated target value is implemented as an atomic variable so that reading the aggregated value does not require any locking mechanism.h]hNote: the aggregated target value is implemented as an atomic variable so that reading the aggregated value does not require any locking mechanism.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjYhhubh)}(h6From kernel space the use of this interface is simple:h]h6From kernel space the use of this interface is simple:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjYhhubh)}(hhh](h)}(hXnvoid cpu_latency_qos_add_request(handle, target_value): Will insert an element into the CPU latency QoS list with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of PM QoS need to save the returned handle for future use in other PM QoS API functions. h](h)}(h7void cpu_latency_qos_add_request(handle, target_value):h]h7void cpu_latency_qos_add_request(handle, target_value):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjubh)}(hhh]h)}(hX5Will insert an element into the CPU latency QoS list with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of PM QoS need to save the returned handle for future use in other PM QoS API functions.h]hX5Will insert an element into the CPU latency QoS list with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of PM QoS need to save the returned handle for future use in other PM QoS API functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK$hjubh)}(hvoid cpu_latency_qos_update_request(handle, new_target_value): Will update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification tree if the target is changed. h](h)}(h>void cpu_latency_qos_update_request(handle, new_target_value):h]h>void cpu_latency_qos_update_request(handle, new_target_value):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubh)}(hhh]h)}(hWill update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification tree if the target is changed.h]hWill update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification tree if the target is changed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK)hjhhubh)}(hvoid cpu_latency_qos_remove_request(handle): Will remove the element. After removal it will update the aggregate target and call the notification tree if the target was changed as a result of removing the request. h](h)}(h,void cpu_latency_qos_remove_request(handle):h]h,void cpu_latency_qos_remove_request(handle):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubh)}(hhh]h)}(hWill remove the element. After removal it will update the aggregate target and call the notification tree if the target was changed as a result of removing the request.h]hWill remove the element. After removal it will update the aggregate target and call the notification tree if the target was changed as a result of removing the request.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK.hjhhubh)}(hSint cpu_latency_qos_limit(): Returns the aggregated value for the CPU latency QoS. h](h)}(hint cpu_latency_qos_limit():h]hint cpu_latency_qos_limit():}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hj$ubh)}(hhh]h)}(h5Returns the aggregated value for the CPU latency QoS.h]h5Returns the aggregated value for the CPU latency QoS.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hj6ubah}(h]h ]h"]h$]h&]uh1hhj$ubeh}(h]h ]h"]h$]h&]uh1hhhhK1hjhhubh)}(hint cpu_latency_qos_request_active(handle): Returns if the request is still active, i.e. it has not been removed from the CPU latency QoS list. h](h)}(h+int cpu_latency_qos_request_active(handle):h]h+int cpu_latency_qos_request_active(handle):}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjSubh)}(hhh]h)}(hcReturns if the request is still active, i.e. it has not been removed from the CPU latency QoS list.h]hcReturns if the request is still active, i.e. it has not been removed from the CPU latency QoS list.}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjeubah}(h]h ]h"]h$]h&]uh1hhjSubeh}(h]h ]h"]h$]h&]uh1hhhhK6hjhhubeh}(h]h ]h"]h$]h&]uh1hhjYhhhhhNubh)}(hFrom user space:h]hFrom user space:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjYhhubh)}(hThe infrastructure exposes two separate device nodes, /dev/cpu_dma_latency for the CPU latency QoS and /dev/cpu_wakeup_latency for the CPU system wakeup latency QoS.h]hThe infrastructure exposes two separate device nodes, /dev/cpu_dma_latency for the CPU latency QoS and /dev/cpu_wakeup_latency for the CPU system wakeup latency QoS.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjYhhubh)}(hOnly processes can register a PM QoS request. To provide for automatic cleanup of a process, the interface requires the process to register its parameter requests as follows.h]hOnly processes can register a PM QoS request. To provide for automatic cleanup of a process, the interface requires the process to register its parameter requests as follows.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjYhhubh)}(hTo register the default PM QoS target for the CPU latency QoS, the process must open /dev/cpu_dma_latency. To register a CPU system wakeup QoS limit, the process must open /dev/cpu_wakeup_latency.h]hTo register the default PM QoS target for the CPU latency QoS, the process must open /dev/cpu_dma_latency. To register a CPU system wakeup QoS limit, the process must open /dev/cpu_wakeup_latency.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjYhhubh)}(h_As long as the device node is held open that process has a registered request on the parameter.h]h_As long as the device node is held open that process has a registered request on the parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjYhhubh)}(hTo change the requested target value, the process needs to write an s32 value to the open device node. Alternatively, it can write a hex string for the value using the 10 char long format e.g. "0x12345678".h]hTo change the requested target value, the process needs to write an s32 value to the open device node. Alternatively, it can write a hex string for the value using the 10 char long format e.g. “0x12345678”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjYhhubh)}(hPTo remove the user mode request for a target value simply close the device node.h]hPTo remove the user mode request for a target value simply close the device node.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjYhhubeh}(h]pm-qos-frameworkah ]h"]1. pm qos frameworkah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h02. PM QoS per-device latency and flags frameworkh]h02. PM QoS per-device latency and flags framework}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKRubh)}(hX$For each device, there are three lists of PM QoS requests. Two of them are maintained along with the aggregated targets of resume latency and active state latency tolerance (in microseconds) and the third one is for PM QoS flags. Values are updated in response to changes of the request list.h]hX$For each device, there are three lists of PM QoS requests. Two of them are maintained along with the aggregated targets of resume latency and active state latency tolerance (in microseconds) and the third one is for PM QoS flags. Values are updated in response to changes of the request list.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjhhubh)}(hX8The target values of resume latency and active state latency tolerance are simply the minimum of the request values held in the parameter list elements. The PM QoS flags aggregate value is a gather (bitwise OR) of all list elements' values. One device PM QoS flag is defined currently: PM_QOS_FLAG_NO_POWER_OFF.h]hX:The target values of resume latency and active state latency tolerance are simply the minimum of the request values held in the parameter list elements. The PM QoS flags aggregate value is a gather (bitwise OR) of all list elements’ values. One device PM QoS flag is defined currently: PM_QOS_FLAG_NO_POWER_OFF.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubh)}(hNote: The aggregated target values are implemented in such a way that reading the aggregated value does not require any locking mechanism.h]hNote: The aggregated target values are implemented in such a way that reading the aggregated value does not require any locking mechanism.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjhhubh)}(hubh)}(hhh]h)}(hX@Will insert an element into the list for that identified device with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of dev_pm_qos need to save the handle for future use in other dev_pm_qos API functions.h]hX@Will insert an element into the list for that identified device with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of dev_pm_qos need to save the handle for future use in other dev_pm_qos API functions.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjPubah}(h]h ]h"]h$]h&]uh1hhj>ubeh}(h]h ]h"]h$]h&]uh1hhhhKihj;ubh)}(hint dev_pm_qos_update_request(handle, new_value): Will update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification trees if the target is changed. h](h)}(h1int dev_pm_qos_update_request(handle, new_value):h]h1int dev_pm_qos_update_request(handle, new_value):}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjmubh)}(hhh]h)}(hWill update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification trees if the target is changed.h]hWill update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification trees if the target is changed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjubah}(h]h ]h"]h$]h&]uh1hhjmubeh}(h]h ]h"]h$]h&]uh1hhhhKnhj;hhubh)}(hint dev_pm_qos_remove_request(handle): Will remove the element. After removal it will update the aggregate target and call the notification trees if the target was changed as a result of removing the request. h](h)}(h&int dev_pm_qos_remove_request(handle):h]h&int dev_pm_qos_remove_request(handle):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjubh)}(hhh]h)}(hWill remove the element. After removal it will update the aggregate target and call the notification trees if the target was changed as a result of removing the request.h]hWill remove the element. After removal it will update the aggregate target and call the notification trees if the target was changed as a result of removing the request.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKshj;hhubh)}(hms32 dev_pm_qos_read_value(device, type): Returns the aggregated value for a given device's constraints list. h](h)}(h(s32 dev_pm_qos_read_value(device, type):h]h(s32 dev_pm_qos_read_value(device, type):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubh)}(hhh]h)}(hCReturns the aggregated value for a given device's constraints list.h]hEReturns the aggregated value for a given device’s constraints list.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKvhj;hhubh)}(hXenum pm_qos_flags_status dev_pm_qos_flags(device, mask) Check PM QoS flags of the given device against the given mask of flags. The meaning of the return values is as follows: PM_QOS_FLAGS_ALL: All flags from the mask are set PM_QOS_FLAGS_SOME: Some flags from the mask are set PM_QOS_FLAGS_NONE: No flags from the mask are set PM_QOS_FLAGS_UNDEFINED: The device's PM QoS structure has not been initialized or the list of requests is empty. h](h)}(h7enum pm_qos_flags_status dev_pm_qos_flags(device, mask)h]h7enum pm_qos_flags_status dev_pm_qos_flags(device, mask)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh](h)}(hwCheck PM QoS flags of the given device against the given mask of flags. The meaning of the return values is as follows:h]hwCheck PM QoS flags of the given device against the given mask of flags. The meaning of the return values is as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhj ubh block_quote)}(hX1PM_QOS_FLAGS_ALL: All flags from the mask are set PM_QOS_FLAGS_SOME: Some flags from the mask are set PM_QOS_FLAGS_NONE: No flags from the mask are set PM_QOS_FLAGS_UNDEFINED: The device's PM QoS structure has not been initialized or the list of requests is empty. h]h)}(hhh](h)}(h1PM_QOS_FLAGS_ALL: All flags from the mask are seth](h)}(hPM_QOS_FLAGS_ALL:h]hPM_QOS_FLAGS_ALL:}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hj&ubh)}(hhh]h)}(hAll flags from the mask are seth]hAll flags from the mask are set}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hj8ubah}(h]h ]h"]h$]h&]uh1hhj&ubeh}(h]h ]h"]h$]h&]uh1hhhhK|hj#ubh)}(h3PM_QOS_FLAGS_SOME: Some flags from the mask are seth](h)}(hPM_QOS_FLAGS_SOME:h]hPM_QOS_FLAGS_SOME:}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjUubh)}(hhh]h)}(h Some flags from the mask are seth]h Some flags from the mask are set}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjgubah}(h]h ]h"]h$]h&]uh1hhjUubeh}(h]h ]h"]h$]h&]uh1hhhhK~hj#ubh)}(h1PM_QOS_FLAGS_NONE: No flags from the mask are seth](h)}(hPM_QOS_FLAGS_NONE:h]hPM_QOS_FLAGS_NONE:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hNo flags from the mask are seth]hNo flags from the mask are set}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj#ubh)}(hqPM_QOS_FLAGS_UNDEFINED: The device's PM QoS structure has not been initialized or the list of requests is empty. h](h)}(hPM_QOS_FLAGS_UNDEFINED:h]hPM_QOS_FLAGS_UNDEFINED:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hXThe device's PM QoS structure has not been initialized or the list of requests is empty.h]hZThe device’s PM QoS structure has not been initialized or the list of requests is empty.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj#ubeh}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhhhK|hj ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj;hhubh)}(hXGint dev_pm_qos_add_ancestor_request(dev, handle, type, value) Add a PM QoS request for the first direct ancestor of the given device whose power.ignore_children flag is unset (for DEV_PM_QOS_RESUME_LATENCY requests) or whose power.set_latency_tolerance callback pointer is not NULL (for DEV_PM_QOS_LATENCY_TOLERANCE requests). h](h)}(h=int dev_pm_qos_add_ancestor_request(dev, handle, type, value)h]h=int dev_pm_qos_add_ancestor_request(dev, handle, type, value)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hXAdd a PM QoS request for the first direct ancestor of the given device whose power.ignore_children flag is unset (for DEV_PM_QOS_RESUME_LATENCY requests) or whose power.set_latency_tolerance callback pointer is not NULL (for DEV_PM_QOS_LATENCY_TOLERANCE requests).h]hXAdd a PM QoS request for the first direct ancestor of the given device whose power.ignore_children flag is unset (for DEV_PM_QOS_RESUME_LATENCY requests) or whose power.set_latency_tolerance callback pointer is not NULL (for DEV_PM_QOS_LATENCY_TOLERANCE requests).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj;hhubh)}(hXint dev_pm_qos_expose_latency_limit(device, value) Add a request to the device's PM QoS list of resume latency constraints and create a sysfs attribute pm_qos_resume_latency_us under the device's power directory allowing user space to manipulate that request. h](h)}(h2int dev_pm_qos_expose_latency_limit(device, value)h]h2int dev_pm_qos_expose_latency_limit(device, value)}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj)ubh)}(hhh]h)}(hAdd a request to the device's PM QoS list of resume latency constraints and create a sysfs attribute pm_qos_resume_latency_us under the device's power directory allowing user space to manipulate that request.h]hAdd a request to the device’s PM QoS list of resume latency constraints and create a sysfs attribute pm_qos_resume_latency_us under the device’s power directory allowing user space to manipulate that request.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj;ubah}(h]h ]h"]h$]h&]uh1hhj)ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj;hhubh)}(hvoid dev_pm_qos_hide_latency_limit(device) Drop the request added by dev_pm_qos_expose_latency_limit() from the device's PM QoS list of resume latency constraints and remove sysfs attribute pm_qos_resume_latency_us from the device's power directory. h](h)}(h*void dev_pm_qos_hide_latency_limit(device)h]h*void dev_pm_qos_hide_latency_limit(device)}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjXubh)}(hhh]h)}(hDrop the request added by dev_pm_qos_expose_latency_limit() from the device's PM QoS list of resume latency constraints and remove sysfs attribute pm_qos_resume_latency_us from the device's power directory.h]hDrop the request added by dev_pm_qos_expose_latency_limit() from the device’s PM QoS list of resume latency constraints and remove sysfs attribute pm_qos_resume_latency_us from the device’s power directory.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjubah}(h]h ]h"]h$]h&]uh1hhjXubeh}(h]h ]h"]h$]h&]uh1hhhhKhj;hhubh)}(hint dev_pm_qos_expose_flags(device, value) Add a request to the device's PM QoS list of flags and create sysfs attribute pm_qos_no_power_off under the device's power directory allowing user space to change the value of the PM_QOS_FLAG_NO_POWER_OFF flag. h](h)}(h*int dev_pm_qos_expose_flags(device, value)h]h*int dev_pm_qos_expose_flags(device, value)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hAdd a request to the device's PM QoS list of flags and create sysfs attribute pm_qos_no_power_off under the device's power directory allowing user space to change the value of the PM_QOS_FLAG_NO_POWER_OFF flag.h]hAdd a request to the device’s PM QoS list of flags and create sysfs attribute pm_qos_no_power_off under the device’s power directory allowing user space to change the value of the PM_QOS_FLAG_NO_POWER_OFF flag.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj;hhubh)}(hvoid dev_pm_qos_hide_flags(device) Drop the request added by dev_pm_qos_expose_flags() from the device's PM QoS list of flags and remove sysfs attribute pm_qos_no_power_off from the device's power directory. h](h)}(h"void dev_pm_qos_hide_flags(device)h]h"void dev_pm_qos_hide_flags(device)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hDrop the request added by dev_pm_qos_expose_flags() from the device's PM QoS list of flags and remove sysfs attribute pm_qos_no_power_off from the device's power directory.h]hDrop the request added by dev_pm_qos_expose_flags() from the device’s PM QoS list of flags and remove sysfs attribute pm_qos_no_power_off from the device’s power directory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhj;hhubeh}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hNotification mechanisms:h]hNotification mechanisms:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hCThe per-device PM QoS framework has a per-device notification tree.h]hCThe per-device PM QoS framework has a per-device notification tree.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hint dev_pm_qos_add_notifier(device, notifier, type): Adds a notification callback function for the device for a particular request type. The callback is called when the aggregated value of the device constraints list is changed. h](h)}(h4int dev_pm_qos_add_notifier(device, notifier, type):h]h4int dev_pm_qos_add_notifier(device, notifier, type):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hhh](h)}(hSAdds a notification callback function for the device for a particular request type.h]hSAdds a notification callback function for the device for a particular request type.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h[The callback is called when the aggregated value of the device constraints list is changed.h]h[The callback is called when the aggregated value of the device constraints list is changed.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(htint dev_pm_qos_remove_notifier(device, notifier, type): Removes the notification callback function for the device. h](h)}(h7int dev_pm_qos_remove_notifier(device, notifier, type):h]h7int dev_pm_qos_remove_notifier(device, notifier, type):}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjGubh)}(hhh]h)}(h:Removes the notification callback function for the device.h]h:Removes the notification callback function for the device.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjYubah}(h]h ]h"]h$]h&]uh1hhjGubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hhh](h)}(hActive state latency toleranceh]hActive state latency tolerance}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|hhhhhKubh)}(hXThis device PM QoS type is used to support systems in which hardware may switch to energy-saving operation modes on the fly. In those systems, if the operation mode chosen by the hardware attempts to save energy in an overly aggressive way, it may cause excess latencies to be visible to software, causing it to miss certain protocol requirements or target frame or sample rates etc.h]hXThis device PM QoS type is used to support systems in which hardware may switch to energy-saving operation modes on the fly. In those systems, if the operation mode chosen by the hardware attempts to save energy in an overly aggressive way, it may cause excess latencies to be visible to software, causing it to miss certain protocol requirements or target frame or sample rates etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubh)}(hX@If there is a latency tolerance control mechanism for a given device available to software, the .set_latency_tolerance callback in that device's dev_pm_info structure should be populated. The routine pointed to by it is should implement whatever is necessary to transfer the effective requirement value to the hardware.h]hXBIf there is a latency tolerance control mechanism for a given device available to software, the .set_latency_tolerance callback in that device’s dev_pm_info structure should be populated. The routine pointed to by it is should implement whatever is necessary to transfer the effective requirement value to the hardware.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubh)}(hX5Whenever the effective latency tolerance changes for the device, its .set_latency_tolerance() callback will be executed and the effective value will be passed to it. If that value is negative, which means that the list of latency tolerance requirements for the device is empty, the callback is expected to switch the underlying hardware latency tolerance control mechanism to an autonomous mode if available. If that value is PM_QOS_LATENCY_ANY, in turn, and the hardware supports a special "no requirement" setting, the callback is expected to use it. That allows software to prevent the hardware from automatically updating the device's latency tolerance in response to its power state changes (e.g. during transitions from D3cold to D0), which generally may be done in the autonomous latency tolerance control mode.h]hX;Whenever the effective latency tolerance changes for the device, its .set_latency_tolerance() callback will be executed and the effective value will be passed to it. If that value is negative, which means that the list of latency tolerance requirements for the device is empty, the callback is expected to switch the underlying hardware latency tolerance control mechanism to an autonomous mode if available. If that value is PM_QOS_LATENCY_ANY, in turn, and the hardware supports a special “no requirement” setting, the callback is expected to use it. That allows software to prevent the hardware from automatically updating the device’s latency tolerance in response to its power state changes (e.g. during transitions from D3cold to D0), which generally may be done in the autonomous latency tolerance control mode.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubh)}(hXIf .set_latency_tolerance() is present for the device, sysfs attribute pm_qos_latency_tolerance_us will be present in the devivce's power directory. Then, user space can use that attribute to specify its latency tolerance requirement for the device, if any. Writing "any" to it means "no requirement, but do not let the hardware control latency tolerance" and writing "auto" to it allows the hardware to be switched to the autonomous mode if there are no other requirements from the kernel side in the device's list.h]hXIf .set_latency_tolerance() is present for the device, sysfs attribute pm_qos_latency_tolerance_us will be present in the devivce’s power directory. Then, user space can use that attribute to specify its latency tolerance requirement for the device, if any. Writing “any” to it means “no requirement, but do not let the hardware control latency tolerance” and writing “auto” to it allows the hardware to be switched to the autonomous mode if there are no other requirements from the kernel side in the device’s list.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubh)}(hKernel code can use the functions described above along with the DEV_PM_QOS_LATENCY_TOLERANCE device PM QoS type to add, remove and update latency tolerance requirements for devices.h]hKernel code can use the functions described above along with the DEV_PM_QOS_LATENCY_TOLERANCE device PM QoS type to add, remove and update latency tolerance requirements for devices.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubeh}(h]active-state-latency-toleranceah ]h"]active state latency toleranceah$]h&]uh1hhjhhhhhKubeh}(h]-pm-qos-per-device-latency-and-flags-frameworkah ]h"]02. pm qos per-device latency and flags frameworkah$]h&]uh1hhhhhhhhKRubeh}(h]pm-quality-of-service-interfaceah ]h"]pm quality of service interfaceah$]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_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehʌ _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}(jjjjjjjju nametypes}(jjjjuh}(jhjjYjjjj|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.