sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget0/translations/zh_CN/admin-guide/pm/suspend-flowsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/zh_TW/admin-guide/pm/suspend-flowsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/it_IT/admin-guide/pm/suspend-flowsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ja_JP/admin-guide/pm/suspend-flowsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ko_KR/admin-guide/pm/suspend-flowsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/pt_BR/admin-guide/pm/suspend-flowsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/sp_SP/admin-guide/pm/suspend-flowsmodnameN 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:spacepreserveuh1hhhhhhJ/var/lib/git/docbuild/linux/Documentation/admin-guide/pm/suspend-flows.rsthKubh)}(h4This data file has been placed in the public domain.h]h4This data file has been placed in the public domain.}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhho/srv/docbuild/lib/venvs/build-kernel-docs/lib64/python3.9/site-packages/docutils/parsers/rst/include/isonum.txthKubh)}(hDerived from the Unicode character mappings available from . Processed by unicode2rstsubs.py, part of Docutils: .h]hDerived from the Unicode character mappings available from . Processed by unicode2rstsubs.py, part of Docutils: .}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhKubhsubstitution_definition)}(h*.. |amp| unicode:: U+00026 .. AMPERSANDh]h&}hhsbah}(h]h ]h"]ampah$]h&]uh1hhhhKhhhhubh)}(h+.. |apos| unicode:: U+00027 .. APOSTROPHEh]h'}hhsbah}(h]h ]h"]aposah$]h&]uh1hhhhKhhhhubh)}(h).. |ast| unicode:: U+0002A .. ASTERISKh]h*}hjsbah}(h]h ]h"]astah$]h&]uh1hhhhK hhhhubh)}(h+.. |brvbar| unicode:: U+000A6 .. BROKEN BARh]h¦}hjsbah}(h]h ]h"]brvbarah$]h&]uh1hhhhK hhhhubh)}(h0.. |bsol| unicode:: U+0005C .. REVERSE SOLIDUSh]h\}hj#sbah}(h]h ]h"]bsolah$]h&]uh1hhhhK hhhhubh)}(h*.. |cent| unicode:: U+000A2 .. CENT SIGNh]h¢}hj2sbah}(h]h ]h"]centah$]h&]uh1hhhhK hhhhubh)}(h&.. |colon| unicode:: U+0003A .. COLONh]h:}hjAsbah}(h]h ]h"]colonah$]h&]uh1hhhhK hhhhubh)}(h&.. |comma| unicode:: U+0002C .. COMMAh]h,}hjPsbah}(h]h ]h"]commaah$]h&]uh1hhhhKhhhhubh)}(h... |commat| unicode:: U+00040 .. COMMERCIAL ATh]h@}hj_sbah}(h]h ]h"]commatah$]h&]uh1hhhhKhhhhubh)}(h/.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGNh]h©}hjnsbah}(h]h ]h"]copyah$]h&]uh1hhhhKhhhhubh)}(h... |curren| unicode:: U+000A4 .. CURRENCY SIGNh]h¤}hj}sbah}(h]h ]h"]currenah$]h&]uh1hhhhKhhhhubh)}(h0.. |darr| unicode:: U+02193 .. DOWNWARDS ARROWh]h↓}hjsbah}(h]h ]h"]darrah$]h&]uh1hhhhKhhhhubh)}(h,.. |deg| unicode:: U+000B0 .. DEGREE SIGNh]h°}hjsbah}(h]h ]h"]degah$]h&]uh1hhhhKhhhhubh)}(h... |divide| unicode:: U+000F7 .. DIVISION SIGNh]h÷}hjsbah}(h]h ]h"]divideah$]h&]uh1hhhhKhhhhubh)}(h,.. |dollar| unicode:: U+00024 .. DOLLAR SIGNh]h$}hjsbah}(h]h ]h"]dollarah$]h&]uh1hhhhKhhhhubh)}(h,.. |equals| unicode:: U+0003D .. EQUALS SIGNh]h=}hjsbah}(h]h ]h"]equalsah$]h&]uh1hhhhKhhhhubh)}(h1.. |excl| unicode:: U+00021 .. EXCLAMATION MARKh]h!}hjsbah}(h]h ]h"]exclah$]h&]uh1hhhhKhhhhubh)}(h9.. |frac12| unicode:: U+000BD .. VULGAR FRACTION ONE HALFh]h½}hjsbah}(h]h ]h"]frac12ah$]h&]uh1hhhhKhhhhubh)}(h<.. |frac14| unicode:: U+000BC .. VULGAR FRACTION ONE QUARTERh]h¼}hjsbah}(h]h ]h"]frac14ah$]h&]uh1hhhhKhhhhubh)}(h;.. |frac18| unicode:: U+0215B .. VULGAR FRACTION ONE EIGHTHh]h⅛}hjsbah}(h]h ]h"]frac18ah$]h&]uh1hhhhKhhhhubh)}(h?.. |frac34| unicode:: U+000BE .. VULGAR FRACTION THREE QUARTERSh]h¾}hjsbah}(h]h ]h"]frac34ah$]h&]uh1hhhhKhhhhubh)}(h>.. |frac38| unicode:: U+0215C .. VULGAR FRACTION THREE EIGHTHSh]h⅜}hj"sbah}(h]h ]h"]frac38ah$]h&]uh1hhhhKhhhhubh)}(h=.. |frac58| unicode:: U+0215D .. VULGAR FRACTION FIVE EIGHTHSh]h⅝}hj1sbah}(h]h ]h"]frac58ah$]h&]uh1hhhhKhhhhubh)}(h>.. |frac78| unicode:: U+0215E .. VULGAR FRACTION SEVEN EIGHTHSh]h⅞}hj@sbah}(h]h ]h"]frac78ah$]h&]uh1hhhhKhhhhubh)}(h2.. |gt| unicode:: U+0003E .. GREATER-THAN SIGNh]h>}hjOsbah}(h]h ]h"]gtah$]h&]uh1hhhhKhhhhubh)}(h9.. |half| unicode:: U+000BD .. VULGAR FRACTION ONE HALFh]h½}hj^sbah}(h]h ]h"]halfah$]h&]uh1hhhhK hhhhubh)}(h/.. |horbar| unicode:: U+02015 .. HORIZONTAL BARh]h―}hjmsbah}(h]h ]h"]horbarah$]h&]uh1hhhhK!hhhhubh)}(h'.. |hyphen| unicode:: U+02010 .. HYPHENh]h‐}hj|sbah}(h]h ]h"]hyphenah$]h&]uh1hhhhK"hhhhubh)}(h:.. |iexcl| unicode:: U+000A1 .. INVERTED EXCLAMATION MARKh]h¡}hjsbah}(h]h ]h"]iexclah$]h&]uh1hhhhK#hhhhubh)}(h7.. |iquest| unicode:: U+000BF .. INVERTED QUESTION MARKh]h¿}hjsbah}(h]h ]h"]iquestah$]h&]uh1hhhhK$hhhhubh)}(hJ.. |laquo| unicode:: U+000AB .. LEFT-POINTING DOUBLE ANGLE QUOTATION MARKh]h«}hjsbah}(h]h ]h"]laquoah$]h&]uh1hhhhK%hhhhubh)}(h0.. |larr| unicode:: U+02190 .. LEFTWARDS ARROWh]h←}hjsbah}(h]h ]h"]larrah$]h&]uh1hhhhK&hhhhubh)}(h3.. |lcub| unicode:: U+0007B .. LEFT CURLY BRACKETh]h{}hjsbah}(h]h ]h"]lcubah$]h&]uh1hhhhK'hhhhubh)}(h;.. |ldquo| unicode:: U+0201C .. LEFT DOUBLE QUOTATION MARKh]h“}hjsbah}(h]h ]h"]ldquoah$]h&]uh1hhhhK(hhhhubh)}(h).. |lowbar| unicode:: U+0005F .. LOW LINEh]h_}hjsbah}(h]h ]h"]lowbarah$]h&]uh1hhhhK)hhhhubh)}(h1.. |lpar| unicode:: U+00028 .. LEFT PARENTHESISh]h(}hjsbah}(h]h ]h"]lparah$]h&]uh1hhhhK*hhhhubh)}(h4.. |lsqb| unicode:: U+0005B .. LEFT SQUARE BRACKETh]h[}hjsbah}(h]h ]h"]lsqbah$]h&]uh1hhhhK+hhhhubh)}(h;.. |lsquo| unicode:: U+02018 .. LEFT SINGLE QUOTATION MARKh]h‘}hjsbah}(h]h ]h"]lsquoah$]h&]uh1hhhhK,hhhhubh)}(h/.. |lt| unicode:: U+0003C .. LESS-THAN SIGNh]h<}hj!sbah}(h]h ]h"]ltah$]h&]uh1hhhhK-hhhhubh)}(h+.. |micro| unicode:: U+000B5 .. MICRO SIGNh]hµ}hj0sbah}(h]h ]h"]microah$]h&]uh1hhhhK.hhhhubh)}(h+.. |middot| unicode:: U+000B7 .. MIDDLE DOTh]h·}hj?sbah}(h]h ]h"]middotah$]h&]uh1hhhhK/hhhhubh)}(h/.. |nbsp| unicode:: U+000A0 .. NO-BREAK SPACEh]h }hjNsbah}(h]h ]h"]nbspah$]h&]uh1hhhhK0hhhhubh)}(h).. |not| unicode:: U+000AC .. NOT SIGNh]h¬}hj]sbah}(h]h ]h"]notah$]h&]uh1hhhhK1hhhhubh)}(h,.. |num| unicode:: U+00023 .. NUMBER SIGNh]h#}hjlsbah}(h]h ]h"]numah$]h&]uh1hhhhK2hhhhubh)}(h).. |ohm| unicode:: U+02126 .. OHM SIGNh]hΩ}hj{sbah}(h]h ]h"]ohmah$]h&]uh1hhhhK3hhhhubh)}(h;.. |ordf| unicode:: U+000AA .. FEMININE ORDINAL INDICATORh]hª}hjsbah}(h]h ]h"]ordfah$]h&]uh1hhhhK4hhhhubh)}(h<.. |ordm| unicode:: U+000BA .. MASCULINE ORDINAL INDICATORh]hº}hjsbah}(h]h ]h"]ordmah$]h&]uh1hhhhK5hhhhubh)}(h-.. |para| unicode:: U+000B6 .. PILCROW SIGNh]h¶}hjsbah}(h]h ]h"]paraah$]h&]uh1hhhhK6hhhhubh)}(h-.. |percnt| unicode:: U+00025 .. PERCENT SIGNh]h%}hjsbah}(h]h ]h"]percntah$]h&]uh1hhhhK7hhhhubh)}(h*.. |period| unicode:: U+0002E .. FULL STOPh]h.}hjsbah}(h]h ]h"]periodah$]h&]uh1hhhhK8hhhhubh)}(h*.. |plus| unicode:: U+0002B .. PLUS SIGNh]h+}hjsbah}(h]h ]h"]plusah$]h&]uh1hhhhK9hhhhubh)}(h0.. |plusmn| unicode:: U+000B1 .. PLUS-MINUS SIGNh]h±}hjsbah}(h]h ]h"]plusmnah$]h&]uh1hhhhK:hhhhubh)}(h+.. |pound| unicode:: U+000A3 .. POUND SIGNh]h£}hjsbah}(h]h ]h"]poundah$]h&]uh1hhhhK;hhhhubh)}(h... |quest| unicode:: U+0003F .. QUESTION MARKh]h?}hjsbah}(h]h ]h"]questah$]h&]uh1hhhhKhhhhubh)}(h1.. |rarr| unicode:: U+02192 .. RIGHTWARDS ARROWh]h→}hj/sbah}(h]h ]h"]rarrah$]h&]uh1hhhhK?hhhhubh)}(h4.. |rcub| unicode:: U+0007D .. RIGHT CURLY BRACKETh]h}}hj>sbah}(h]h ]h"]rcubah$]h&]uh1hhhhK@hhhhubh)}(h<.. |rdquo| unicode:: U+0201D .. RIGHT DOUBLE QUOTATION MARKh]h”}hjMsbah}(h]h ]h"]rdquoah$]h&]uh1hhhhKAhhhhubh)}(h0.. |reg| unicode:: U+000AE .. REGISTERED SIGNh]h®}hj\sbah}(h]h ]h"]regah$]h&]uh1hhhhKBhhhhubh)}(h2.. |rpar| unicode:: U+00029 .. RIGHT PARENTHESISh]h)}hjksbah}(h]h ]h"]rparah$]h&]uh1hhhhKChhhhubh)}(h5.. |rsqb| unicode:: U+0005D .. RIGHT SQUARE BRACKETh]h]}hjzsbah}(h]h ]h"]rsqbah$]h&]uh1hhhhKDhhhhubh)}(h<.. |rsquo| unicode:: U+02019 .. RIGHT SINGLE QUOTATION MARKh]h’}hjsbah}(h]h ]h"]rsquoah$]h&]uh1hhhhKEhhhhubh)}(h-.. |sect| unicode:: U+000A7 .. SECTION SIGNh]h§}hjsbah}(h]h ]h"]sectah$]h&]uh1hhhhKFhhhhubh)}(h*.. |semi| unicode:: U+0003B .. SEMICOLONh]h;}hjsbah}(h]h ]h"]semiah$]h&]uh1hhhhKGhhhhubh)}(h,.. |shy| unicode:: U+000AD .. SOFT HYPHENh]h­}hjsbah}(h]h ]h"]shyah$]h&]uh1hhhhKHhhhhubh)}(h(.. |sol| unicode:: U+0002F .. SOLIDUSh]h/}hjsbah}(h]h ]h"]solah$]h&]uh1hhhhKIhhhhubh)}(h,.. |sung| unicode:: U+0266A .. EIGHTH NOTEh]h♪}hjsbah}(h]h ]h"]sungah$]h&]uh1hhhhKJhhhhubh)}(h0.. |sup1| unicode:: U+000B9 .. SUPERSCRIPT ONEh]h¹}hjsbah}(h]h ]h"]sup1ah$]h&]uh1hhhhKKhhhhubh)}(h0.. |sup2| unicode:: U+000B2 .. SUPERSCRIPT TWOh]h²}hjsbah}(h]h ]h"]sup2ah$]h&]uh1hhhhKLhhhhubh)}(h2.. |sup3| unicode:: U+000B3 .. SUPERSCRIPT THREEh]h³}hjsbah}(h]h ]h"]sup3ah$]h&]uh1hhhhKMhhhhubh)}(h4.. |times| unicode:: U+000D7 .. MULTIPLICATION SIGNh]h×}hjsbah}(h]h ]h"]timesah$]h&]uh1hhhhKNhhhhubh)}(h0.. |trade| unicode:: U+02122 .. TRADE MARK SIGNh]h™}hjsbah}(h]h ]h"]tradeah$]h&]uh1hhhhKOhhhhubh)}(h... |uarr| unicode:: U+02191 .. UPWARDS ARROWh]h↑}hj.sbah}(h]h ]h"]uarrah$]h&]uh1hhhhKPhhhhubh)}(h... |verbar| unicode:: U+0007C .. VERTICAL LINEh]h|}hj=sbah}(h]h ]h"]verbarah$]h&]uh1hhhhKQhhhhubh)}(h*.. |yen| unicode:: U+000A5 .. YEN SIGN h]h¥}hjLsbah}(h]h ]h"]yenah$]h&]uh1hhhhKRhhhhubhsection)}(hhh](htitle)}(hSystem Suspend Code Flowsh]hSystem Suspend Code Flows}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1j`hj]hhhhhKubh field_list)}(hhh](hfield)}(hhh](h field_name)}(h Copyrighth]h Copyright}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jzhjwhhhKubh field_body)}(h|copy| 2020 Intel Corporation h]h paragraph)}(h|copy| 2020 Intel Corporationh](h©}(hjhhhNhNubh 2020 Intel Corporation}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubeh}(h]h ]h"]h$]h&]uh1juhhhKhjrhhubjv)}(hhh](j{)}(hAuthorh]hAuthor}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jzhjhhhKubj)}(h/Rafael J. Wysocki h]j)}(h.Rafael J. Wysocki h](hRafael J. Wysocki <}(hjhhhNhNubh reference)}(hrafael.j.wysocki@intel.comh]hrafael.j.wysocki@intel.com}(hjhhhNhNubah}(h]h ]h"]h$]h&]refuri!mailto:rafael.j.wysocki@intel.comuh1jhjubh>}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhK hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1juhhhK hjrhhubeh}(h]h ]h"]h$]h&]uh1jphj]hhhhhKubj)}(hXuAt least one global system-wide transition needs to be carried out for the system to get from the working state into one of the supported :doc:`sleep states `. Hibernation requires more than one transition to occur for this purpose, but the other sleep states, commonly referred to as *system-wide suspend* (or simply *system suspend*) states, need only one.h](hAt least one global system-wide transition needs to be carried out for the system to get from the working state into one of the supported }(hjhhhNhNubh)}(h":doc:`sleep states `h]hinline)}(hjh]h sleep states}(hj hhhNhNubah}(h]h ](xrefstdstd-doceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocadmin-guide/pm/suspend-flows refdomainjreftypedoc refexplicitrefwarn reftarget sleep-statesuh1hhhhK hjubh. Hibernation requires more than one transition to occur for this purpose, but the other sleep states, commonly referred to as }(hjhhhNhNubhemphasis)}(h*system-wide suspend*h]hsystem-wide suspend}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh (or simply }(hjhhhNhNubj-)}(h*system suspend*h]hsystem suspend}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh) states, need only one.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhK hj]hhubj)}(hXqFor those sleep states, the transition from the working state of the system into the target sleep state is referred to as *system suspend* too (in the majority of cases, whether this means a transition or a sleep state of the system should be clear from the context) and the transition back from the sleep state into the working state is referred to as *system resume*.h](hzFor those sleep states, the transition from the working state of the system into the target sleep state is referred to as }(hjXhhhNhNubj-)}(h*system suspend*h]hsystem suspend}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjXubh too (in the majority of cases, whether this means a transition or a sleep state of the system should be clear from the context) and the transition back from the sleep state into the working state is referred to as }(hjXhhhNhNubj-)}(h*system resume*h]h system resume}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjXubh.}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj]hhubj)}(hXQThe kernel code flows associated with the suspend and resume transitions for different sleep states of the system are quite similar, but there are some significant differences between the :ref:`suspend-to-idle ` code flows and the code flows related to the :ref:`suspend-to-RAM ` and :ref:`standby ` sleep states.h](hThe kernel code flows associated with the suspend and resume transitions for different sleep states of the system are quite similar, but there are some significant differences between the }(hjhhhNhNubh)}(h:ref:`suspend-to-idle `h]j)}(hjh]hsuspend-to-idle}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj  refdomainjreftyperef refexplicitrefwarnj&s2idleuh1hhhhKhjubh. code flows and the code flows related to the }(hjhhhNhNubh)}(h:ref:`suspend-to-RAM `h]j)}(hjh]hsuspend-to-RAM}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj  refdomainjreftyperef refexplicitrefwarnj&s2ramuh1hhhhKhjubh and }(hjhhhNhNubh)}(h:ref:`standby `h]j)}(hjh]hstandby}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj  refdomainjreftyperef refexplicitrefwarnj&standbyuh1hhhhKhjubh sleep states.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj]hhubj)}(hXThe :ref:`suspend-to-RAM ` and :ref:`standby ` sleep states cannot be implemented without platform support and the difference between them boils down to the platform-specific actions carried out by the suspend and resume hooks that need to be provided by the platform driver to make them available. Apart from that, the suspend and resume code flows for these sleep states are mostly identical, so they both together will be referred to as *platform-dependent suspend* states in what follows.h](hThe }(hjhhhNhNubh)}(h:ref:`suspend-to-RAM `h]j)}(hjh]hsuspend-to-RAM}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj  refdomainjreftyperef refexplicitrefwarnj&s2ramuh1hhhhKhjubh and }(hjhhhNhNubh)}(h:ref:`standby `h]j)}(hj2h]hstandby}(hj4hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]refdocj  refdomainj>reftyperef refexplicitrefwarnj&standbyuh1hhhhKhjubhX sleep states cannot be implemented without platform support and the difference between them boils down to the platform-specific actions carried out by the suspend and resume hooks that need to be provided by the platform driver to make them available. Apart from that, the suspend and resume code flows for these sleep states are mostly identical, so they both together will be referred to as }(hjhhhNhNubj-)}(h*platform-dependent suspend*h]hplatform-dependent suspend}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh states in what follows.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj]hhubhtarget)}(h.. _s2idle_suspend:h]h}(h]h ]h"]h$]h&]refids2idle-suspenduh1jlhK~hj]hhhhnj referencedKubj\)}(hhh](ja)}(h!Suspend-to-idle Suspend Code Flowh]h!Suspend-to-idle Suspend Code Flow}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1j`hj{hhhhhK+ubj)}(hThe following steps are taken in order to transition the system from the working state to the :ref:`suspend-to-idle ` sleep state:h](h^The following steps are taken in order to transition the system from the working state to the }(hjhhhNhNubh)}(h:ref:`suspend-to-idle `h]j)}(hjh]hsuspend-to-idle}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj  refdomainjreftyperef refexplicitrefwarnj&s2idleuh1hhhhK-hjubh sleep state:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhK-hj{hhubh block_quote)}(hX 1. Invoking system-wide suspend notifiers. Kernel subsystems can register callbacks to be invoked when the suspend transition is about to occur and when the resume transition has finished. That allows them to prepare for the change of the system state and to clean up after getting back to the working state. 2. Freezing tasks. Tasks are frozen primarily in order to avoid unchecked hardware accesses from user space through MMIO regions or I/O registers exposed directly to it and to prevent user space from entering the kernel while the next step of the transition is in progress (which might have been problematic for various reasons). All user space tasks are intercepted as though they were sent a signal and put into uninterruptible sleep until the end of the subsequent system resume transition. The kernel threads that choose to be frozen during system suspend for specific reasons are frozen subsequently, but they are not intercepted. Instead, they are expected to periodically check whether or not they need to be frozen and to put themselves into uninterruptible sleep if so. [Note, however, that kernel threads can use locking and other concurrency controls available in kernel space to synchronize themselves with system suspend and resume, which can be much more precise than the freezing, so the latter is not a recommended option for kernel threads.] 3. Suspending devices and reconfiguring IRQs. Devices are suspended in four phases called *prepare*, *suspend*, *late suspend* and *noirq suspend* (see :ref:`driverapi_pm_devices` for more information on what exactly happens in each phase). Every device is visited in each phase, but typically it is not physically accessed in more than two of them. The runtime PM API is disabled for every device during the *late* suspend phase and high-level ("action") interrupt handlers are prevented from being invoked before the *noirq* suspend phase. Interrupts are still handled after that, but they are only acknowledged to interrupt controllers without performing any device-specific actions that would be triggered in the working state of the system (those actions are deferred till the subsequent system resume transition as described `below `_). IRQs associated with system wakeup devices are "armed" so that the resume transition of the system is started when one of them signals an event. 4. Freezing the scheduler tick and suspending timekeeping. When all devices have been suspended, CPUs enter the idle loop and are put into the deepest available idle state. While doing that, each of them "freezes" its own scheduler tick so that the timer events associated with the tick do not occur until the CPU is woken up by another interrupt source. The last CPU to enter the idle state also stops the timekeeping which (among other things) prevents high resolution timers from triggering going forward until the first CPU that is woken up restarts the timekeeping. That allows the CPUs to stay in the deep idle state relatively long in one go. From this point on, the CPUs can only be woken up by non-timer hardware interrupts. If that happens, they go back to the idle state unless the interrupt that woke up one of them comes from an IRQ that has been armed for system wakeup, in which case the system resume transition is started. h]henumerated_list)}(hhh](h list_item)}(hX4Invoking system-wide suspend notifiers. Kernel subsystems can register callbacks to be invoked when the suspend transition is about to occur and when the resume transition has finished. That allows them to prepare for the change of the system state and to clean up after getting back to the working state. h](j)}(h'Invoking system-wide suspend notifiers.h]h'Invoking system-wide suspend notifiers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK0hjubj)}(hKernel subsystems can register callbacks to be invoked when the suspend transition is about to occur and when the resume transition has finished.h]hKernel subsystems can register callbacks to be invoked when the suspend transition is about to occur and when the resume transition has finished.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK2hjubj)}(hwThat allows them to prepare for the change of the system state and to clean up after getting back to the working state.h]hwThat allows them to prepare for the change of the system state and to clean up after getting back to the working state.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK5hjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hX$Freezing tasks. Tasks are frozen primarily in order to avoid unchecked hardware accesses from user space through MMIO regions or I/O registers exposed directly to it and to prevent user space from entering the kernel while the next step of the transition is in progress (which might have been problematic for various reasons). All user space tasks are intercepted as though they were sent a signal and put into uninterruptible sleep until the end of the subsequent system resume transition. The kernel threads that choose to be frozen during system suspend for specific reasons are frozen subsequently, but they are not intercepted. Instead, they are expected to periodically check whether or not they need to be frozen and to put themselves into uninterruptible sleep if so. [Note, however, that kernel threads can use locking and other concurrency controls available in kernel space to synchronize themselves with system suspend and resume, which can be much more precise than the freezing, so the latter is not a recommended option for kernel threads.] h](j)}(hFreezing tasks.h]hFreezing tasks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK8hjubj)}(hX6Tasks are frozen primarily in order to avoid unchecked hardware accesses from user space through MMIO regions or I/O registers exposed directly to it and to prevent user space from entering the kernel while the next step of the transition is in progress (which might have been problematic for various reasons).h]hX6Tasks are frozen primarily in order to avoid unchecked hardware accesses from user space through MMIO regions or I/O registers exposed directly to it and to prevent user space from entering the kernel while the next step of the transition is in progress (which might have been problematic for various reasons).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK:hjubj)}(hAll user space tasks are intercepted as though they were sent a signal and put into uninterruptible sleep until the end of the subsequent system resume transition.h]hAll user space tasks are intercepted as though they were sent a signal and put into uninterruptible sleep until the end of the subsequent system resume transition.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK@hjubj)}(hX5The kernel threads that choose to be frozen during system suspend for specific reasons are frozen subsequently, but they are not intercepted. Instead, they are expected to periodically check whether or not they need to be frozen and to put themselves into uninterruptible sleep if so. [Note, however, that kernel threads can use locking and other concurrency controls available in kernel space to synchronize themselves with system suspend and resume, which can be much more precise than the freezing, so the latter is not a recommended option for kernel threads.]h]hX5The kernel threads that choose to be frozen during system suspend for specific reasons are frozen subsequently, but they are not intercepted. Instead, they are expected to periodically check whether or not they need to be frozen and to put themselves into uninterruptible sleep if so. [Note, however, that kernel threads can use locking and other concurrency controls available in kernel space to synchronize themselves with system suspend and resume, which can be much more precise than the freezing, so the latter is not a recommended option for kernel threads.]}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKDhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hXSuspending devices and reconfiguring IRQs. Devices are suspended in four phases called *prepare*, *suspend*, *late suspend* and *noirq suspend* (see :ref:`driverapi_pm_devices` for more information on what exactly happens in each phase). Every device is visited in each phase, but typically it is not physically accessed in more than two of them. The runtime PM API is disabled for every device during the *late* suspend phase and high-level ("action") interrupt handlers are prevented from being invoked before the *noirq* suspend phase. Interrupts are still handled after that, but they are only acknowledged to interrupt controllers without performing any device-specific actions that would be triggered in the working state of the system (those actions are deferred till the subsequent system resume transition as described `below `_). IRQs associated with system wakeup devices are "armed" so that the resume transition of the system is started when one of them signals an event. h](j)}(h*Suspending devices and reconfiguring IRQs.h]h*Suspending devices and reconfiguring IRQs.}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKMhjAubj)}(hDevices are suspended in four phases called *prepare*, *suspend*, *late suspend* and *noirq suspend* (see :ref:`driverapi_pm_devices` for more information on what exactly happens in each phase).h](h,Devices are suspended in four phases called }(hjShhhNhNubj-)}(h *prepare*h]hprepare}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjSubh, }(hjShhhNhNubj-)}(h *suspend*h]hsuspend}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjSubh, }(hjShhhNhNubj-)}(h*late suspend*h]h late suspend}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjSubh and }(hjShhhNhNubj-)}(h*noirq suspend*h]h noirq suspend}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjSubh (see }(hjShhhNhNubh)}(h:ref:`driverapi_pm_devices`h]j)}(hjh]hdriverapi_pm_devices}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj  refdomainjreftyperef refexplicitrefwarnj&driverapi_pm_devicesuh1hhhhKOhjSubh= for more information on what exactly happens in each phase).}(hjShhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKOhjAubj)}(hlEvery device is visited in each phase, but typically it is not physically accessed in more than two of them.h]hlEvery device is visited in each phase, but typically it is not physically accessed in more than two of them.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKShjAubj)}(hThe runtime PM API is disabled for every device during the *late* suspend phase and high-level ("action") interrupt handlers are prevented from being invoked before the *noirq* suspend phase.h](h;The runtime PM API is disabled for every device during the }(hjhhhNhNubj-)}(h*late*h]hlate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhl suspend phase and high-level (“action”) interrupt handlers are prevented from being invoked before the }(hjhhhNhNubj-)}(h*noirq*h]hnoirq}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh suspend phase.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKVhjAubj)}(hX<Interrupts are still handled after that, but they are only acknowledged to interrupt controllers without performing any device-specific actions that would be triggered in the working state of the system (those actions are deferred till the subsequent system resume transition as described `below `_).h](hX!Interrupts are still handled after that, but they are only acknowledged to interrupt controllers without performing any device-specific actions that would be triggered in the working state of the system (those actions are deferred till the subsequent system resume transition as described }(hj hhhNhNubj)}(h`below `_h]hbelow}(hj hhhNhNubah}(h]h ]h"]h$]h&]namebelowjx s2idle-resumeuh1jhj resolvedKubjm)}(h h]h}(h]h ]h"]belowah$]h&]jxj% uh1jlindirect_reference_name s2idle_resumehj j& Kubh).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKZhjAubj)}(hIRQs associated with system wakeup devices are "armed" so that the resume transition of the system is started when one of them signals an event.h]hIRQs associated with system wakeup devices are “armed” so that the resume transition of the system is started when one of them signals an event.}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK`hjAubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hXFreezing the scheduler tick and suspending timekeeping. When all devices have been suspended, CPUs enter the idle loop and are put into the deepest available idle state. While doing that, each of them "freezes" its own scheduler tick so that the timer events associated with the tick do not occur until the CPU is woken up by another interrupt source. The last CPU to enter the idle state also stops the timekeeping which (among other things) prevents high resolution timers from triggering going forward until the first CPU that is woken up restarts the timekeeping. That allows the CPUs to stay in the deep idle state relatively long in one go. From this point on, the CPUs can only be woken up by non-timer hardware interrupts. If that happens, they go back to the idle state unless the interrupt that woke up one of them comes from an IRQ that has been armed for system wakeup, in which case the system resume transition is started. h](j)}(h7Freezing the scheduler tick and suspending timekeeping.h]h7Freezing the scheduler tick and suspending timekeeping.}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKchjR ubj)}(hX(When all devices have been suspended, CPUs enter the idle loop and are put into the deepest available idle state. While doing that, each of them "freezes" its own scheduler tick so that the timer events associated with the tick do not occur until the CPU is woken up by another interrupt source.h]hX,When all devices have been suspended, CPUs enter the idle loop and are put into the deepest available idle state. While doing that, each of them “freezes” its own scheduler tick so that the timer events associated with the tick do not occur until the CPU is woken up by another interrupt source.}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKehjR ubj)}(hX&The last CPU to enter the idle state also stops the timekeeping which (among other things) prevents high resolution timers from triggering going forward until the first CPU that is woken up restarts the timekeeping. That allows the CPUs to stay in the deep idle state relatively long in one go.h]hX&The last CPU to enter the idle state also stops the timekeeping which (among other things) prevents high resolution timers from triggering going forward until the first CPU that is woken up restarts the timekeeping. That allows the CPUs to stay in the deep idle state relatively long in one go.}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKjhjR ubj)}(hX"From this point on, the CPUs can only be woken up by non-timer hardware interrupts. If that happens, they go back to the idle state unless the interrupt that woke up one of them comes from an IRQ that has been armed for system wakeup, in which case the system resume transition is started.h]hX"From this point on, the CPUs can only be woken up by non-timer hardware interrupts. If that happens, they go back to the idle state unless the interrupt that woke up one of them comes from an IRQ that has been armed for system wakeup, in which case the system resume transition is started.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKphjR ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK0hj{hhubjm)}(h.. _s2idle_resume:h]h}(h]h ]h"]h$]h&]jxj% uh1jlhKhj{hhhhjzKubeh}(h](!suspend-to-idle-suspend-code-flowjyeh ]h"](!suspend-to-idle suspend code flows2idle_suspendeh$]h&]uh1j[hj]hhhhhK+expect_referenced_by_name}j jnsexpect_referenced_by_id}jyjnsjzKubj\)}(hhh](ja)}(h Suspend-to-idle Resume Code Flowh]h Suspend-to-idle Resume Code Flow}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j`hj hhhhhKyubj)}(hThe following steps are taken in order to transition the system from the :ref:`suspend-to-idle ` sleep state into the working state:h](hIThe following steps are taken in order to transition the system from the }(hj hhhNhNubh)}(h:ref:`suspend-to-idle `h]j)}(hj h]hsuspend-to-idle}(hj hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj  refdomainj reftyperef refexplicitrefwarnj&s2idleuh1hhhhK{hj ubh$ sleep state into the working state:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhK{hj hhubj)}(hX]1. Resuming timekeeping and unfreezing the scheduler tick. When one of the CPUs is woken up (by a non-timer hardware interrupt), it leaves the idle state entered in the last step of the preceding suspend transition, restarts the timekeeping (unless it has been restarted already by another CPU that woke up earlier) and the scheduler tick on that CPU is unfrozen. If the interrupt that has woken up the CPU was armed for system wakeup, the system resume transition begins. 2. Resuming devices and restoring the working-state configuration of IRQs. Devices are resumed in four phases called *noirq resume*, *early resume*, *resume* and *complete* (see :ref:`driverapi_pm_devices` for more information on what exactly happens in each phase). Every device is visited in each phase, but typically it is not physically accessed in more than two of them. The working-state configuration of IRQs is restored after the *noirq* resume phase and the runtime PM API is re-enabled for every device whose driver supports it during the *early* resume phase. 3. Thawing tasks. Tasks frozen in step 2 of the preceding `suspend `_ transition are "thawed", which means that they are woken up from the uninterruptible sleep that they went into at that time and user space tasks are allowed to exit the kernel. 4. Invoking system-wide resume notifiers. This is analogous to step 1 of the `suspend `_ transition and the same set of callbacks is invoked at this point, but a different "notification type" parameter value is passed to them. h]j)}(hhh](j)}(hXResuming timekeeping and unfreezing the scheduler tick. When one of the CPUs is woken up (by a non-timer hardware interrupt), it leaves the idle state entered in the last step of the preceding suspend transition, restarts the timekeeping (unless it has been restarted already by another CPU that woke up earlier) and the scheduler tick on that CPU is unfrozen. If the interrupt that has woken up the CPU was armed for system wakeup, the system resume transition begins. h](j)}(h7Resuming timekeeping and unfreezing the scheduler tick.h]h7Resuming timekeeping and unfreezing the scheduler tick.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK~hj ubj)}(hX0When one of the CPUs is woken up (by a non-timer hardware interrupt), it leaves the idle state entered in the last step of the preceding suspend transition, restarts the timekeeping (unless it has been restarted already by another CPU that woke up earlier) and the scheduler tick on that CPU is unfrozen.h]hX0When one of the CPUs is woken up (by a non-timer hardware interrupt), it leaves the idle state entered in the last step of the preceding suspend transition, restarts the timekeeping (unless it has been restarted already by another CPU that woke up earlier) and the scheduler tick on that CPU is unfrozen.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hlIf the interrupt that has woken up the CPU was armed for system wakeup, the system resume transition begins.h]hlIf the interrupt that has woken up the CPU was armed for system wakeup, the system resume transition begins.}(hj& hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hX;Resuming devices and restoring the working-state configuration of IRQs. Devices are resumed in four phases called *noirq resume*, *early resume*, *resume* and *complete* (see :ref:`driverapi_pm_devices` for more information on what exactly happens in each phase). Every device is visited in each phase, but typically it is not physically accessed in more than two of them. The working-state configuration of IRQs is restored after the *noirq* resume phase and the runtime PM API is re-enabled for every device whose driver supports it during the *early* resume phase. h](j)}(hGResuming devices and restoring the working-state configuration of IRQs.h]hGResuming devices and restoring the working-state configuration of IRQs.}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj: ubj)}(hDevices are resumed in four phases called *noirq resume*, *early resume*, *resume* and *complete* (see :ref:`driverapi_pm_devices` for more information on what exactly happens in each phase).h](h*Devices are resumed in four phases called }(hjL hhhNhNubj-)}(h*noirq resume*h]h noirq resume}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjL ubh, }(hjL hhhNhNubj-)}(h*early resume*h]h early resume}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjL ubh, }(hjL hhhNhNubj-)}(h*resume*h]hresume}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjL ubh and }(hjL hhhNhNubj-)}(h *complete*h]hcomplete}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjL ubh (see }(hjL hhhNhNubh)}(h:ref:`driverapi_pm_devices`h]j)}(hj h]hdriverapi_pm_devices}(hj hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj  refdomainj reftyperef refexplicitrefwarnj&driverapi_pm_devicesuh1hhhhKhjL ubh= for more information on what exactly happens in each phase).}(hjL hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj: ubj)}(hlEvery device is visited in each phase, but typically it is not physically accessed in more than two of them.h]hlEvery device is visited in each phase, but typically it is not physically accessed in more than two of them.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj: ubj)}(hThe working-state configuration of IRQs is restored after the *noirq* resume phase and the runtime PM API is re-enabled for every device whose driver supports it during the *early* resume phase.h](h>The working-state configuration of IRQs is restored after the }(hj hhhNhNubj-)}(h*noirq*h]hnoirq}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubhh resume phase and the runtime PM API is re-enabled for every device whose driver supports it during the }(hj hhhNhNubj-)}(h*early*h]hearly}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh resume phase.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj: ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hXThawing tasks. Tasks frozen in step 2 of the preceding `suspend `_ transition are "thawed", which means that they are woken up from the uninterruptible sleep that they went into at that time and user space tasks are allowed to exit the kernel. h](j)}(hThawing tasks.h]hThawing tasks.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hTasks frozen in step 2 of the preceding `suspend `_ transition are "thawed", which means that they are woken up from the uninterruptible sleep that they went into at that time and user space tasks are allowed to exit the kernel.h](h(Tasks frozen in step 2 of the preceding }(hj hhhNhNubj)}(h`suspend `_h]hsuspend}(hj& hhhNhNubah}(h]h ]h"]h$]h&]namesuspendjxjyuh1jhj j& Kubjm)}(h h]h}(h]h ]h"]suspendah$]h&]jxjyuh1jlj2 s2idle_suspendhj j& Kubh transition are “thawed”, which means that they are woken up from the uninterruptible sleep that they went into at that time and user space tasks are allowed to exit the kernel.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hInvoking system-wide resume notifiers. This is analogous to step 1 of the `suspend `_ transition and the same set of callbacks is invoked at this point, but a different "notification type" parameter value is passed to them. h](j)}(h&Invoking system-wide resume notifiers.h]h&Invoking system-wide resume notifiers.}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjR ubj)}(hThis is analogous to step 1 of the `suspend `_ transition and the same set of callbacks is invoked at this point, but a different "notification type" parameter value is passed to them.h](h#This is analogous to step 1 of the }(hjd hhhNhNubj)}(h`suspend `_h]hsuspend}(hjl hhhNhNubah}(h]h ]h"]h$]h&]namesuspendjxjyuh1jhjd j& Kubjm)}(h h]h}(h]h ]h"]suspendah$]h&]jxjyuh1jlj2 s2idle_suspendhjd j& Kubh transition and the same set of callbacks is invoked at this point, but a different “notification type” parameter value is passed to them.}(hjd hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjR ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]j j j hj j uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhK~hj hhubeh}(h]( suspend-to-idle-resume-code-flowj% eh ]h"]( suspend-to-idle resume code flow s2idle_resumeeh$]h&]uh1j[hj]hhhhhKyj }j j sj }j% j sjzKubj\)}(hhh](ja)}(h$Platform-dependent Suspend Code Flowh]h$Platform-dependent Suspend Code Flow}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j`hj hhhhhKubj)}(h{The following steps are taken in order to transition the system from the working state to platform-dependent suspend state:h]h{The following steps are taken in order to transition the system from the working state to platform-dependent suspend state:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hXr 1. Invoking system-wide suspend notifiers. This step is the same as step 1 of the suspend-to-idle suspend transition described `above `_. 2. Freezing tasks. This step is the same as step 2 of the suspend-to-idle suspend transition described `above `_. 3. Suspending devices and reconfiguring IRQs. This step is analogous to step 3 of the suspend-to-idle suspend transition described `above `_, but the arming of IRQs for system wakeup generally does not have any effect on the platform. There are platforms that can go into a very deep low-power state internally when all CPUs in them are in sufficiently deep idle states and all I/O devices have been put into low-power states. On those platforms, suspend-to-idle can reduce system power very effectively. On the other platforms, however, low-level components (like interrupt controllers) need to be turned off in a platform-specific way (implemented in the hooks provided by the platform driver) to achieve comparable power reduction. That usually prevents in-band hardware interrupts from waking up the system, which must be done in a special platform-dependent way. Then, the configuration of system wakeup sources usually starts when system wakeup devices are suspended and is finalized by the platform suspend hooks later on. 4. Disabling non-boot CPUs. On some platforms the suspend hooks mentioned above must run in a one-CPU configuration of the system (in particular, the hardware cannot be accessed by any code running in parallel with the platform suspend hooks that may, and often do, trap into the platform firmware in order to finalize the suspend transition). For this reason, the CPU offline/online (CPU hotplug) framework is used to take all of the CPUs in the system, except for one (the boot CPU), offline (typically, the CPUs that have been taken offline go into deep idle states). This means that all tasks are migrated away from those CPUs and all IRQs are rerouted to the only CPU that remains online. 5. Suspending core system components. This prepares the core system components for (possibly) losing power going forward and suspends the timekeeping. 6. Platform-specific power removal. This is expected to remove power from all of the system components except for the memory controller and RAM (in order to preserve the contents of the latter) and some devices designated for system wakeup. In many cases control is passed to the platform firmware which is expected to finalize the suspend transition as needed. h]j)}(hhh](j)}(hInvoking system-wide suspend notifiers. This step is the same as step 1 of the suspend-to-idle suspend transition described `above `_. h](j)}(h'Invoking system-wide suspend notifiers.h]h'Invoking system-wide suspend notifiers.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hoThis step is the same as step 1 of the suspend-to-idle suspend transition described `above `_.h](hTThis step is the same as step 1 of the suspend-to-idle suspend transition described }(hj hhhNhNubj)}(h`above `_h]habove}(hj hhhNhNubah}(h]h ]h"]h$]h&]nameabovejxjyuh1jhj j& Kubjm)}(h h]h}(h]h ]h"]aboveah$]h&]jxjyuh1jlj2 s2idle_suspendhj j& Kubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hFreezing tasks. This step is the same as step 2 of the suspend-to-idle suspend transition described `above `_. h](j)}(hFreezing tasks.h]hFreezing tasks.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hoThis step is the same as step 2 of the suspend-to-idle suspend transition described `above `_.h](hTThis step is the same as step 2 of the suspend-to-idle suspend transition described }(hj- hhhNhNubj)}(h`above `_h]habove}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]nameabovejxjyuh1jhj- j& Kubjm)}(h h]h}(h]h ]h"]aboveah$]h&]jxjyuh1jlj2 s2idle_suspendhj- j& Kubh.}(hj- hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hXSuspending devices and reconfiguring IRQs. This step is analogous to step 3 of the suspend-to-idle suspend transition described `above `_, but the arming of IRQs for system wakeup generally does not have any effect on the platform. There are platforms that can go into a very deep low-power state internally when all CPUs in them are in sufficiently deep idle states and all I/O devices have been put into low-power states. On those platforms, suspend-to-idle can reduce system power very effectively. On the other platforms, however, low-level components (like interrupt controllers) need to be turned off in a platform-specific way (implemented in the hooks provided by the platform driver) to achieve comparable power reduction. That usually prevents in-band hardware interrupts from waking up the system, which must be done in a special platform-dependent way. Then, the configuration of system wakeup sources usually starts when system wakeup devices are suspended and is finalized by the platform suspend hooks later on. h](j)}(h*Suspending devices and reconfiguring IRQs.h]h*Suspending devices and reconfiguring IRQs.}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhja ubj)}(hThis step is analogous to step 3 of the suspend-to-idle suspend transition described `above `_, but the arming of IRQs for system wakeup generally does not have any effect on the platform.h](hUThis step is analogous to step 3 of the suspend-to-idle suspend transition described }(hjs hhhNhNubj)}(h`above `_h]habove}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]nameabovejxjyuh1jhjs j& Kubjm)}(h h]h}(h]h ]h"]aboveah$]h&]jxjyuh1jlj2 s2idle_suspendhjs j& Kubh^, but the arming of IRQs for system wakeup generally does not have any effect on the platform.}(hjs hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhja ubj)}(hXThere are platforms that can go into a very deep low-power state internally when all CPUs in them are in sufficiently deep idle states and all I/O devices have been put into low-power states. On those platforms, suspend-to-idle can reduce system power very effectively.h]hXThere are platforms that can go into a very deep low-power state internally when all CPUs in them are in sufficiently deep idle states and all I/O devices have been put into low-power states. On those platforms, suspend-to-idle can reduce system power very effectively.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhja ubj)}(hOn the other platforms, however, low-level components (like interrupt controllers) need to be turned off in a platform-specific way (implemented in the hooks provided by the platform driver) to achieve comparable power reduction.h]hOn the other platforms, however, low-level components (like interrupt controllers) need to be turned off in a platform-specific way (implemented in the hooks provided by the platform driver) to achieve comparable power reduction.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhja ubj)}(hX'That usually prevents in-band hardware interrupts from waking up the system, which must be done in a special platform-dependent way. Then, the configuration of system wakeup sources usually starts when system wakeup devices are suspended and is finalized by the platform suspend hooks later on.h]hX'That usually prevents in-band hardware interrupts from waking up the system, which must be done in a special platform-dependent way. Then, the configuration of system wakeup sources usually starts when system wakeup devices are suspended and is finalized by the platform suspend hooks later on.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhja ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hXDisabling non-boot CPUs. On some platforms the suspend hooks mentioned above must run in a one-CPU configuration of the system (in particular, the hardware cannot be accessed by any code running in parallel with the platform suspend hooks that may, and often do, trap into the platform firmware in order to finalize the suspend transition). For this reason, the CPU offline/online (CPU hotplug) framework is used to take all of the CPUs in the system, except for one (the boot CPU), offline (typically, the CPUs that have been taken offline go into deep idle states). This means that all tasks are migrated away from those CPUs and all IRQs are rerouted to the only CPU that remains online. h](j)}(hDisabling non-boot CPUs.h]hDisabling non-boot CPUs.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hX;On some platforms the suspend hooks mentioned above must run in a one-CPU configuration of the system (in particular, the hardware cannot be accessed by any code running in parallel with the platform suspend hooks that may, and often do, trap into the platform firmware in order to finalize the suspend transition).h]hX;On some platforms the suspend hooks mentioned above must run in a one-CPU configuration of the system (in particular, the hardware cannot be accessed by any code running in parallel with the platform suspend hooks that may, and often do, trap into the platform firmware in order to finalize the suspend transition).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hFor this reason, the CPU offline/online (CPU hotplug) framework is used to take all of the CPUs in the system, except for one (the boot CPU), offline (typically, the CPUs that have been taken offline go into deep idle states).h]hFor this reason, the CPU offline/online (CPU hotplug) framework is used to take all of the CPUs in the system, except for one (the boot CPU), offline (typically, the CPUs that have been taken offline go into deep idle states).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hzThis means that all tasks are migrated away from those CPUs and all IRQs are rerouted to the only CPU that remains online.h]hzThis means that all tasks are migrated away from those CPUs and all IRQs are rerouted to the only CPU that remains online.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hSuspending core system components. This prepares the core system components for (possibly) losing power going forward and suspends the timekeeping. h](j)}(h"Suspending core system components.h]h"Suspending core system components.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hpThis prepares the core system components for (possibly) losing power going forward and suspends the timekeeping.h]hpThis prepares the core system components for (possibly) losing power going forward and suspends the timekeeping.}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hXjPlatform-specific power removal. This is expected to remove power from all of the system components except for the memory controller and RAM (in order to preserve the contents of the latter) and some devices designated for system wakeup. In many cases control is passed to the platform firmware which is expected to finalize the suspend transition as needed. h](j)}(h Platform-specific power removal.h]h Platform-specific power removal.}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj9 ubj)}(hThis is expected to remove power from all of the system components except for the memory controller and RAM (in order to preserve the contents of the latter) and some devices designated for system wakeup.h]hThis is expected to remove power from all of the system components except for the memory controller and RAM (in order to preserve the contents of the latter) and some devices designated for system wakeup.}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj9 ubj)}(hxIn many cases control is passed to the platform firmware which is expected to finalize the suspend transition as needed.h]hxIn many cases control is passed to the platform firmware which is expected to finalize the suspend transition as needed.}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj9 ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]j j j hj j uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]$platform-dependent-suspend-code-flowah ]h"]$platform-dependent suspend code flowah$]h&]uh1j[hj]hhhhhKubj\)}(hhh](ja)}(h#Platform-dependent Resume Code Flowh]h#Platform-dependent Resume Code Flow}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j`hj hhhhhKubj)}(hThe following steps are taken in order to transition the system from a platform-dependent suspend state into the working state:h]hThe following steps are taken in order to transition the system from a platform-dependent suspend state into the working state:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)4}(hX1. Platform-specific system wakeup. The platform is woken up by a signal from one of the designated system wakeup devices (which need not be an in-band hardware interrupt) and control is passed back to the kernel (the working configuration of the platform may need to be restored by the platform firmware before the kernel gets control again). 2. Resuming core system components. The suspend-time configuration of the core system components is restored and the timekeeping is resumed. 3. Re-enabling non-boot CPUs. The CPUs disabled in step 4 of the preceding suspend transition are taken back online and their suspend-time configuration is restored. 4. Resuming devices and restoring the working-state configuration of IRQs. This step is the same as step 2 of the suspend-to-idle suspend transition described `above `_. 5. Thawing tasks. This step is the same as step 3 of the suspend-to-idle suspend transition described `above `_. 6. Invoking system-wide resume notifiers. This step is the same as step 4 of the suspend-to-idle suspend transition described `above `_.h]j)}(hhh](j)}(hXWPlatform-specific system wakeup. The platform is woken up by a signal from one of the designated system wakeup devices (which need not be an in-band hardware interrupt) and control is passed back to the kernel (the working configuration of the platform may need to be restored by the platform firmware before the kernel gets control again). h](j)}(h Platform-specific system wakeup.h]h Platform-specific system wakeup.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hX4The platform is woken up by a signal from one of the designated system wakeup devices (which need not be an in-band hardware interrupt) and control is passed back to the kernel (the working configuration of the platform may need to be restored by the platform firmware before the kernel gets control again).h]hX4The platform is woken up by a signal from one of the designated system wakeup devices (which need not be an in-band hardware interrupt) and control is passed back to the kernel (the working configuration of the platform may need to be restored by the platform firmware before the kernel gets control again).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hResuming core system components. The suspend-time configuration of the core system components is restored and the timekeeping is resumed. h](j)}(h Resuming core system components.h]h Resuming core system components.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hhThe suspend-time configuration of the core system components is restored and the timekeeping is resumed.h]hhThe suspend-time configuration of the core system components is restored and the timekeeping is resumed.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hRe-enabling non-boot CPUs. The CPUs disabled in step 4 of the preceding suspend transition are taken back online and their suspend-time configuration is restored. h](j)}(hRe-enabling non-boot CPUs.h]hRe-enabling non-boot CPUs.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hThe CPUs disabled in step 4 of the preceding suspend transition are taken back online and their suspend-time configuration is restored.h]hThe CPUs disabled in step 4 of the preceding suspend transition are taken back online and their suspend-time configuration is restored.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hResuming devices and restoring the working-state configuration of IRQs. This step is the same as step 2 of the suspend-to-idle suspend transition described `above `_. h](j)}(hGResuming devices and restoring the working-state configuration of IRQs.h]hGResuming devices and restoring the working-state configuration of IRQs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hnThis step is the same as step 2 of the suspend-to-idle suspend transition described `above `_.h](hTThis step is the same as step 2 of the suspend-to-idle suspend transition described }(hj+hhhNhNubj)}(h`above `_h]habove}(hj3hhhNhNubah}(h]h ]h"]h$]h&]nameabovejxj% uh1jhj+j& Kubjm)}(h h]h}(h]h ]h"]aboveah$]h&]jxj% uh1jlj2 s2idle_resumehj+j& Kubh.}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hThawing tasks. This step is the same as step 3 of the suspend-to-idle suspend transition described `above `_. h](j)}(hThawing tasks.h]hThawing tasks.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj_ubj)}(hnThis step is the same as step 3 of the suspend-to-idle suspend transition described `above `_.h](hTThis step is the same as step 3 of the suspend-to-idle suspend transition described }(hjqhhhNhNubj)}(h`above `_h]habove}(hjyhhhNhNubah}(h]h ]h"]h$]h&]nameabovejxj% uh1jhjqj& Kubjm)}(h h]h}(h]h ]h"]aboveah$]h&]jxj% uh1jlj2 s2idle_resumehjqj& Kubh.}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj_ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hInvoking system-wide resume notifiers. This step is the same as step 4 of the suspend-to-idle suspend transition described `above `_.h](j)}(h&Invoking system-wide resume notifiers.h]h&Invoking system-wide resume notifiers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjubj)}(hnThis step is the same as step 4 of the suspend-to-idle suspend transition described `above `_.h](hTThis step is the same as step 4 of the suspend-to-idle suspend transition described }(hjhhhNhNubj)}(h`above `_h]habove}(hjhhhNhNubah}(h]h ]h"]h$]h&]nameabovejxj% uh1jhjj& Kubjm)}(h h]h}(h]h ]h"]aboveah$]h&]jxj% uh1jlj2 s2idle_resumehjj& Kubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM hjubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]j j j hj j uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]#platform-dependent-resume-code-flowah ]h"]#platform-dependent resume code flowah$]h&]uh1j[hj]hhhhhKubeh}(h]system-suspend-code-flowsah ]h"]system suspend code flowsah$]h&]uh1j[hhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(j`N 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](j' j6 j| j jE j jCjjesubstitution_defs}(hhjhjjj jj/j#j>j2jMjAj\jPjkj_jzjnjj}jjjjjjjjjjjjjjjjjjjjj.j"j=j1jLj@j[jOjjj^jyjmjj|jjjjjjjjjjjjjjjjjjjjj-j!j<j0jKj?jZjNjij]jxjljj{jjjjjjjjjjjjjjjjjjjjj,j j;j/jJj>jYjMjhj\jwjkjjzjjjjjjjjjjjjjjjjj jjjj+jj:j.jIj=jXjLusubstitution_names}(amphaposjastjbrvbarj bsolj/centj>colonjMcommaj\commatjkcopyjzcurrenjdarrjdegjdividejdollarjequalsjexcljfrac12jfrac14jfrac18jfrac34jfrac38j.frac58j=frac78jLgtj[halfjjhorbarjyhyphenjiexcljiquestjlaquojlarrjlcubjldquojlowbarjlparjlsqbjlsquojltj-microj<middotjKnbspjZnotjinumjxohmjordfjordmjparajpercntjperiodjplusjplusmnjpoundjquestjquotjraquoj,rarrj;rcubjJrdquojYregjhrparjwrsqbjrsquojsectjsemijshyjsoljsungjsup1jsup2jsup3j timesjtradej+uarrj:verbarjIyenjXurefnames}( s2idle_resume](j' j jCj3jjyjjes2idle_suspend](j6 j& j| jl j j jE j5 j j{ eurefids}(jy](jnj6 j| j jE j ej% ](j j' jCjjeunameids}(jjj jyj j j j% j j j~ j{ jju nametypes}(jj j j j j~ juh}(jj]jyj{j j{j% j j j j{ j jj 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](hsystem_message)}(hhh]j)}(hhh]h+Hyperlink target "below" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehnjlineKZuh1jubj)}(hhh]j)}(hhh]h-Hyperlink target "suspend" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineKuh1jubj)}(hhh]j)}(hhh]h-Hyperlink target "suspend" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineKuh1jubj)}(hhh]j)}(hhh]h+Hyperlink target "above" is not referenced.}hj4sbah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineKuh1jubj)}(hhh]j)}(hhh]h+Hyperlink target "above" is not referenced.}hjNsbah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineKuh1jubj)}(hhh]j)}(hhh]h+Hyperlink target "above" is not referenced.}hjhsbah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineKuh1jubj)}(hhh]j)}(hhh]h+Hyperlink target "above" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineMuh1jubj)}(hhh]j)}(hhh]h+Hyperlink target "above" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineMuh1jubj)}(hhh]j)}(hhh]h+Hyperlink target "above" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehnjlineM uh1jube transformerN include_log].Documentation/admin-guide/pm/suspend-flows.rst(NNNNta decorationNhhub.