€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ)/translations/zh_CN/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/zh_TW/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/pt_BR/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/sp_SP/driver-api/pm/devices”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒC/var/lib/git/docbuild/linux/Documentation/driver-api/pm/devices.rst”h´Kubh¶)�”}”(hŒ4This data file has been placed in the public domain.”h]”hŒ4This data file has been placed in the public domain.”…”�”}”hhÈsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³Œo/srv/docbuild/lib/venvs/build-kernel-docs/lib64/python3.9/site-packages/docutils/parsers/rst/include/isonum.txt”h´Kubh¶)�”}”(hŒ¸Derived from the Unicode character mappings available from . Processed by unicode2rstsubs.py, part of Docutils: .”h]”hŒ¸Derived from the Unicode character mappings available from . Processed by unicode2rstsubs.py, part of Docutils: .”…”�”}”hh×sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³hÖh´KubhŒsubstitution_definition”“”)�”}”(hŒ*.. |amp| unicode:: U+00026 .. AMPERSAND”h]”hŒ&”…”�”}”hhçsbah}”(h]”h ]”h"]”Œamp”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ+.. |apos| unicode:: U+00027 .. APOSTROPHE”h]”hŒ'”…”�”}”hhösbah}”(h]”h ]”h"]”Œapos”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ).. |ast| unicode:: U+0002A .. ASTERISK”h]”hŒ*”…”�”}”hjsbah}”(h]”h ]”h"]”Œast”ah$]”h&]”uh1håh³hÖh´K hhh²hubhæ)�”}”(hŒ+.. |brvbar| unicode:: U+000A6 .. BROKEN BAR”h]”hŒ¦”…”�”}”hjsbah}”(h]”h ]”h"]”Œbrvbar”ah$]”h&]”uh1håh³hÖh´K hhh²hubhæ)�”}”(hŒ0.. |bsol| unicode:: U+0005C .. REVERSE SOLIDUS”h]”hŒ\”…”�”}”hj#sbah}”(h]”h ]”h"]”Œbsol”ah$]”h&]”uh1håh³hÖh´K hhh²hubhæ)�”}”(hŒ*.. |cent| unicode:: U+000A2 .. CENT SIGN”h]”hŒ¢”…”�”}”hj2sbah}”(h]”h ]”h"]”Œcent”ah$]”h&]”uh1håh³hÖh´K hhh²hubhæ)�”}”(hŒ&.. |colon| unicode:: U+0003A .. COLON”h]”hŒ:”…”�”}”hjAsbah}”(h]”h ]”h"]”Œcolon”ah$]”h&]”uh1håh³hÖh´K hhh²hubhæ)�”}”(hŒ&.. |comma| unicode:: U+0002C .. COMMA”h]”hŒ,”…”�”}”hjPsbah}”(h]”h ]”h"]”Œcomma”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ... |commat| unicode:: U+00040 .. COMMERCIAL AT”h]”hŒ@”…”�”}”hj_sbah}”(h]”h ]”h"]”Œcommat”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ/.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN”h]”hŒ©”…”�”}”hjnsbah}”(h]”h ]”h"]”Œcopy”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ... |curren| unicode:: U+000A4 .. CURRENCY SIGN”h]”hŒ¤”…”�”}”hj}sbah}”(h]”h ]”h"]”Œcurren”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ0.. |darr| unicode:: U+02193 .. DOWNWARDS ARROW”h]”hŒ↓”…”�”}”hjŒsbah}”(h]”h ]”h"]”Œdarr”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ,.. |deg| unicode:: U+000B0 .. DEGREE SIGN”h]”hŒ°”…”�”}”hj›sbah}”(h]”h ]”h"]”Œdeg”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ... |divide| unicode:: U+000F7 .. DIVISION SIGN”h]”hŒ÷”…”�”}”hjªsbah}”(h]”h ]”h"]”Œdivide”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ,.. |dollar| unicode:: U+00024 .. DOLLAR SIGN”h]”hŒ$”…”�”}”hj¹sbah}”(h]”h ]”h"]”Œdollar”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ,.. |equals| unicode:: U+0003D .. EQUALS SIGN”h]”hŒ=”…”�”}”hjÈsbah}”(h]”h ]”h"]”Œequals”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ1.. |excl| unicode:: U+00021 .. EXCLAMATION MARK”h]”hŒ!”…”�”}”hj×sbah}”(h]”h ]”h"]”Œexcl”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ9.. |frac12| unicode:: U+000BD .. VULGAR FRACTION ONE HALF”h]”hŒ½”…”�”}”hjæsbah}”(h]”h ]”h"]”Œfrac12”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ<.. |frac14| unicode:: U+000BC .. VULGAR FRACTION ONE QUARTER”h]”hŒ¼”…”�”}”hjõsbah}”(h]”h ]”h"]”Œfrac14”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ;.. |frac18| unicode:: U+0215B .. VULGAR FRACTION ONE EIGHTH”h]”hŒâ…›”…”�”}”hjsbah}”(h]”h ]”h"]”Œfrac18”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ?.. |frac34| unicode:: U+000BE .. VULGAR FRACTION THREE QUARTERS”h]”hŒ¾”…”�”}”hjsbah}”(h]”h ]”h"]”Œfrac34”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ>.. |frac38| unicode:: U+0215C .. VULGAR FRACTION THREE EIGHTHS”h]”hŒâ…œ”…”�”}”hj"sbah}”(h]”h ]”h"]”Œfrac38”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ=.. |frac58| unicode:: U+0215D .. VULGAR FRACTION FIVE EIGHTHS”h]”hŒâ…�”…”�”}”hj1sbah}”(h]”h ]”h"]”Œfrac58”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ>.. |frac78| unicode:: U+0215E .. VULGAR FRACTION SEVEN EIGHTHS”h]”hŒâ…ž”…”�”}”hj@sbah}”(h]”h ]”h"]”Œfrac78”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ2.. |gt| unicode:: U+0003E .. GREATER-THAN SIGN”h]”hŒ>”…”�”}”hjOsbah}”(h]”h ]”h"]”Œgt”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ9.. |half| unicode:: U+000BD .. VULGAR FRACTION ONE HALF”h]”hŒ½”…”�”}”hj^sbah}”(h]”h ]”h"]”Œhalf”ah$]”h&]”uh1håh³hÖh´K hhh²hubhæ)�”}”(hŒ/.. |horbar| unicode:: U+02015 .. HORIZONTAL BAR”h]”hŒ―”…”�”}”hjmsbah}”(h]”h ]”h"]”Œhorbar”ah$]”h&]”uh1håh³hÖh´K!hhh²hubhæ)�”}”(hŒ'.. |hyphen| unicode:: U+02010 .. HYPHEN”h]”hŒâ€�”…”�”}”hj|sbah}”(h]”h ]”h"]”Œhyphen”ah$]”h&]”uh1håh³hÖh´K"hhh²hubhæ)�”}”(hŒ:.. |iexcl| unicode:: U+000A1 .. INVERTED EXCLAMATION MARK”h]”hŒ¡”…”�”}”hj‹sbah}”(h]”h ]”h"]”Œiexcl”ah$]”h&]”uh1håh³hÖh´K#hhh²hubhæ)�”}”(hŒ7.. |iquest| unicode:: U+000BF .. INVERTED QUESTION MARK”h]”hŒ¿”…”�”}”hjšsbah}”(h]”h ]”h"]”Œiquest”ah$]”h&]”uh1håh³hÖh´K$hhh²hubhæ)�”}”(hŒJ.. |laquo| unicode:: U+000AB .. LEFT-POINTING DOUBLE ANGLE QUOTATION MARK”h]”hŒ«”…”�”}”hj©sbah}”(h]”h ]”h"]”Œlaquo”ah$]”h&]”uh1håh³hÖh´K%hhh²hubhæ)�”}”(hŒ0.. |larr| unicode:: U+02190 .. LEFTWARDS ARROW”h]”hŒâ†�”…”�”}”hj¸sbah}”(h]”h ]”h"]”Œlarr”ah$]”h&]”uh1håh³hÖh´K&hhh²hubhæ)�”}”(hŒ3.. |lcub| unicode:: U+0007B .. LEFT CURLY BRACKET”h]”hŒ{”…”�”}”hjÇsbah}”(h]”h ]”h"]”Œlcub”ah$]”h&]”uh1håh³hÖh´K'hhh²hubhæ)�”}”(hŒ;.. |ldquo| unicode:: U+0201C .. LEFT DOUBLE QUOTATION MARK”h]”hŒ“”…”�”}”hjÖsbah}”(h]”h ]”h"]”Œldquo”ah$]”h&]”uh1håh³hÖh´K(hhh²hubhæ)�”}”(hŒ).. |lowbar| unicode:: U+0005F .. LOW LINE”h]”hŒ_”…”�”}”hjåsbah}”(h]”h ]”h"]”Œlowbar”ah$]”h&]”uh1håh³hÖh´K)hhh²hubhæ)�”}”(hŒ1.. |lpar| unicode:: U+00028 .. LEFT PARENTHESIS”h]”hŒ(”…”�”}”hjôsbah}”(h]”h ]”h"]”Œlpar”ah$]”h&]”uh1håh³hÖh´K*hhh²hubhæ)�”}”(hŒ4.. |lsqb| unicode:: U+0005B .. LEFT SQUARE BRACKET”h]”hŒ[”…”�”}”hjsbah}”(h]”h ]”h"]”Œlsqb”ah$]”h&]”uh1håh³hÖh´K+hhh²hubhæ)�”}”(hŒ;.. |lsquo| unicode:: U+02018 .. LEFT SINGLE QUOTATION MARK”h]”hŒ‘”…”�”}”hjsbah}”(h]”h ]”h"]”Œlsquo”ah$]”h&]”uh1håh³hÖh´K,hhh²hubhæ)�”}”(hŒ/.. |lt| unicode:: U+0003C .. LESS-THAN SIGN”h]”hŒ<”…”�”}”hj!sbah}”(h]”h ]”h"]”Œlt”ah$]”h&]”uh1håh³hÖh´K-hhh²hubhæ)�”}”(hŒ+.. |micro| unicode:: U+000B5 .. MICRO SIGN”h]”hŒµ”…”�”}”hj0sbah}”(h]”h ]”h"]”Œmicro”ah$]”h&]”uh1håh³hÖh´K.hhh²hubhæ)�”}”(hŒ+.. |middot| unicode:: U+000B7 .. MIDDLE DOT”h]”hŒ·”…”�”}”hj?sbah}”(h]”h ]”h"]”Œmiddot”ah$]”h&]”uh1håh³hÖh´K/hhh²hubhæ)�”}”(hŒ/.. |nbsp| unicode:: U+000A0 .. NO-BREAK SPACE”h]”hŒ ”…”�”}”hjNsbah}”(h]”h ]”h"]”Œnbsp”ah$]”h&]”uh1håh³hÖh´K0hhh²hubhæ)�”}”(hŒ).. |not| unicode:: U+000AC .. NOT SIGN”h]”hŒ¬”…”�”}”hj]sbah}”(h]”h ]”h"]”Œnot”ah$]”h&]”uh1håh³hÖh´K1hhh²hubhæ)�”}”(hŒ,.. |num| unicode:: U+00023 .. NUMBER SIGN”h]”hŒ#”…”�”}”hjlsbah}”(h]”h ]”h"]”Œnum”ah$]”h&]”uh1håh³hÖh´K2hhh²hubhæ)�”}”(hŒ).. |ohm| unicode:: U+02126 .. OHM SIGN”h]”hŒΩ”…”�”}”hj{sbah}”(h]”h ]”h"]”Œohm”ah$]”h&]”uh1håh³hÖh´K3hhh²hubhæ)�”}”(hŒ;.. |ordf| unicode:: U+000AA .. FEMININE ORDINAL INDICATOR”h]”hŒª”…”�”}”hjŠsbah}”(h]”h ]”h"]”Œordf”ah$]”h&]”uh1håh³hÖh´K4hhh²hubhæ)�”}”(hŒ<.. |ordm| unicode:: U+000BA .. MASCULINE ORDINAL INDICATOR”h]”hŒº”…”�”}”hj™sbah}”(h]”h ]”h"]”Œordm”ah$]”h&]”uh1håh³hÖh´K5hhh²hubhæ)�”}”(hŒ-.. |para| unicode:: U+000B6 .. PILCROW SIGN”h]”hŒ¶”…”�”}”hj¨sbah}”(h]”h ]”h"]”Œpara”ah$]”h&]”uh1håh³hÖh´K6hhh²hubhæ)�”}”(hŒ-.. |percnt| unicode:: U+00025 .. PERCENT SIGN”h]”hŒ%”…”�”}”hj·sbah}”(h]”h ]”h"]”Œpercnt”ah$]”h&]”uh1håh³hÖh´K7hhh²hubhæ)�”}”(hŒ*.. |period| unicode:: U+0002E .. FULL STOP”h]”hŒ.”…”�”}”hjÆsbah}”(h]”h ]”h"]”Œperiod”ah$]”h&]”uh1håh³hÖh´K8hhh²hubhæ)�”}”(hŒ*.. |plus| unicode:: U+0002B .. PLUS SIGN”h]”hŒ+”…”�”}”hjÕsbah}”(h]”h ]”h"]”Œplus”ah$]”h&]”uh1håh³hÖh´K9hhh²hubhæ)�”}”(hŒ0.. |plusmn| unicode:: U+000B1 .. PLUS-MINUS SIGN”h]”hŒ±”…”�”}”hjäsbah}”(h]”h ]”h"]”Œplusmn”ah$]”h&]”uh1håh³hÖh´K:hhh²hubhæ)�”}”(hŒ+.. |pound| unicode:: U+000A3 .. POUND SIGN”h]”hŒ£”…”�”}”hjósbah}”(h]”h ]”h"]”Œpound”ah$]”h&]”uh1håh³hÖh´K;hhh²hubhæ)�”}”(hŒ... |quest| unicode:: U+0003F .. QUESTION MARK”h]”hŒ?”…”�”}”hjsbah}”(h]”h ]”h"]”Œquest”ah$]”h&]”uh1håh³hÖh´Khhh²hubhæ)�”}”(hŒ1.. |rarr| unicode:: U+02192 .. RIGHTWARDS ARROW”h]”hŒ→”…”�”}”hj/sbah}”(h]”h ]”h"]”Œrarr”ah$]”h&]”uh1håh³hÖh´K?hhh²hubhæ)�”}”(hŒ4.. |rcub| unicode:: U+0007D .. RIGHT CURLY BRACKET”h]”hŒ}”…”�”}”hj>sbah}”(h]”h ]”h"]”Œrcub”ah$]”h&]”uh1håh³hÖh´K@hhh²hubhæ)�”}”(hŒ<.. |rdquo| unicode:: U+0201D .. RIGHT DOUBLE QUOTATION MARK”h]”hŒâ€�”…”�”}”hjMsbah}”(h]”h ]”h"]”Œrdquo”ah$]”h&]”uh1håh³hÖh´KAhhh²hubhæ)�”}”(hŒ0.. |reg| unicode:: U+000AE .. REGISTERED SIGN”h]”hŒ®”…”�”}”hj\sbah}”(h]”h ]”h"]”Œreg”ah$]”h&]”uh1håh³hÖh´KBhhh²hubhæ)�”}”(hŒ2.. |rpar| unicode:: U+00029 .. RIGHT PARENTHESIS”h]”hŒ)”…”�”}”hjksbah}”(h]”h ]”h"]”Œrpar”ah$]”h&]”uh1håh³hÖh´KChhh²hubhæ)�”}”(hŒ5.. |rsqb| unicode:: U+0005D .. RIGHT SQUARE BRACKET”h]”hŒ]”…”�”}”hjzsbah}”(h]”h ]”h"]”Œrsqb”ah$]”h&]”uh1håh³hÖh´KDhhh²hubhæ)�”}”(hŒ<.. |rsquo| unicode:: U+02019 .. RIGHT SINGLE QUOTATION MARK”h]”hŒ’”…”�”}”hj‰sbah}”(h]”h ]”h"]”Œrsquo”ah$]”h&]”uh1håh³hÖh´KEhhh²hubhæ)�”}”(hŒ-.. |sect| unicode:: U+000A7 .. SECTION SIGN”h]”hŒ§”…”�”}”hj˜sbah}”(h]”h ]”h"]”Œsect”ah$]”h&]”uh1håh³hÖh´KFhhh²hubhæ)�”}”(hŒ*.. |semi| unicode:: U+0003B .. SEMICOLON”h]”hŒ;”…”�”}”hj§sbah}”(h]”h ]”h"]”Œsemi”ah$]”h&]”uh1håh³hÖh´KGhhh²hubhæ)�”}”(hŒ,.. |shy| unicode:: U+000AD .. SOFT HYPHEN”h]”hŒ­”…”�”}”hj¶sbah}”(h]”h ]”h"]”Œshy”ah$]”h&]”uh1håh³hÖh´KHhhh²hubhæ)�”}”(hŒ(.. |sol| unicode:: U+0002F .. SOLIDUS”h]”hŒ/”…”�”}”hjÅsbah}”(h]”h ]”h"]”Œsol”ah$]”h&]”uh1håh³hÖh´KIhhh²hubhæ)�”}”(hŒ,.. |sung| unicode:: U+0266A .. EIGHTH NOTE”h]”hŒ♪”…”�”}”hjÔsbah}”(h]”h ]”h"]”Œsung”ah$]”h&]”uh1håh³hÖh´KJhhh²hubhæ)�”}”(hŒ0.. |sup1| unicode:: U+000B9 .. SUPERSCRIPT ONE”h]”hŒ¹”…”�”}”hjãsbah}”(h]”h ]”h"]”Œsup1”ah$]”h&]”uh1håh³hÖh´KKhhh²hubhæ)�”}”(hŒ0.. |sup2| unicode:: U+000B2 .. SUPERSCRIPT TWO”h]”hŒ²”…”�”}”hjòsbah}”(h]”h ]”h"]”Œsup2”ah$]”h&]”uh1håh³hÖh´KLhhh²hubhæ)�”}”(hŒ2.. |sup3| unicode:: U+000B3 .. SUPERSCRIPT THREE”h]”hŒ³”…”�”}”hjsbah}”(h]”h ]”h"]”Œsup3”ah$]”h&]”uh1håh³hÖh´KMhhh²hubhæ)�”}”(hŒ4.. |times| unicode:: U+000D7 .. MULTIPLICATION SIGN”h]”hŒ×”…”�”}”hjsbah}”(h]”h ]”h"]”Œtimes”ah$]”h&]”uh1håh³hÖh´KNhhh²hubhæ)�”}”(hŒ0.. |trade| unicode:: U+02122 .. TRADE MARK SIGN”h]”hŒâ„¢”…”�”}”hjsbah}”(h]”h ]”h"]”Œtrade”ah$]”h&]”uh1håh³hÖh´KOhhh²hubhæ)�”}”(hŒ... |uarr| unicode:: U+02191 .. UPWARDS ARROW”h]”hŒ↑”…”�”}”hj.sbah}”(h]”h ]”h"]”Œuarr”ah$]”h&]”uh1håh³hÖh´KPhhh²hubhæ)�”}”(hŒ... |verbar| unicode:: U+0007C .. VERTICAL LINE”h]”hŒ|”…”�”}”hj=sbah}”(h]”h ]”h"]”Œverbar”ah$]”h&]”uh1håh³hÖh´KQhhh²hubhæ)�”}”(hŒ*.. |yen| unicode:: U+000A5 .. YEN SIGN ”h]”hŒÂ¥”…”�”}”hjLsbah}”(h]”h ]”h"]”Œyen”ah$]”h&]”uh1håh³hÖh´KRhhh²hubhŒtarget”“”)�”}”(hŒ.. _driverapi_pm_devices:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œdriverapi-pm-devices”uh1j[h´KZhhh²hh³hÇubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒDevice Power Management Basics”h]”hŒDevice Power Management Basics”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjkh²hh³hÇh´KubhŒ field_list”“”)�”}”(hhh]”(hŒfield”“”)�”}”(hhh]”(hŒ field_name”“”)�”}”(hŒ Copyright”h]”hŒ Copyright”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jˆhj…h³hÇh´KubhŒ field_body”“”)�”}”(hŒ=|copy| 2010-2011 Rafael J. Wysocki , Novell Inc.”h]”hŒ paragraph”“”)�”}”(hjœh]”(hŒ©”…”�”}”(hj h²hh³Nh´NubhŒ 2010-2011 Rafael J. Wysocki <”…”�”}”(hj h²hh³Nh´NubhŒ reference”“”)�”}”(hŒ rjw@sisk.pl”h]”hŒ rjw@sisk.pl”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rjw@sisk.pl”uh1j«hj ubhŒ>, Novell Inc.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K hjšubah}”(h]”h ]”h"]”h$]”h&]”uh1j˜hj…ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jƒh³hÇh´K hj€h²hubj„)�”}”(hhh]”(j‰)�”}”(hŒ Copyright”h]”hŒ Copyright”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jˆhjÓh³hÇh´Kubj™)�”}”(hŒ2|copy| 2010 Alan Stern ”h]”jŸ)�”}”(hjæh]”(hŒ©”…”�”}”(hjèh²hh³Nh´NubhŒ 2010 Alan Stern <”…”�”}”(hjèh²hh³Nh´Nubj¬)�”}”(hŒstern@rowland.harvard.edu”h]”hŒstern@rowland.harvard.edu”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ mailto:stern@rowland.harvard.edu”uh1j«hjèubhŒ>”…”�”}”(hjèh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K hjäubah}”(h]”h ]”h"]”h$]”h&]”uh1j˜hjÓubeh}”(h]”h ]”h"]”h$]”h&]”uh1jƒh³hÇh´K hj€h²hubj„)�”}”(hhh]”(j‰)�”}”(hŒ Copyright”h]”hŒ Copyright”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jˆhjh³hÇh´Kubj™)�”}”(hŒ|copy| 2016 Intel Corporation ”h]”jŸ)�”}”(hŒ|copy| 2016 Intel Corporation”h]”(hŒ©”…”�”}”(hj.h²hh³Nh´NubhŒ 2016 Intel Corporation”…”�”}”(hj.h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K hj*ubah}”(h]”h ]”h"]”h$]”h&]”uh1j˜hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jƒh³hÇh´K hj€h²hubj„)�”}”(hhh]”(j‰)�”}”(hŒAuthor”h]”hŒAuthor”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jˆhjLh³hÇh´Kubj™)�”}”(hŒ0Rafael J. Wysocki ”h]”jŸ)�”}”(hŒ.Rafael J. Wysocki ”h]”(hŒRafael J. Wysocki <”…”�”}”(hjah²hh³Nh´Nubj¬)�”}”(hŒrafael.j.wysocki@intel.com”h]”hŒrafael.j.wysocki@intel.com”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ!mailto:rafael.j.wysocki@intel.com”uh1j«hjaubhŒ>”…”�”}”(hjah²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Khj]ubah}”(h]”h ]”h"]”h$]”h&]”uh1j˜hjLubeh}”(h]”h ]”h"]”h$]”h&]”uh1jƒh³hÇh´Khj€h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hjkh²hh³hÇh´K ubjŸ)�”}”(hŒñMost of the code in Linux is device drivers, so most of the Linux power management (PM) code is also driver-specific. Most drivers will do very little; others, especially for platforms with small batteries (like cell phones), will do a lot.”h]”hŒñMost of the code in Linux is device drivers, so most of the Linux power management (PM) code is also driver-specific. Most drivers will do very little; others, especially for platforms with small batteries (like cell phones), will do a lot.”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Khjkh²hubjŸ)�”}”(hX"This writeup gives an overview of how drivers interact with system-wide power management goals, emphasizing the models and interfaces that are shared by everything that hooks up to the driver model core. Read it as background for the domain-specific work you'd do with any specific driver.”h]”hX$This writeup gives an overview of how drivers interact with system-wide power management goals, emphasizing the models and interfaces that are shared by everything that hooks up to the driver model core. Read it as background for the domain-specific work you’d do with any specific driver.”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Khjkh²hubjj)�”}”(hhh]”(jo)�”}”(hŒ&Two Models for Device Power Management”h]”hŒ&Two Models for Device Power Management”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhj±h²hh³hÇh´KubjŸ)�”}”(hŒRDrivers will use one or both of these models to put devices into low-power states:”h]”hŒRDrivers will use one or both of these models to put devices into low-power states:”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Khj±h²hubhŒ block_quote”“”)�”}”(hXîSystem Sleep model: Drivers can enter low-power states as part of entering system-wide low-power states like "suspend" (also known as "suspend-to-RAM"), or (mostly for systems with disks) "hibernation" (also known as "suspend-to-disk"). This is something that device, bus, and class drivers collaborate on by implementing various role-specific suspend and resume methods to cleanly power down hardware and software subsystems, then reactivate them without loss of data. Some drivers can manage hardware wakeup events, which make the system leave the low-power state. This feature may be enabled or disabled using the relevant :file:`/sys/devices/.../power/wakeup` file (for Ethernet drivers the ioctl interface used by ethtool may also be used for this purpose); enabling it may cost some power usage, but let the whole system enter low-power states more often. Runtime Power Management model: Devices may also be put into low-power states while the system is running, independently of other power management activity in principle. However, devices are not generally independent of each other (for example, a parent device cannot be suspended unless all of its child devices have been suspended). Moreover, depending on the bus type the device is on, it may be necessary to carry out some bus-specific operations on the device for this purpose. Devices put into low power states at run time may require special handling during system-wide power transitions (suspend or hibernation). For these reasons not only the device driver itself, but also the appropriate subsystem (bus type, device type or device class) driver and the PM core are involved in runtime power management. As in the system sleep power management case, they need to collaborate by implementing various role-specific suspend and resume methods, so that the hardware is cleanly powered down and reactivated without data or service loss. ”h]”(jŸ)�”}”(hŒSystem Sleep model:”h]”hŒSystem Sleep model:”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K"hjÒubjÑ)�”}”(hXMDrivers can enter low-power states as part of entering system-wide low-power states like "suspend" (also known as "suspend-to-RAM"), or (mostly for systems with disks) "hibernation" (also known as "suspend-to-disk"). This is something that device, bus, and class drivers collaborate on by implementing various role-specific suspend and resume methods to cleanly power down hardware and software subsystems, then reactivate them without loss of data. Some drivers can manage hardware wakeup events, which make the system leave the low-power state. This feature may be enabled or disabled using the relevant :file:`/sys/devices/.../power/wakeup` file (for Ethernet drivers the ioctl interface used by ethtool may also be used for this purpose); enabling it may cost some power usage, but let the whole system enter low-power states more often. ”h]”(jŸ)�”}”(hŒØDrivers can enter low-power states as part of entering system-wide low-power states like "suspend" (also known as "suspend-to-RAM"), or (mostly for systems with disks) "hibernation" (also known as "suspend-to-disk").”h]”hŒèDrivers can enter low-power states as part of entering system-wide low-power states like “suspendâ€� (also known as “suspend-to-RAMâ€�), or (mostly for systems with disks) “hibernationâ€� (also known as “suspend-to-diskâ€�).”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K$hjäubjŸ)�”}”(hŒèThis is something that device, bus, and class drivers collaborate on by implementing various role-specific suspend and resume methods to cleanly power down hardware and software subsystems, then reactivate them without loss of data.”h]”hŒèThis is something that device, bus, and class drivers collaborate on by implementing various role-specific suspend and resume methods to cleanly power down hardware and software subsystems, then reactivate them without loss of data.”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K)hjäubjŸ)�”}”(hXˆSome drivers can manage hardware wakeup events, which make the system leave the low-power state. This feature may be enabled or disabled using the relevant :file:`/sys/devices/.../power/wakeup` file (for Ethernet drivers the ioctl interface used by ethtool may also be used for this purpose); enabling it may cost some power usage, but let the whole system enter low-power states more often.”h]”(hŒ�Some drivers can manage hardware wakeup events, which make the system leave the low-power state. This feature may be enabled or disabled using the relevant ”…”�”}”(hjh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ%:file:`/sys/devices/.../power/wakeup`”h]”hŒ/sys/devices/.../power/wakeup”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hjubhŒÆ file (for Ethernet drivers the ioctl interface used by ethtool may also be used for this purpose); enabling it may cost some power usage, but let the whole system enter low-power states more often.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K.hjäubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´K$hjÒubjŸ)�”}”(hŒRuntime Power Management model:”h]”hŒRuntime Power Management model:”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K5hjÒubjÑ)�”}”(hXöDevices may also be put into low-power states while the system is running, independently of other power management activity in principle. However, devices are not generally independent of each other (for example, a parent device cannot be suspended unless all of its child devices have been suspended). Moreover, depending on the bus type the device is on, it may be necessary to carry out some bus-specific operations on the device for this purpose. Devices put into low power states at run time may require special handling during system-wide power transitions (suspend or hibernation). For these reasons not only the device driver itself, but also the appropriate subsystem (bus type, device type or device class) driver and the PM core are involved in runtime power management. As in the system sleep power management case, they need to collaborate by implementing various role-specific suspend and resume methods, so that the hardware is cleanly powered down and reactivated without data or service loss. ”h]”(jŸ)�”}”(hXNDevices may also be put into low-power states while the system is running, independently of other power management activity in principle. However, devices are not generally independent of each other (for example, a parent device cannot be suspended unless all of its child devices have been suspended). Moreover, depending on the bus type the device is on, it may be necessary to carry out some bus-specific operations on the device for this purpose. Devices put into low power states at run time may require special handling during system-wide power transitions (suspend or hibernation).”h]”hXNDevices may also be put into low-power states while the system is running, independently of other power management activity in principle. However, devices are not generally independent of each other (for example, a parent device cannot be suspended unless all of its child devices have been suspended). Moreover, depending on the bus type the device is on, it may be necessary to carry out some bus-specific operations on the device for this purpose. Devices put into low power states at run time may require special handling during system-wide power transitions (suspend or hibernation).”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K7hj=ubjŸ)�”}”(hX¥For these reasons not only the device driver itself, but also the appropriate subsystem (bus type, device type or device class) driver and the PM core are involved in runtime power management. As in the system sleep power management case, they need to collaborate by implementing various role-specific suspend and resume methods, so that the hardware is cleanly powered down and reactivated without data or service loss.”h]”hX¥For these reasons not only the device driver itself, but also the appropriate subsystem (bus type, device type or device class) driver and the PM core are involved in runtime power management. As in the system sleep power management case, they need to collaborate by implementing various role-specific suspend and resume methods, so that the hardware is cleanly powered down and reactivated without data or service loss.”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KAhj=ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´K7hjÒubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´K"hj±h²hubjŸ)�”}”(hXÉThere's not a lot to be said about those low-power states except that they are very system-specific, and often device-specific. Also, that if enough devices have been put into low-power states (at runtime), the effect may be very similar to entering some system-wide low-power state (system sleep) ... and that synergies exist, so that several drivers using runtime PM might put the system into a state where even deeper power saving options are available.”h]”hXËThere’s not a lot to be said about those low-power states except that they are very system-specific, and often device-specific. Also, that if enough devices have been put into low-power states (at runtime), the effect may be very similar to entering some system-wide low-power state (system sleep) ... and that synergies exist, so that several drivers using runtime PM might put the system into a state where even deeper power saving options are available.”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KHhj±h²hubjŸ)�”}”(hŒüMost suspended devices will have quiesced all I/O: no more DMA or IRQs (except for wakeup events), no more data read or written, and requests from upstream drivers are no longer accepted. A given bus or platform may have different requirements though.”h]”hŒüMost suspended devices will have quiesced all I/O: no more DMA or IRQs (except for wakeup events), no more data read or written, and requests from upstream drivers are no longer accepted. A given bus or platform may have different requirements though.”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KOhj±h²hubjŸ)�”}”(hŒÉExamples of hardware wakeup events include an alarm from a real time clock, network wake-on-LAN packets, keyboard or mouse activity, and media insertion or removal (for PCMCIA, MMC/SD, USB, and so on).”h]”hŒÉExamples of hardware wakeup events include an alarm from a real time clock, network wake-on-LAN packets, keyboard or mouse activity, and media insertion or removal (for PCMCIA, MMC/SD, USB, and so on).”…”�”}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KThj±h²hubeh}”(h]”Œ&two-models-for-device-power-management”ah ]”h"]”Œ&two models for device power management”ah$]”h&]”uh1jihjkh²hh³hÇh´Kubjj)�”}”(hhh]”(jo)�”}”(hŒ+Interfaces for Entering System Sleep States”h]”hŒ+Interfaces for Entering System Sleep States”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhj›h²hh³hÇh´KYubjŸ)�”}”(hXThere are programming interfaces provided for subsystems (bus type, device type, device class) and device drivers to allow them to participate in the power management of devices they are concerned with. These interfaces cover both system sleep and runtime power management.”h]”hXThere are programming interfaces provided for subsystems (bus type, device type, device class) and device drivers to allow them to participate in the power management of devices they are concerned with. These interfaces cover both system sleep and runtime power management.”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K[hj›h²hubjj)�”}”(hhh]”(jo)�”}”(hŒ"Device Power Management Operations”h]”hŒ"Device Power Management Operations”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjºh²hh³hÇh´KbubjŸ)�”}”(hXÜDevice power management operations, at the subsystem level as well as at the device driver level, are implemented by defining and populating objects of type struct dev_pm_ops defined in :file:`include/linux/pm.h`. The roles of the methods included in it will be explained in what follows. For now, it should be sufficient to remember that the last three methods are specific to runtime power management while the remaining ones are used during system-wide power transitions.”h]”(hŒºDevice power management operations, at the subsystem level as well as at the device driver level, are implemented by defining and populating objects of type struct dev_pm_ops defined in ”…”�”}”(hjËh²hh³Nh´Nubj )�”}”(hŒ:file:`include/linux/pm.h`”h]”hŒinclude/linux/pm.h”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hjËubhX. The roles of the methods included in it will be explained in what follows. For now, it should be sufficient to remember that the last three methods are specific to runtime power management while the remaining ones are used during system-wide power transitions.”…”�”}”(hjËh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Kdhjºh²hubjŸ)�”}”(hX‘There also is a deprecated "old" or "legacy" interface for power management operations available at least for some subsystems. This approach does not use struct dev_pm_ops objects and it is suitable only for implementing system sleep power management methods in a limited way. Therefore it is not described in this document, so please refer directly to the source code for more information about it.”h]”hX™There also is a deprecated “oldâ€� or “legacyâ€� interface for power management operations available at least for some subsystems. This approach does not use struct dev_pm_ops objects and it is suitable only for implementing system sleep power management methods in a limited way. Therefore it is not described in this document, so please refer directly to the source code for more information about it.”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Klhjºh²hubeh}”(h]”Œ"device-power-management-operations”ah ]”h"]”Œ"device power management operations”ah$]”h&]”uh1jihj›h²hh³hÇh´Kbubjj)�”}”(hhh]”(jo)�”}”(hŒSubsystem-Level Methods”h]”hŒSubsystem-Level Methods”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjh²hh³hÇh´KuubjŸ)�”}”(hX)The core methods to suspend and resume devices reside in struct dev_pm_ops pointed to by the :c:member:`ops` member of struct dev_pm_domain, or by the :c:member:`pm` member of struct bus_type, struct device_type and struct class. They are mostly of interest to the people writing infrastructure for platforms and buses, like PCI or USB, or device type and device class drivers. They also are relevant to the writers of device drivers whose subsystems (PM domains, device types, device classes and bus types) don't provide all power management methods.”h]”(hŒ]The core methods to suspend and resume devices reside in struct dev_pm_ops pointed to by the ”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ:c:member:`ops`”h]”j )�”}”(hjh]”hŒops”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œc”Œc-member”eh"]”h$]”h&]”uh1j hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œdriver-api/pm/devices”Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰Œ reftarget”Œops”uh1hh³hÇh´KwhjubhŒ+ member of struct dev_pm_domain, or by the ”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ:c:member:`pm`”h]”j )�”}”(hjFh]”hŒpm”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjDubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpm”uh1hh³hÇh´KwhjubhX† member of struct bus_type, struct device_type and struct class. They are mostly of interest to the people writing infrastructure for platforms and buses, like PCI or USB, or device type and device class drivers. They also are relevant to the writers of device drivers whose subsystems (PM domains, device types, device classes and bus types) don’t provide all power management methods.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Kwhjh²hubjŸ)�”}”(hXBus drivers implement these methods as appropriate for the hardware and the drivers using it; PCI works differently from USB, and so on. Not many people write subsystem-level drivers; most driver code is a "device driver" that builds on top of bus-specific framework code.”h]”hXBus drivers implement these methods as appropriate for the hardware and the drivers using it; PCI works differently from USB, and so on. Not many people write subsystem-level drivers; most driver code is a “device driverâ€� that builds on top of bus-specific framework code.”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K€hjh²hubjŸ)�”}”(hŒ³For more information on these driver calls, see the description later; they are called in phases for every device, respecting the parent-child sequencing in the driver model tree.”h]”hŒ³For more information on these driver calls, see the description later; they are called in phases for every device, respecting the parent-child sequencing in the driver model tree.”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K…hjh²hubeh}”(h]”Œsubsystem-level-methods”ah ]”h"]”Œsubsystem-level methods”ah$]”h&]”uh1jihj›h²hh³hÇh´Kuubjj)�”}”(hhh]”(jo)�”}”(hŒ+:file:`/sys/devices/.../power/wakeup` files”h]”(j )�”}”(hŒ%:file:`/sys/devices/.../power/wakeup`”h]”hŒ/sys/devices/.../power/wakeup”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hj”ubhŒ files”…”�”}”(hj”h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhj‘h²hh³hÇh´K‹ubjŸ)�”}”(hXiAll device objects in the driver model contain fields that control the handling of system wakeup events (hardware signals that can force the system out of a sleep state). These fields are initialized by bus or device driver code using :c:func:`device_set_wakeup_capable()` and :c:func:`device_set_wakeup_enable()`, defined in :file:`include/linux/pm_wakeup.h`.”h]”(hŒìAll device objects in the driver model contain fields that control the handling of system wakeup events (hardware signals that can force the system out of a sleep state). These fields are initialized by bus or device driver code using ”…”�”}”(hj³h²hh³Nh´Nubh)�”}”(hŒ%:c:func:`device_set_wakeup_capable()`”h]”j )�”}”(hj½h]”hŒdevice_set_wakeup_capable()”…”�”}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj»ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_set_wakeup_capable”uh1hh³hÇh´K�hj³ubhŒ and ”…”�”}”(hj³h²hh³Nh´Nubh)�”}”(hŒ$:c:func:`device_set_wakeup_enable()`”h]”j )�”}”(hjàh]”hŒdevice_set_wakeup_enable()”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjÞubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_set_wakeup_enable”uh1hh³hÇh´K�hj³ubhŒ , defined in ”…”�”}”(hj³h²hh³Nh´Nubj )�”}”(hŒ!:file:`include/linux/pm_wakeup.h`”h]”hŒinclude/linux/pm_wakeup.h”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hj³ubhŒ.”…”�”}”(hj³h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K�hj‘h²hubjŸ)�”}”(hXyThe :c:member:`power.can_wakeup` flag just records whether the device (and its driver) can physically support wakeup events. The :c:func:`device_set_wakeup_capable()` routine affects this flag. The :c:member:`power.wakeup` field is a pointer to an object of type struct wakeup_source used for controlling whether or not the device should use its system wakeup mechanism and for notifying the PM core of system wakeup events signaled by the device. This object is only present for wakeup-capable devices (i.e. devices whose :c:member:`can_wakeup` flags are set) and is created (or removed) by :c:func:`device_set_wakeup_capable()`.”h]”(hŒThe ”…”�”}”(hj h²hh³Nh´Nubh)�”}”(hŒ:c:member:`power.can_wakeup`”h]”j )�”}”(hj& h]”hŒpower.can_wakeup”…”�”}”(hj( h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hj$ ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpower.can_wakeup”uh1hh³hÇh´K“hj ubhŒb flag just records whether the device (and its driver) can physically support wakeup events. The ”…”�”}”(hj h²hh³Nh´Nubh)�”}”(hŒ%:c:func:`device_set_wakeup_capable()`”h]”j )�”}”(hjI h]”hŒdevice_set_wakeup_capable()”…”�”}”(hjK h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjG ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_set_wakeup_capable”uh1hh³hÇh´K“hj ubhŒ! routine affects this flag. The ”…”�”}”(hj h²hh³Nh´Nubh)�”}”(hŒ:c:member:`power.wakeup`”h]”j )�”}”(hjl h]”hŒ power.wakeup”…”�”}”(hjn h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ power.wakeup”uh1hh³hÇh´K“hj ubhX. field is a pointer to an object of type struct wakeup_source used for controlling whether or not the device should use its system wakeup mechanism and for notifying the PM core of system wakeup events signaled by the device. This object is only present for wakeup-capable devices (i.e. devices whose ”…”�”}”(hj h²hh³Nh´Nubh)�”}”(hŒ:c:member:`can_wakeup`”h]”j )�”}”(hj� h]”hŒ can_wakeup”…”�”}”(hj‘ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hj� ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ can_wakeup”uh1hh³hÇh´K“hj ubhŒ/ flags are set) and is created (or removed) by ”…”�”}”(hj h²hh³Nh´Nubh)�”}”(hŒ%:c:func:`device_set_wakeup_capable()`”h]”j )�”}”(hj² h]”hŒdevice_set_wakeup_capable()”…”�”}”(hj´ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj° ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_set_wakeup_capable”uh1hh³hÇh´K“hj ubhŒ.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K“hj‘h²hubjŸ)�”}”(hXØWhether or not a device is capable of issuing wakeup events is a hardware matter, and the kernel is responsible for keeping track of it. By contrast, whether or not a wakeup-capable device should issue wakeup events is a policy decision, and it is managed by user space through a sysfs attribute: the :file:`power/wakeup` file. User space can write the "enabled" or "disabled" strings to it to indicate whether or not, respectively, the device is supposed to signal system wakeup. This file is only present if the :c:member:`power.wakeup` object exists for the given device and is created (or removed) along with that object, by :c:func:`device_set_wakeup_capable()`. Reads from the file will return the corresponding string.”h]”(hX.Whether or not a device is capable of issuing wakeup events is a hardware matter, and the kernel is responsible for keeping track of it. By contrast, whether or not a wakeup-capable device should issue wakeup events is a policy decision, and it is managed by user space through a sysfs attribute: the ”…”�”}”(hjÙ h²hh³Nh´Nubj )�”}”(hŒ:file:`power/wakeup`”h]”hŒ power/wakeup”…”�”}”(hjá h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hjÙ ubhŒË file. User space can write the “enabledâ€� or “disabledâ€� strings to it to indicate whether or not, respectively, the device is supposed to signal system wakeup. This file is only present if the ”…”�”}”(hjÙ h²hh³Nh´Nubh)�”}”(hŒ:c:member:`power.wakeup`”h]”j )�”}”(hjø h]”hŒ power.wakeup”…”�”}”(hjú h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjö ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ power.wakeup”uh1hh³hÇh´K�hjÙ ubhŒ[ object exists for the given device and is created (or removed) along with that object, by ”…”�”}”(hjÙ h²hh³Nh´Nubh)�”}”(hŒ%:c:func:`device_set_wakeup_capable()`”h]”j )�”}”(hj h]”hŒdevice_set_wakeup_capable()”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_set_wakeup_capable”uh1hh³hÇh´K�hjÙ ubhŒ;. Reads from the file will return the corresponding string.”…”�”}”(hjÙ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K�hj‘h²hubjŸ)�”}”(hXšThe initial value in the :file:`power/wakeup` file is "disabled" for the majority of devices; the major exceptions are power buttons, keyboards, and Ethernet adapters whose WoL (wake-on-LAN) feature has been set up with ethtool. It should also default to "enabled" for devices that don't generate wakeup requests on their own but merely forward wakeup requests from one bus to another (like PCI Express ports).”h]”(hŒThe initial value in the ”…”�”}”(hjB h²hh³Nh´Nubj )�”}”(hŒ:file:`power/wakeup`”h]”hŒ power/wakeup”…”�”}”(hjJ h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hjB ubhXw file is “disabledâ€� for the majority of devices; the major exceptions are power buttons, keyboards, and Ethernet adapters whose WoL (wake-on-LAN) feature has been set up with ethtool. It should also default to “enabledâ€� for devices that don’t generate wakeup requests on their own but merely forward wakeup requests from one bus to another (like PCI Express ports).”…”�”}”(hjB h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K¨hj‘h²hubjŸ)�”}”(hX_The :c:func:`device_may_wakeup()` routine returns true only if the :c:member:`power.wakeup` object exists and the corresponding :file:`power/wakeup` file contains the "enabled" string. This information is used by subsystems, like the PCI bus type code, to see whether or not to enable the devices' wakeup mechanisms. If device wakeup mechanisms are enabled or disabled directly by drivers, they also should use :c:func:`device_may_wakeup()` to decide what to do during a system sleep transition. Device drivers, however, are not expected to call :c:func:`device_set_wakeup_enable()` directly in any case.”h]”(hŒThe ”…”�”}”(hje h²hh³Nh´Nubh)�”}”(hŒ:c:func:`device_may_wakeup()`”h]”j )�”}”(hjo h]”hŒdevice_may_wakeup()”…”�”}”(hjq h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjm ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_may_wakeup”uh1hh³hÇh´K¯hje ubhŒ" routine returns true only if the ”…”�”}”(hje h²hh³Nh´Nubh)�”}”(hŒ:c:member:`power.wakeup`”h]”j )�”}”(hj’ h]”hŒ power.wakeup”…”�”}”(hj” h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hj� ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ power.wakeup”uh1hh³hÇh´K¯hje ubhŒ% object exists and the corresponding ”…”�”}”(hje h²hh³Nh´Nubj )�”}”(hŒ:file:`power/wakeup`”h]”hŒ power/wakeup”…”�”}”(hj³ h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hje ubhX file contains the “enabledâ€� string. This information is used by subsystems, like the PCI bus type code, to see whether or not to enable the devices’ wakeup mechanisms. If device wakeup mechanisms are enabled or disabled directly by drivers, they also should use ”…”�”}”(hje h²hh³Nh´Nubh)�”}”(hŒ:c:func:`device_may_wakeup()`”h]”j )�”}”(hjÊ h]”hŒdevice_may_wakeup()”…”�”}”(hjÌ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjÈ ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_may_wakeup”uh1hh³hÇh´K¯hje ubhŒk to decide what to do during a system sleep transition. Device drivers, however, are not expected to call ”…”�”}”(hje h²hh³Nh´Nubh)�”}”(hŒ$:c:func:`device_set_wakeup_enable()`”h]”j )�”}”(hjí h]”hŒdevice_set_wakeup_enable()”…”�”}”(hjï h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjë ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_set_wakeup_enable”uh1hh³hÇh´K¯hje ubhŒ directly in any case.”…”�”}”(hje h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K¯hj‘h²hubjŸ)�”}”(hX—It ought to be noted that system wakeup is conceptually different from "remote wakeup" used by runtime power management, although it may be supported by the same physical mechanism. Remote wakeup is a feature allowing devices in low-power states to trigger specific interrupts to signal conditions in which they should be put into the full-power state. Those interrupts may or may not be used to signal system wakeup events, depending on the hardware design. On some systems it is impossible to trigger them from system sleep states. In any case, remote wakeup should always be enabled for runtime power management for all devices and drivers that support it.”h]”hX›It ought to be noted that system wakeup is conceptually different from “remote wakeupâ€� used by runtime power management, although it may be supported by the same physical mechanism. Remote wakeup is a feature allowing devices in low-power states to trigger specific interrupts to signal conditions in which they should be put into the full-power state. Those interrupts may or may not be used to signal system wakeup events, depending on the hardware design. On some systems it is impossible to trigger them from system sleep states. In any case, remote wakeup should always be enabled for runtime power management for all devices and drivers that support it.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´K¸hj‘h²hubeh}”(h]”Œsys-devices-power-wakeup-files”ah ]”h"]”Œ#/sys/devices/.../power/wakeup files”ah$]”h&]”uh1jihj›h²hh³hÇh´K‹ubjj)�”}”(hhh]”(jo)�”}”(hŒ,:file:`/sys/devices/.../power/control` files”h]”(j )�”}”(hŒ&:file:`/sys/devices/.../power/control`”h]”hŒ/sys/devices/.../power/control”…”�”}”(hj1 h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hj- ubhŒ files”…”�”}”(hj- h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhj* h²hh³hÇh´KÄubjŸ)�”}”(hXBEach device in the driver model has a flag to control whether it is subject to runtime power management. This flag, :c:member:`runtime_auto`, is initialized by the bus type (or generally subsystem) code using :c:func:`pm_runtime_allow()` or :c:func:`pm_runtime_forbid()`; the default is to allow runtime power management.”h]”(hŒuEach device in the driver model has a flag to control whether it is subject to runtime power management. This flag, ”…”�”}”(hjL h²hh³Nh´Nubh)�”}”(hŒ:c:member:`runtime_auto`”h]”j )�”}”(hjV h]”hŒ runtime_auto”…”�”}”(hjX h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjT ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ runtime_auto”uh1hh³hÇh´KÆhjL ubhŒE, is initialized by the bus type (or generally subsystem) code using ”…”�”}”(hjL h²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_allow()`”h]”j )�”}”(hjy h]”hŒpm_runtime_allow()”…”�”}”(hj{ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjw ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_allow”uh1hh³hÇh´KÆhjL ubhŒ or ”…”�”}”(hjL h²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_forbid()`”h]”j )�”}”(hjœ h]”hŒpm_runtime_forbid()”…”�”}”(hjž h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjš ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_forbid”uh1hh³hÇh´KÆhjL ubhŒ3; the default is to allow runtime power management.”…”�”}”(hjL h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KÆhj* h²hubjŸ)�”}”(hX,The setting can be adjusted by user space by writing either "on" or "auto" to the device's :file:`power/control` sysfs file. Writing "auto" calls :c:func:`pm_runtime_allow()`, setting the flag and allowing the device to be runtime power-managed by its driver. Writing "on" calls :c:func:`pm_runtime_forbid()`, clearing the flag, returning the device to full power if it was in a low-power state, and preventing the device from being runtime power-managed. User space can check the current value of the :c:member:`runtime_auto` flag by reading that file.”h]”(hŒeThe setting can be adjusted by user space by writing either “onâ€� or “autoâ€� to the device’s ”…”�”}”(hjà h²hh³Nh´Nubj )�”}”(hŒ:file:`power/control`”h]”hŒ power/control”…”�”}”(hjË h²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hjà ubhŒ' sysfs file. Writing “autoâ€� calls ”…”�”}”(hjà h²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_allow()`”h]”j )�”}”(hjâ h]”hŒpm_runtime_allow()”…”�”}”(hjä h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjà ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_allow”uh1hh³hÇh´KÌhjà ubhŒn, setting the flag and allowing the device to be runtime power-managed by its driver. Writing “onâ€� calls ”…”�”}”(hjà h²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_forbid()`”h]”j )�”}”(hj h]”hŒpm_runtime_forbid()”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_forbid”uh1hh³hÇh´KÌhjà ubhŒÃ, clearing the flag, returning the device to full power if it was in a low-power state, and preventing the device from being runtime power-managed. User space can check the current value of the ”…”�”}”(hjà h²hh³Nh´Nubh)�”}”(hŒ:c:member:`runtime_auto`”h]”j )�”}”(hj( h]”hŒ runtime_auto”…”�”}”(hj* h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hj& ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ runtime_auto”uh1hh³hÇh´KÌhjà ubhŒ flag by reading that file.”…”�”}”(hjà h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KÌhj* h²hubjŸ)�”}”(hX?The device's :c:member:`runtime_auto` flag has no effect on the handling of system-wide power transitions. In particular, the device can (and in the majority of cases should and will) be put into a low-power state during a system-wide transition to a sleep state even though its :c:member:`runtime_auto` flag is clear.”h]”(hŒThe device’s ”…”�”}”(hjO h²hh³Nh´Nubh)�”}”(hŒ:c:member:`runtime_auto`”h]”j )�”}”(hjY h]”hŒ runtime_auto”…”�”}”(hj[ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjW ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ runtime_auto”uh1hh³hÇh´KÕhjO ubhŒó flag has no effect on the handling of system-wide power transitions. In particular, the device can (and in the majority of cases should and will) be put into a low-power state during a system-wide transition to a sleep state even though its ”…”�”}”(hjO h²hh³Nh´Nubh)�”}”(hŒ:c:member:`runtime_auto`”h]”j )�”}”(hj| h]”hŒ runtime_auto”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjz ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ runtime_auto”uh1hh³hÇh´KÕhjO ubhŒ flag is clear.”…”�”}”(hjO h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KÕhj* h²hubjŸ)�”}”(hŒoFor more information about the runtime power management framework, refer to Documentation/power/runtime_pm.rst.”h]”hŒoFor more information about the runtime power management framework, refer to Documentation/power/runtime_pm.rst.”…”�”}”(hj£ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KÛhj* h²hubeh}”(h]”Œsys-devices-power-control-files”ah ]”h"]”Œ$/sys/devices/.../power/control files”ah$]”h&]”uh1jihj›h²hh³hÇh´KÄubeh}”(h]”Œ+interfaces-for-entering-system-sleep-states”ah ]”h"]”Œ+interfaces for entering system sleep states”ah$]”h&]”uh1jihjkh²hh³hÇh´KYubjj)�”}”(hhh]”(jo)�”}”(hŒ6Calling Drivers to Enter and Leave System Sleep States”h]”hŒ6Calling Drivers to Enter and Leave System Sleep States”…”�”}”(hjÄ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjÁ h²hh³hÇh´KàubjŸ)�”}”(hXKWhen the system goes into a sleep state, each device's driver is asked to suspend the device by putting it into a state compatible with the target system state. That's usually some version of "off", but the details are system-specific. Also, wakeup-enabled devices will usually stay partly functional in order to wake the system.”h]”hXSWhen the system goes into a sleep state, each device’s driver is asked to suspend the device by putting it into a state compatible with the target system state. That’s usually some version of “offâ€�, but the details are system-specific. Also, wakeup-enabled devices will usually stay partly functional in order to wake the system.”…”�”}”(hjÒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KâhjÁ h²hubjŸ)�”}”(hŒÑWhen the system leaves that low-power state, the device's driver is asked to resume it by returning it to full power. The suspend and resume operations always go together, and both are multi-phase operations.”h]”hŒÓWhen the system leaves that low-power state, the device’s driver is asked to resume it by returning it to full power. The suspend and resume operations always go together, and both are multi-phase operations.”…”�”}”(hjà h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KèhjÁ h²hubjŸ)�”}”(hXFor simple drivers, suspend might quiesce the device using class code and then turn its hardware as "off" as possible during suspend_noirq. The matching resume calls would then completely reinitialize the hardware before reactivating its class I/O queues.”h]”hXFor simple drivers, suspend might quiesce the device using class code and then turn its hardware as “offâ€� as possible during suspend_noirq. The matching resume calls would then completely reinitialize the hardware before reactivating its class I/O queues.”…”�”}”(hjî h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KìhjÁ h²hubjŸ)�”}”(hŒWMore power-aware drivers might prepare the devices for triggering system wakeup events.”h]”hŒWMore power-aware drivers might prepare the devices for triggering system wakeup events.”…”�”}”(hjü h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´KñhjÁ h²hubjj)�”}”(hhh]”(jo)�”}”(hŒCall Sequence Guarantees”h]”hŒCall Sequence Guarantees”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhj h²hh³hÇh´KöubjŸ)�”}”(hŒöTo ensure that bridges and similar links needing to talk to a device are available when the device is suspended or resumed, the device hierarchy is walked in a bottom-up order to suspend devices. A top-down order is used to resume those devices.”h]”hŒöTo ensure that bridges and similar links needing to talk to a device are available when the device is suspended or resumed, the device hierarchy is walked in a bottom-up order to suspend devices. A top-down order is used to resume those devices.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Køhj h²hubjŸ)�”}”(hŒÙThe ordering of the device hierarchy is defined by the order in which devices get registered: a child can never be registered, probed or resumed before its parent; and can't be removed or suspended after that parent.”h]”hŒÛThe ordering of the device hierarchy is defined by the order in which devices get registered: a child can never be registered, probed or resumed before its parent; and can’t be removed or suspended after that parent.”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Kýhj h²hubjŸ)�”}”(hXÔThe policy is that the device hierarchy should match hardware bus topology. [Or at least the control bus, for devices which use multiple buses.] In particular, this means that a device registration may fail if the parent of the device is suspending (i.e. has been chosen by the PM core as the next device to suspend) or has already suspended, as well as after all of the other devices have been suspended. Device drivers must be prepared to cope with such situations.”h]”hXÔThe policy is that the device hierarchy should match hardware bus topology. [Or at least the control bus, for devices which use multiple buses.] In particular, this means that a device registration may fail if the parent of the device is suspending (i.e. has been chosen by the PM core as the next device to suspend) or has already suspended, as well as after all of the other devices have been suspended. Device drivers must be prepared to cope with such situations.”…”�”}”(hj7 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhj h²hubeh}”(h]”Œcall-sequence-guarantees”ah ]”h"]”Œcall sequence guarantees”ah$]”h&]”uh1jihjÁ h²hh³hÇh´Köubjj)�”}”(hhh]”(jo)�”}”(hŒSystem Power Management Phases”h]”hŒSystem Power Management Phases”…”�”}”(hjP h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjM h²hh³hÇh´M ubjŸ)�”}”(hX{Suspending or resuming the system is done in several phases. Different phases are used for suspend-to-idle, shallow (standby), and deep ("suspend-to-RAM") sleep states and the hibernation state ("suspend-to-disk"). Each phase involves executing callbacks for every device before the next phase begins. Not all buses or classes support all these callbacks and not all drivers use all the callbacks. The various phases always run after tasks have been frozen and before they are unfrozen. Furthermore, the ``*_noirq`` phases run at a time when IRQ handlers have been disabled (except for those marked with the IRQF_NO_SUSPEND flag).”h]”(hXSuspending or resuming the system is done in several phases. Different phases are used for suspend-to-idle, shallow (standby), and deep (“suspend-to-RAMâ€�) sleep states and the hibernation state (“suspend-to-diskâ€�). Each phase involves executing callbacks for every device before the next phase begins. Not all buses or classes support all these callbacks and not all drivers use all the callbacks. The various phases always run after tasks have been frozen and before they are unfrozen. Furthermore, the ”…”�”}”(hj^ h²hh³Nh´Nubj )�”}”(hŒ ``*_noirq``”h]”hŒ*_noirq”…”�”}”(hjf h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^ ubhŒs phases run at a time when IRQ handlers have been disabled (except for those marked with the IRQF_NO_SUSPEND flag).”…”�”}”(hj^ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M hjM h²hubjŸ)�”}”(hXAll phases use PM domain, bus, type, class or driver callbacks (that is, methods defined in ``dev->pm_domain->ops``, ``dev->bus->pm``, ``dev->type->pm``, ``dev->class->pm`` or ``dev->driver->pm``). These callbacks are regarded by the PM core as mutually exclusive. Moreover, PM domain callbacks always take precedence over all of the other callbacks and, for example, type callbacks take precedence over bus, class and driver callbacks. To be precise, the following rules are used to determine which callback to execute in the given phase:”h]”(hŒ\All phases use PM domain, bus, type, class or driver callbacks (that is, methods defined in ”…”�”}”(hj~ h²hh³Nh´Nubj )�”}”(hŒ``dev->pm_domain->ops``”h]”hŒdev->pm_domain->ops”…”�”}”(hj† h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhŒ, ”…”�”}”(hj~ h²hh³Nh´Nubj )�”}”(hŒ``dev->bus->pm``”h]”hŒ dev->bus->pm”…”�”}”(hj˜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhŒ, ”…”�”}”hj~ sbj )�”}”(hŒ``dev->type->pm``”h]”hŒ dev->type->pm”…”�”}”(hjª h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhŒ, ”…”�”}”(hj~ h²hh³Nh´Nubj )�”}”(hŒ``dev->class->pm``”h]”hŒdev->class->pm”…”�”}”(hj¼ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhŒ or ”…”�”}”(hj~ h²hh³Nh´Nubj )�”}”(hŒ``dev->driver->pm``”h]”hŒdev->driver->pm”…”�”}”(hjÎ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhX[). These callbacks are regarded by the PM core as mutually exclusive. Moreover, PM domain callbacks always take precedence over all of the other callbacks and, for example, type callbacks take precedence over bus, class and driver callbacks. To be precise, the following rules are used to determine which callback to execute in the given phase:”…”�”}”(hj~ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MhjM h²hubjÑ)�”}”(hXH1. If ``dev->pm_domain`` is present, the PM core will choose the callback provided by ``dev->pm_domain->ops`` for execution. 2. Otherwise, if both ``dev->type`` and ``dev->type->pm`` are present, the callback provided by ``dev->type->pm`` will be chosen for execution. 3. Otherwise, if both ``dev->class`` and ``dev->class->pm`` are present, the callback provided by ``dev->class->pm`` will be chosen for execution. 4. Otherwise, if both ``dev->bus`` and ``dev->bus->pm`` are present, the callback provided by ``dev->bus->pm`` will be chosen for execution. ”h]”hŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒzIf ``dev->pm_domain`` is present, the PM core will choose the callback provided by ``dev->pm_domain->ops`` for execution. ”h]”jŸ)�”}”(hŒyIf ``dev->pm_domain`` is present, the PM core will choose the callback provided by ``dev->pm_domain->ops`` for execution.”h]”(hŒIf ”…”�”}”(hjõ h²hh³Nh´Nubj )�”}”(hŒ``dev->pm_domain``”h]”hŒdev->pm_domain”…”�”}”(hjý h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjõ ubhŒ> is present, the PM core will choose the callback provided by ”…”�”•}”(hjõ h²hh³Nh´Nubj )�”}”(hŒ``dev->pm_domain->ops``”h]”hŒdev->pm_domain->ops”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjõ ubhŒ for execution.”…”�”}”(hjõ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhjñ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjì ubjð )�”}”(hŒ�Otherwise, if both ``dev->type`` and ``dev->type->pm`` are present, the callback provided by ``dev->type->pm`` will be chosen for execution. ”h]”jŸ)�”}”(hŒŒOtherwise, if both ``dev->type`` and ``dev->type->pm`` are present, the callback provided by ``dev->type->pm`` will be chosen for execution.”h]”(hŒOtherwise, if both ”…”�”}”(hj1h²hh³Nh´Nubj )�”}”(hŒ ``dev->type``”h]”hŒ dev->type”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj1ubhŒ and ”…”�”}”(hj1h²hh³Nh´Nubj )�”}”(hŒ``dev->type->pm``”h]”hŒ dev->type->pm”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj1ubhŒ' are present, the callback provided by ”…”�”}”(hj1h²hh³Nh´Nubj )�”}”(hŒ``dev->type->pm``”h]”hŒ dev->type->pm”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj1ubhŒ will be chosen for execution.”…”�”}”(hj1h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M"hj-ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjì ubjð )�”}”(hŒ�Otherwise, if both ``dev->class`` and ``dev->class->pm`` are present, the callback provided by ``dev->class->pm`` will be chosen for execution. ”h]”jŸ)�”}”(hŒ�Otherwise, if both ``dev->class`` and ``dev->class->pm`` are present, the callback provided by ``dev->class->pm`` will be chosen for execution.”h]”(hŒOtherwise, if both ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``dev->class``”h]”hŒ dev->class”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ and ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``dev->class->pm``”h]”hŒdev->class->pm”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ' are present, the callback provided by ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``dev->class->pm``”h]”hŒdev->class->pm”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ will be chosen for execution.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M%hj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjì ubjð )�”}”(hŒŠOtherwise, if both ``dev->bus`` and ``dev->bus->pm`` are present, the callback provided by ``dev->bus->pm`` will be chosen for execution. ”h]”jŸ)�”}”(hŒ‰Otherwise, if both ``dev->bus`` and ``dev->bus->pm`` are present, the callback provided by ``dev->bus->pm`` will be chosen for execution.”h]”(hŒOtherwise, if both ”…”�”}”(hjÍh²hh³Nh´Nubj )�”}”(hŒ ``dev->bus``”h]”hŒdev->bus”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÍubhŒ and ”…”�”}”(hjÍh²hh³Nh´Nubj )�”}”(hŒ``dev->bus->pm``”h]”hŒ dev->bus->pm”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÍubhŒ' are present, the callback provided by ”…”�”}”(hjÍh²hh³Nh´Nubj )�”}”(hŒ``dev->bus->pm``”h]”hŒ dev->bus->pm”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÍubhŒ will be chosen for execution.”…”�”}”(hjÍh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M)hjÉubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjì ubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jê hjæ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´MhjM h²hubjŸ)�”}”(hŒsThis allows PM domains and device types to override callbacks provided by bus types or device classes if necessary.”h]”hŒsThis allows PM domains and device types to override callbacks provided by bus types or device classes if necessary.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M,hjM h²hubjŸ)�”}”(hŒ¡The PM domain, type, class and bus callbacks may in turn invoke device- or driver-specific methods stored in ``dev->driver->pm``, but they don't have to do that.”h]”(hŒmThe PM domain, type, class and bus callbacks may in turn invoke device- or driver-specific methods stored in ”…”�”}”(hj6h²hh³Nh´Nubj )�”}”(hŒ``dev->driver->pm``”h]”hŒdev->driver->pm”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj6ubhŒ#, but they don’t have to do that.”…”�”}”(hj6h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M/hjM h²hubjŸ)�”}”(hŒªIf the subsystem callback chosen for execution is not present, the PM core will execute the corresponding method from the ``dev->driver->pm`` set instead if there is one.”h]”(hŒzIf the subsystem callback chosen for execution is not present, the PM core will execute the corresponding method from the ”…”�”}”(hjVh²hh³Nh´Nubj )�”}”(hŒ``dev->driver->pm``”h]”hŒdev->driver->pm”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjVubhŒ set instead if there is one.”…”�”}”(hjVh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M3hjM h²hubeh}”(h]”Œsystem-power-management-phases”ah ]”h"]”Œsystem power management phases”ah$]”h&]”uh1jihjÁ h²hh³hÇh´M ubjj)�”}”(hhh]”(jo)�”}”(hŒEntering System Suspend”h]”hŒEntering System Suspend”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhj~h²hh³hÇh´M9ubjŸ)�”}”(hŒ“When the system goes into the freeze, standby or memory sleep state, the phases are: ``prepare``, ``suspend``, ``suspend_late``, ``suspend_noirq``.”h]”(hŒUWhen the system goes into the freeze, standby or memory sleep state, the phases are: ”…”�”}”(hj�h²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj�ubhŒ, ”…”�”}”(hj�h²hh³Nh´Nubj )�”}”(hŒ ``suspend``”h]”hŒsuspend”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj�ubhŒ, ”…”�”}”hj�sbj )�”}”(hŒ``suspend_late``”h]”hŒ suspend_late”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj�ubhŒ, ”…”�”}”hj�sbj )�”}”(hŒ``suspend_noirq``”h]”hŒ suspend_noirq”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj�ubhŒ.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M;hj~h²hubjÑ)�”}”(hX1. The ``prepare`` phase is meant to prevent races by preventing new devices from being registered; the PM core would never know that all the children of a device had been suspended if new children could be registered at will. [By contrast, from the PM core's perspective, devices may be unregistered at any time.] Unlike the other suspend-related phases, during the ``prepare`` phase the device hierarchy is traversed top-down. After the ``->prepare`` callback method returns, no new children may be registered below the device. The method may also prepare the device or driver in some way for the upcoming system power transition, but it should not put the device into a low-power state. Moreover, if the device supports runtime power management, the ``->prepare`` callback method must not update its state in case it is necessary to resume it from runtime suspend later on. For devices supporting runtime power management, the return value of the prepare callback can be used to indicate to the PM core that it may safely leave the device in runtime suspend (if runtime-suspended already), provided that all of the device's descendants are also left in runtime suspend. Namely, if the prepare callback returns a positive number and that happens for all of the descendants of the device too, and all of them (including the device itself) are runtime-suspended, the PM core will skip the ``suspend``, ``suspend_late`` and ``suspend_noirq`` phases as well as all of the corresponding phases of the subsequent device resume for all of these devices. In that case, the ``->complete`` callback will be the next one invoked after the ``->prepare`` callback and is entirely responsible for putting the device into a consistent state as appropriate. Note that this direct-complete procedure applies even if the device is disabled for runtime PM; only the runtime-PM status matters. It follows that if a device has system-sleep callbacks but does not support runtime PM, then its prepare callback must never return a positive value. This is because all such devices are initially set to runtime-suspended with runtime PM disabled. This feature also can be controlled by device drivers by using the ``DPM_FLAG_NO_DIRECT_COMPLETE`` and ``DPM_FLAG_SMART_PREPARE`` driver power management flags. [Typically, they are set at the time the driver is probed against the device in question by passing them to the :c:func:`dev_pm_set_driver_flags` helper function.] If the first of these flags is set, the PM core will not apply the direct-complete procedure described above to the given device and, consequently, to any of its ancestors. The second flag, when set, informs the middle layer code (bus types, device types, PM domains, classes) that it should take the return value of the ``->prepare`` callback provided by the driver into account and it may only return a positive value from its own ``->prepare`` callback if the driver's one also has returned a positive value. 2. The ``->suspend`` methods should quiesce the device to stop it from performing I/O. They also may save the device registers and put it into the appropriate low-power state, depending on the bus type the device is on, and they may enable wakeup events. However, for devices supporting runtime power management, the ``->suspend`` methods provided by subsystems (bus types and PM domains in particular) must follow an additional rule regarding what can be done to the devices before their drivers' ``->suspend`` methods are called. Namely, they may resume the devices from runtime suspend by calling :c:func:`pm_runtime_resume` for them, if that is necessary, but they must not update the state of the devices in any other way at that time (in case the drivers need to resume the devices from runtime suspend in their ``->suspend`` methods). In fact, the PM core prevents subsystems or drivers from putting devices into runtime suspend at these times by calling :c:func:`pm_runtime_get_noresume` before issuing the ``->prepare`` callback (and calling :c:func:`pm_runtime_put` after issuing the ``->complete`` callback). 3. For a number of devices it is convenient to split suspend into the "quiesce device" and "save device state" phases, in which cases ``suspend_late`` is meant to do the latter. It is always executed after runtime power management has been disabled for the device in question. 4. The ``suspend_noirq`` phase occurs after IRQ handlers have been disabled, which means that the driver's interrupt handler will not be called while the callback method is running. The ``->suspend_noirq`` methods should save the values of the device's registers that weren't saved previously and finally put the device into the appropriate low-power state. The majority of subsystems and device drivers need not implement this callback. However, bus types allowing devices to share interrupt vectors, like PCI, generally need it; otherwise a driver might encounter an error during the suspend phase by fielding a shared interrupt generated by some other device after its own device had been set to low power. ”h]”jë )�”}”(hhh]”(jð )�”}”(hX� The ``prepare`` phase is meant to prevent races by preventing new devices from being registered; the PM core would never know that all the children of a device had been suspended if new children could be registered at will. [By contrast, from the PM core's perspective, devices may be unregistered at any time.] Unlike the other suspend-related phases, during the ``prepare`` phase the device hierarchy is traversed top-down. After the ``->prepare`` callback method returns, no new children may be registered below the device. The method may also prepare the device or driver in some way for the upcoming system power transition, but it should not put the device into a low-power state. Moreover, if the device supports runtime power management, the ``->prepare`` callback method must not update its state in case it is necessary to resume it from runtime suspend later on. For devices supporting runtime power management, the return value of the prepare callback can be used to indicate to the PM core that it may safely leave the device in runtime suspend (if runtime-suspended already), provided that all of the device's descendants are also left in runtime suspend. Namely, if the prepare callback returns a positive number and that happens for all of the descendants of the device too, and all of them (including the device itself) are runtime-suspended, the PM core will skip the ``suspend``, ``suspend_late`` and ``suspend_noirq`` phases as well as all of the corresponding phases of the subsequent device resume for all of these devices. In that case, the ``->complete`` callback will be the next one invoked after the ``->prepare`` callback and is entirely responsible for putting the device into a consistent state as appropriate. Note that this direct-complete procedure applies even if the device is disabled for runtime PM; only the runtime-PM status matters. It follows that if a device has system-sleep callbacks but does not support runtime PM, then its prepare callback must never return a positive value. This is because all such devices are initially set to runtime-suspended with runtime PM disabled. This feature also can be controlled by device drivers by using the ``DPM_FLAG_NO_DIRECT_COMPLETE`` and ``DPM_FLAG_SMART_PREPARE`` driver power management flags. [Typically, they are set at the time the driver is probed against the device in question by passing them to the :c:func:`dev_pm_set_driver_flags` helper function.] If the first of these flags is set, the PM core will not apply the direct-complete procedure described above to the given device and, consequently, to any of its ancestors. The second flag, when set, informs the middle layer code (bus types, device types, PM domains, classes) that it should take the return value of the ``->prepare`` callback provided by the driver into account and it may only return a positive value from its own ``->prepare`` callback if the driver's one also has returned a positive value. ”h]”(jŸ)�”}”(hX«The ``prepare`` phase is meant to prevent races by preventing new devices from being registered; the PM core would never know that all the children of a device had been suspended if new children could be registered at will. [By contrast, from the PM core's perspective, devices may be unregistered at any time.] Unlike the other suspend-related phases, during the ``prepare`` phase the device hierarchy is traversed top-down.”h]”(hŒThe ”…”�”}”(hjðh²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjðubhXa phase is meant to prevent races by preventing new devices from being registered; the PM core would never know that all the children of a device had been suspended if new children could be registered at will. [By contrast, from the PM core’s perspective, devices may be unregistered at any time.] Unlike the other suspend-related phases, during the ”…”�”}”(hjðh²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjðubhŒ2 phase the device hierarchy is traversed top-down.”…”�”}”(hjðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M>hjìubjŸ)�”}”(hXÁAfter the ``->prepare`` callback method returns, no new children may be registered below the device. The method may also prepare the device or driver in some way for the upcoming system power transition, but it should not put the device into a low-power state. Moreover, if the device supports runtime power management, the ``->prepare`` callback method must not update its state in case it is necessary to resume it from runtime suspend later on.”h]”(hŒ After the ”…”�”}”(hj"h²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj"ubhX/ callback method returns, no new children may be registered below the device. The method may also prepare the device or driver in some way for the upcoming system power transition, but it should not put the device into a low-power state. Moreover, if the device supports runtime power management, the ”…”�”}”(hj"h²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj"ubhŒn callback method must not update its state in case it is necessary to resume it from runtime suspend later on.”…”�”}”(hj"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MFhjìubjŸ)�”}”(hXdFor devices supporting runtime power management, the return value of the prepare callback can be used to indicate to the PM core that it may safely leave the device in runtime suspend (if runtime-suspended already), provided that all of the device's descendants are also left in runtime suspend. Namely, if the prepare callback returns a positive number and that happens for all of the descendants of the device too, and all of them (including the device itself) are runtime-suspended, the PM core will skip the ``suspend``, ``suspend_late`` and ``suspend_noirq`` phases as well as all of the corresponding phases of the subsequent device resume for all of these devices. In that case, the ``->complete`` callback will be the next one invoked after the ``->prepare`` callback and is entirely responsible for putting the device into a consistent state as appropriate.”h]”(hXFor devices supporting runtime power management, the return value of the prepare callback can be used to indicate to the PM core that it may safely leave the device in runtime suspend (if runtime-suspended already), provided that all of the device’s descendants are also left in runtime suspend. Namely, if the prepare callback returns a positive number and that happens for all of the descendants of the device too, and all of them (including the device itself) are runtime-suspended, the PM core will skip the ”…”�”}”(hjTh²hh³Nh´Nubj )�”}”(hŒ ``suspend``”h]”hŒsuspend”…”�”}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjTubhŒ, ”…”�”}”(hjTh²hh³Nh´Nubj )�”}”(hŒ``suspend_late``”h]”hŒ suspend_late”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjTubhŒ and ”…”�”}”(hjTh²hh³Nh´Nubj )�”}”(hŒ``suspend_noirq``”h]”hŒ suspend_noirq”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjTubhŒ€ phases as well as all of the corresponding phases of the subsequent device resume for all of these devices. In that case, the ”…”�”}”(hjTh²hh³Nh´Nubj )�”}”(hŒ``->complete``”h]”hŒ ->complete”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjTubhŒ1 callback will be the next one invoked after the ”…”�”}”(hjTh²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjTubhŒd callback and is entirely responsible for putting the device into a consistent state as appropriate.”…”�”}”(hjTh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MNhjìubjŸ)�”}”(hX}Note that this direct-complete procedure applies even if the device is disabled for runtime PM; only the runtime-PM status matters. It follows that if a device has system-sleep callbacks but does not support runtime PM, then its prepare callback must never return a positive value. This is because all such devices are initially set to runtime-suspended with runtime PM disabled.”h]”hX}Note that this direct-complete procedure applies even if the device is disabled for runtime PM; only the runtime-PM status matters. It follows that if a device has system-sleep callbacks but does not support runtime PM, then its prepare callback must never return a positive value. This is because all such devices are initially set to runtime-suspended with runtime PM disabled.”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M\hjìubjŸ)�”}”(hXGThis feature also can be controlled by device drivers by using the ``DPM_FLAG_NO_DIRECT_COMPLETE`` and ``DPM_FLAG_SMART_PREPARE`` driver power management flags. [Typically, they are set at the time the driver is probed against the device in question by passing them to the :c:func:`dev_pm_set_driver_flags` helper function.] If the first of these flags is set, the PM core will not apply the direct-complete procedure described above to the given device and, consequently, to any of its ancestors. The second flag, when set, informs the middle layer code (bus types, device types, PM domains, classes) that it should take the return value of the ``->prepare`` callback provided by the driver into account and it may only return a positive value from its own ``->prepare`` callback if the driver's one also has returned a positive value.”h]”(hŒCThis feature also can be controlled by device drivers by using the ”…”�”}”(hjÊh²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_NO_DIRECT_COMPLETE``”h]”hŒDPM_FLAG_NO_DIRECT_COMPLETE”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÊubhŒ and ”…”�”}”(hjÊh²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_PREPARE``”h]”hŒDPM_FLAG_SMART_PREPARE”…”�”}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÊubhŒ‘ driver power management flags. [Typically, they are set at the time the driver is probed against the device in question by passing them to the ”…”�”}”(hjÊh²hh³Nh´Nubh)�”}”(hŒ!:c:func:`dev_pm_set_driver_flags`”h]”j )�”}”(hjøh]”hŒdev_pm_set_driver_flags()”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjöubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdev_pm_set_driver_flags”uh1hh³hÇh´MchjÊubhXV helper function.] If the first of these flags is set, the PM core will not apply the direct-complete procedure described above to the given device and, consequently, to any of its ancestors. The second flag, when set, informs the middle layer code (bus types, device types, PM domains, classes) that it should take the return value of the ”…”�”}”(hjÊh²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÊubhŒc callback provided by the driver into account and it may only return a positive value from its own ”…”�”}”(hjÊh²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÊubhŒC callback if the driver’s one also has returned a positive value.”…”�”}”(hjÊh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mchjìubeh}”(h]”h ]”h"]”h$]”h&]”uh1jï hjéubjð )�”}”(hX`The ``->suspend`` methods should quiesce the device to stop it from performing I/O. They also may save the device registers and put it into the appropriate low-power state, depending on the bus type the device is on, and they may enable wakeup events. However, for devices supporting runtime power management, the ``->suspend`` methods provided by subsystems (bus types and PM domains in particular) must follow an additional rule regarding what can be done to the devices before their drivers' ``->suspend`` methods are called. Namely, they may resume the devices from runtime suspend by calling :c:func:`pm_runtime_resume` for them, if that is necessary, but they must not update the state of the devices in any other way at that time (in case the drivers need to resume the devices from runtime suspend in their ``->suspend`` methods). In fact, the PM core prevents subsystems or drivers from putting devices into runtime suspend at these times by calling :c:func:`pm_runtime_get_noresume` before issuing the ``->prepare`` callback (and calling :c:func:`pm_runtime_put` after issuing the ``->complete`` callback). ”h]”(jŸ)�”}”(hŒüThe ``->suspend`` methods should quiesce the device to stop it from performing I/O. They also may save the device registers and put it into the appropriate low-power state, depending on the bus type the device is on, and they may enable wakeup events.”h]”(hŒThe ”…”�”}”(hjMh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjMubhŒë methods should quiesce the device to stop it from performing I/O. They also may save the device registers and put it into the appropriate low-power state, depending on the bus type the device is on, and they may enable wakeup events.”…”�”}”(hjMh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MqhjIubjŸ)�”}”(hXaHowever, for devices supporting runtime power management, the ``->suspend`` methods provided by subsystems (bus types and PM domains in particular) must follow an additional rule regarding what can be done to the devices before their drivers' ``->suspend`` methods are called. Namely, they may resume the devices from runtime suspend by calling :c:func:`pm_runtime_resume` for them, if that is necessary, but they must not update the state of the devices in any other way at that time (in case the drivers need to resume the devices from runtime suspend in their ``->suspend`` methods). In fact, the PM core prevents subsystems or drivers from putting devices into runtime suspend at these times by calling :c:func:`pm_runtime_get_noresume` before issuing the ``->prepare`` callback (and calling :c:func:`pm_runtime_put` after issuing the ``->complete`` callback).”h]”(hŒ>However, for devices supporting runtime power management, the ”…”�”}”(hjmh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjmubhŒª methods provided by subsystems (bus types and PM domains in particular) must follow an additional rule regarding what can be done to the devices before their drivers’ ”…”�”}”(hjmh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjmubhŒY methods are called. Namely, they may resume the devices from runtime suspend by calling ”…”�”}”(hjmh²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_resume`”h]”j )�”}”(hj›h]”hŒpm_runtime_resume()”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj™ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_resume”uh1hh³hÇh´MvhjmubhŒ¿ for them, if that is necessary, but they must not update the state of the devices in any other way at that time (in case the drivers need to resume the devices from runtime suspend in their ”…”�”}”(hjmh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjmubhŒ„ methods). In fact, the PM core prevents subsystems or drivers from putting devices into runtime suspend at these times by calling ”…”�”}”(hjmh²hh³Nh´Nubh)�”}”(hŒ!:c:func:`pm_runtime_get_noresume`”h]”j )�”}”(hjÐh]”hŒpm_runtime_get_noresume()”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjÎubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_get_noresume”uh1hh³hÇh´MvhjmubhŒ before issuing the ”…”�”}”(hjmh²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjmubhŒ callback (and calling ”…”�”}”(hjmh²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_put`”h]”j )�”}”(hjh]”hŒpm_runtime_put()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_put”uh1hh³hÇh´MvhjmubhŒ after issuing the ”…”�”}”(hjmh²hh³Nh´Nubj )�”}”(hŒ``->complete``”h]”hŒ ->complete”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjmubhŒ callback).”…”�”}”(hjmh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MvhjIubeh}”(h]”h ]”h"]”h$]”h&]”uh1jï hjéubjð )�”}”(hXFor a number of devices it is convenient to split suspend into the "quiesce device" and "save device state" phases, in which cases ``suspend_late`` is meant to do the latter. It is always executed after runtime power management has been disabled for the device in question. ”h]”jŸ)�”}”(hXFor a number of devices it is convenient to split suspend into the "quiesce device" and "save device state" phases, in which cases ``suspend_late`` is meant to do the latter. It is always executed after runtime power management has been disabled for the device in question.”h]”(hŒ‹For a number of devices it is convenient to split suspend into the “quiesce deviceâ€� and “save device stateâ€� phases, in which cases ”…”�”}”(hjHh²hh³Nh´Nubj )�”}”(hŒ``suspend_late``”h]”hŒ suspend_late”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjHubhŒ is meant to do the latter. It is always executed after runtime power management has been disabled for the device in question.”…”�”}”(hjHh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M„hjDubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjéubjð )�”}”(hXÆThe ``suspend_noirq`` phase occurs after IRQ handlers have been disabled, which means that the driver's interrupt handler will not be called while the callback method is running. The ``->suspend_noirq`` methods should save the values of the device's registers that weren't saved previously and finally put the device into the appropriate low-power state. The majority of subsystems and device drivers need not implement this callback. However, bus types allowing devices to share interrupt vectors, like PCI, generally need it; otherwise a driver might encounter an error during the suspend phase by fielding a shared interrupt generated by some other device after its own device had been set to low power. ”h]”(jŸ)�”}”(hXcThe ``suspend_noirq`` phase occurs after IRQ handlers have been disabled, which means that the driver's interrupt handler will not be called while the callback method is running. The ``->suspend_noirq`` methods should save the values of the device's registers that weren't saved previously and finally put the device into the appropriate low-power state.”h]”(hŒThe ”…”�”}”(hjrh²hh³Nh´Nubj )�”}”(hŒ``suspend_noirq``”h]”hŒ suspend_noirq”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjrubhŒ¥ phase occurs after IRQ handlers have been disabled, which means that the driver’s interrupt handler will not be called while the callback method is running. The ”…”�”}”(hjrh²hh³Nh´Nubj )�”}”(hŒ``->suspend_noirq``”h]”hŒ->suspend_noirq”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjrubhŒœ methods should save the values of the device’s registers that weren’t saved previously and finally put the device into the appropriate low-power state.”…”�”}”(hjrh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M‰hjnubjŸ)�”}”(hX`The majority of subsystems and device drivers need not implement this callback. However, bus types allowing devices to share interrupt vectors, like PCI, generally need it; otherwise a driver might encounter an error during the suspend phase by fielding a shared interrupt generated by some other device after its own device had been set to low power.”h]”hX`The majority of subsystems and device drivers need not implement this callback. However, bus types allowing devices to share interrupt vectors, like PCI, generally need it; otherwise a driver might encounter an error during the suspend phase by fielding a shared interrupt generated by some other device after its own device had been set to low power.”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M�hjnubeh}”(h]”h ]”h"]”h$]”h&]”uh1jï hjéubeh}”(h]”h ]”h"]”h$]”h&]”jjjhj j!uh1jê hjåubah}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´M>hj~h²hubjŸ)�”}”(hXÌAt the end of these phases, drivers should have stopped all I/O transactions (DMA, IRQs), saved enough state that they can re-initialize or restore previous state (as needed by the hardware), and placed the device into a low-power state. On many platforms they will gate off one or more clock sources; sometimes they will also switch off power supplies or reduce voltages. [Drivers supporting runtime PM may already have performed some or all of these steps.]”h]”hXÌAt the end of these phases, drivers should have stopped all I/O transactions (DMA, IRQs), saved enough state that they can re-initialize or restore previous state (as needed by the hardware), and placed the device into a low-power state. On many platforms they will gate off one or more clock sources; sometimes they will also switch off power supplies or reduce voltages. [Drivers supporting runtime PM may already have performed some or all of these steps.]”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M–hj~h²hubjŸ)�”}”(hX†If :c:func:`device_may_wakeup()` returns ``true``, the device should be prepared for generating hardware wakeup signals to trigger a system wakeup event when the system is in the sleep state. For example, :c:func:`enable_irq_wake()` might identify GPIO signals hooked up to a switch or other external hardware, and :c:func:`pci_enable_wake()` does something similar for the PCI PME signal.”h]”(hŒIf ”…”�”}”(hjÒh²hh³Nh´Nubh)�”}”(hŒ:c:func:`device_may_wakeup()`”h]”j )�”}”(hjÜh]”hŒdevice_may_wakeup()”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjÚubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdevice_may_wakeup”uh1hh³hÇh´M�hjÒubhŒ returns ”…”�”}”(hjÒh²hh³Nh´Nubj )�”}”(hŒ``true``”h]”hŒtrue”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÒubhŒ�, the device should be prepared for generating hardware wakeup signals to trigger a system wakeup event when the system is in the sleep state. For example, ”…”�”}”(hjÒh²hh³Nh´Nubh)�”}”(hŒ:c:func:`enable_irq_wake()`”h]”j )�”}”(hjh]”hŒenable_irq_wake()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œenable_irq_wake”uh1hh³hÇh´M�hjÒubhŒS might identify GPIO signals hooked up to a switch or other external hardware, and ”…”�”}”(hjÒh²hh³Nh´Nubh)�”}”(hŒ:c:func:`pci_enable_wake()`”h]”j )�”}”(hj4h]”hŒpci_enable_wake()”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj2ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpci_enable_wake”uh1hh³hÇh´M�hjÒubhŒ/ does something similar for the PCI PME signal.”…”�”}”(hjÒh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M�hj~h²hubjŸ)�”}”(hŒ¾If any of these callbacks returns an error, the system won't enter the desired low-power state. Instead, the PM core will unwind its actions by resuming all the devices that were suspended.”h]”hŒÀIf any of these callbacks returns an error, the system won’t enter the desired low-power state. Instead, the PM core will unwind its actions by resuming all the devices that were suspended.”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M£hj~h²hubeh}”(h]”Œentering-system-suspend”ah ]”h"]”Œentering system suspend”ah$]”h&]”uh1jihjÁ h²hh³hÇh´M9ubjj)�”}”(hhh]”(jo)�”}”(hŒLeaving System Suspend”h]”hŒLeaving System Suspend”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjqh²hh³hÇh´M©ubjŸ)�”}”(hŒ�When resuming from freeze, standby or memory sleep, the phases are: ``resume_noirq``, ``resume_early``, ``resume``, ``complete``.”h]”(hŒDWhen resuming from freeze, standby or memory sleep, the phases are: ”…”�”}”(hj‚h²hh³Nh´Nubj )�”}”(hŒ``resume_noirq``”h]”hŒ resume_noirq”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj‚ubhŒ, ”…”�”}”(hj‚h²hh³Nh´Nubj )�”}”(hŒ``resume_early``”h]”hŒ resume_early”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj‚ubhŒ, ”…”�”}”hj‚sbj )�”}”(hŒ ``resume``”h]”hŒresume”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj‚ubhŒ, ”…”�”}”hj‚sbj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj‚ubhŒ.”…”�”}”(hj‚h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M«hjqh²hubjÑ)�”}”(hXå 1. The ``->resume_noirq`` callback methods should perform any actions needed before the driver's interrupt handlers are invoked. This generally means undoing the actions of the ``suspend_noirq`` phase. If the bus type permits devices to share interrupt vectors, like PCI, the method should bring the device and its driver into a state in which the driver can recognize if the device is the source of incoming interrupts, if any, and handle them correctly. For example, the PCI bus type's ``->pm.resume_noirq()`` puts the device into the full-power state (D0 in the PCI terminology) and restores the standard configuration registers of the device. Then it calls the device driver's ``->pm.resume_noirq()`` method to perform device-specific actions. 2. The ``->resume_early`` methods should prepare devices for the execution of the resume methods. This generally involves undoing the actions of the preceding ``suspend_late`` phase. 3. The ``->resume`` methods should bring the device back to its operating state, so that it can perform normal I/O. This generally involves undoing the actions of the ``suspend`` phase. 4. The ``complete`` phase should undo the actions of the ``prepare`` phase. For this reason, unlike the other resume-related phases, during the ``complete`` phase the device hierarchy is traversed bottom-up. Note, however, that new children may be registered below the device as soon as the ``->resume`` callbacks occur; it's not necessary to wait until the ``complete`` phase runs. Moreover, if the preceding ``->prepare`` callback returned a positive number, the device may have been left in runtime suspend throughout the whole system suspend and resume (its ``->suspend``, ``->suspend_late``, ``->suspend_noirq``, ``->resume_noirq``, ``->resume_early``, and ``->resume`` callbacks may have been skipped). In that case, the ``->complete`` callback is entirely responsible for putting the device into a consistent state after system suspend if necessary. [For example, it may need to queue up a runtime resume request for the device for this purpose.] To check if that is the case, the ``->complete`` callback can consult the device's ``power.direct_complete`` flag. If that flag is set when the ``->complete`` callback is being run then the direct-complete mechanism was used, and special actions may be required to make the device work correctly afterward. ”h]”jë )�”}”(hhh]”(jð )�”}”(hXíThe ``->resume_noirq`` callback methods should perform any actions needed before the driver's interrupt handlers are invoked. This generally means undoing the actions of the ``suspend_noirq`` phase. If the bus type permits devices to share interrupt vectors, like PCI, the method should bring the device and its driver into a state in which the driver can recognize if the device is the source of incoming interrupts, if any, and handle them correctly. For example, the PCI bus type's ``->pm.resume_noirq()`` puts the device into the full-power state (D0 in the PCI terminology) and restores the standard configuration registers of the device. Then it calls the device driver's ``->pm.resume_noirq()`` method to perform device-specific actions. ”h]”(jŸ)�”}”(hXÆThe ``->resume_noirq`` callback methods should perform any actions needed before the driver's interrupt handlers are invoked. This generally means undoing the actions of the ``suspend_noirq`` phase. If the bus type permits devices to share interrupt vectors, like PCI, the method should bring the device and its driver into a state in which the driver can recognize if the device is the source of incoming interrupts, if any, and handle them correctly.”h]”(hŒThe ”…”�”}”(hjãh²hh³Nh´Nubj )�”}”(hŒ``->resume_noirq``”h]”hŒ->resume_noirq”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjãubhŒ› callback methods should perform any actions needed before the driver’s interrupt handlers are invoked. This generally means undoing the actions of the ”…”�”}”(hjãh²hh³Nh´Nubj )�”}”(hŒ``suspend_noirq``”h]”hŒ suspend_noirq”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjãubhX phase. If the bus type permits devices to share interrupt vectors, like PCI, the method should bring the device and its driver into a state in which the driver can recognize if the device is the source of incoming interrupts, if any, and handle them correctly.”…”�”}”(hjãh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M®hjßubjŸ)�”}”(hX$For example, the PCI bus type's ``->pm.resume_noirq()`` puts the device into the full-power state (D0 in the PCI terminology) and restores the standard configuration registers of the device. Then it calls the device driver's ``->pm.resume_noirq()`` method to perform device-specific actions.”h]”(hŒ"For example, the PCI bus type’s ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``->pm.resume_noirq()``”h]”hŒ->pm.resume_noirq()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ­ puts the device into the full-power state (D0 in the PCI terminology) and restores the standard configuration registers of the device. Then it calls the device driver’s ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``->pm.resume_noirq()``”h]”hŒ->pm.resume_noirq()”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ+ method to perform device-specific actions.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M¶hjßubeh}”(h]”h ]”h"]”h$]”h&]”uh1jï hjÜubjð )�”}”(hŒµThe ``->resume_early`` methods should prepare devices for the execution of the resume methods. This generally involves undoing the actions of the preceding ``suspend_late`` phase. ”h]”jŸ)�”}”(hŒ´The ``->resume_early`` methods should prepare devices for the execution of the resume methods. This generally involves undoing the actions of the preceding ``suspend_late`` phase.”h]”(hŒThe ”…”�”}”(hjQh²hh³Nh´Nubj )�”}”(hŒ``->resume_early``”h]”hŒ->resume_early”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjQubhŒ‡ methods should prepare devices for the execution of the resume methods. This generally involves undoing the actions of the preceding ”…”�”}”(hjQh²hh³Nh´Nubj )�”}”(hŒ``suspend_late``”h]”hŒ suspend_late”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjQubhŒ phase.”…”�”}”(hjQh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M¼hjMubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjÜubjð )�”}”(hŒ¸The ``->resume`` methods should bring the device back to its operating state, so that it can perform normal I/O. This generally involves undoing the actions of the ``suspend`` phase. ”h]”jŸ)�”}”(hŒ·The ``->resume`` methods should bring the device back to its operating state, so that it can perform normal I/O. This generally involves undoing the actions of the ``suspend`` phase.”h]”(hŒThe ”…”�”}”(hj�h²hh³Nh´Nubj )�”}”(hŒ ``->resume``”h]”hŒ->resume”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj�ubhŒ• methods should bring the device back to its operating state, so that it can perform normal I/O. This generally involves undoing the actions of the ”…”�”}”(hj�h²hh³Nh´Nubj )�”}”(hŒ ``suspend``”h]”hŒsuspend”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj�ubhŒ phase.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÀhj‰ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjÜubjð )�”}”(hXðThe ``complete`` phase should undo the actions of the ``prepare`` phase. For this reason, unlike the other resume-related phases, during the ``complete`` phase the device hierarchy is traversed bottom-up. Note, however, that new children may be registered below the device as soon as the ``->resume`` callbacks occur; it's not necessary to wait until the ``complete`` phase runs. Moreover, if the preceding ``->prepare`` callback returned a positive number, the device may have been left in runtime suspend throughout the whole system suspend and resume (its ``->suspend``, ``->suspend_late``, ``->suspend_noirq``, ``->resume_noirq``, ``->resume_early``, and ``->resume`` callbacks may have been skipped). In that case, the ``->complete`` callback is entirely responsible for putting the device into a consistent state after system suspend if necessary. [For example, it may need to queue up a runtime resume request for the device for this purpose.] To check if that is the case, the ``->complete`` callback can consult the device's ``power.direct_complete`` flag. If that flag is set when the ``->complete`` callback is being run then the direct-complete mechanism was used, and special actions may be required to make the device work correctly afterward. ”h]”(jŸ)�”}”(hŒÌThe ``complete`` phase should undo the actions of the ``prepare`` phase. For this reason, unlike the other resume-related phases, during the ``complete`` phase the device hierarchy is traversed bottom-up.”h]”(hŒThe ”…”�”}”(hjÉh²hh³Nh´Nubj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÉubhŒ& phase should undo the actions of the ”…”�”}”(hjÉh²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÉubhŒL phase. For this reason, unlike the other resume-related phases, during the ”…”�”}”(hjÉh²hh³Nh´Nubj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÉubhŒ3 phase the device hierarchy is traversed bottom-up.”…”�”}”(hjÉh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÄhjÅubjŸ)�”}”(hŒ®Note, however, that new children may be registered below the device as soon as the ``->resume`` callbacks occur; it's not necessary to wait until the ``complete`` phase runs.”h]”(hŒSNote, however, that new children may be registered below the device as soon as the ”…”�”}”(hj h²hh³Nh´Nubj )�”}”(hŒ ``->resume``”h]”hŒ->resume”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj ubhŒ9 callbacks occur; it’s not necessary to wait until the ”…”�”}”(hj h²hh³Nh´Nubj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj ubhŒ phase runs.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÈhjÅubjŸ)�”}”(hXqMoreover, if the preceding ``->prepare`` callback returned a positive number, the device may have been left in runtime suspend throughout the whole system suspend and resume (its ``->suspend``, ``->suspend_late``, ``->suspend_noirq``, ``->resume_noirq``, ``->resume_early``, and ``->resume`` callbacks may have been skipped). In that case, the ``->complete`` callback is entirely responsible for putting the device into a consistent state after system suspend if necessary. [For example, it may need to queue up a runtime resume request for the device for this purpose.] To check if that is the case, the ``->complete`` callback can consult the device's ``power.direct_complete`` flag. If that flag is set when the ``->complete`` callback is being run then the direct-complete mechanism was used, and special actions may be required to make the device work correctly afterward.”h]”(hŒMoreover, if the preceding ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ‹ callback returned a positive number, the device may have been left in runtime suspend throughout the whole system suspend and resume (its ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ, ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ``->suspend_late``”h]”hŒ->suspend_late”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ, ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ``->suspend_noirq``”h]”hŒ->suspend_noirq”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ, ”…”�”}”hj?sbj )�”}”(hŒ``->resume_noirq``”h]”hŒ->resume_noirq”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ, ”…”�”}”hj?sbj )�”}”(hŒ``->resume_early``”h]”hŒ->resume_early”…”�”}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ, and ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ ``->resume``”h]”hŒ->resume”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ6 callbacks may have been skipped). In that case, the ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ``->complete``”h]”hŒ ->complete”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒù callback is entirely responsible for putting the device into a consistent state after system suspend if necessary. [For example, it may need to queue up a runtime resume request for the device for this purpose.] To check if that is the case, the ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ``->complete``”h]”hŒ ->complete”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ% callback can consult the device’s ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ``power.direct_complete``”h]”hŒpower.direct_complete”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ% flag. If that flag is set when the ”…”�”}”(hj?h²hh³Nh´Nubj )�”}”(hŒ``->complete``”h]”hŒ ->complete”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj?ubhŒ” callback is being run then the direct-complete mechanism was used, and special actions may be required to make the device work correctly afterward.”…”�”}”(hj?h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÌhjÅubeh}”(h]”h ]”h"]”h$]”h&]”uh1jï hjÜubeh}”(h]”h ]”h"]”h$]”h&]”jjjhj j!uh1jê hjØubah}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´M®hjqh²hubjŸ)�”}”(hŒªAt the end of these phases, drivers should be as functional as they were before suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are gated on.”h]”hŒªAt the end of these phases, drivers should be as functional as they were before suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are gated on.”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÛhjqh²hubjŸ)�”}”(hXBHowever, the details here may again be platform-specific. For example, some systems support multiple "run" states, and the mode in effect at the end of resume might not be the one which preceded suspension. That means availability of certain clocks or power supplies changed, which could easily affect how a driver works.”h]”hXFHowever, the details here may again be platform-specific. For example, some systems support multiple “runâ€� states, and the mode in effect at the end of resume might not be the one which preceded suspension. That means availability of certain clocks or power supplies changed, which could easily affect how a driver works.”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mßhjqh²hubjŸ)�”}”(hX"Drivers need to be able to handle hardware which has been reset since all of the suspend methods were called, for example by complete reinitialization. This may be the hardest part, and the one most protected by NDA'd documents and chip errata. It's simplest if the hardware state hasn't changed since the suspend was carried out, but that can only be guaranteed if the target system sleep entered was suspend-to-idle. For the other system sleep states that may not be the case (and usually isn't for ACPI-defined system sleep states, like S3).”h]”hX*Drivers need to be able to handle hardware which has been reset since all of the suspend methods were called, for example by complete reinitialization. This may be the hardest part, and the one most protected by NDA’d documents and chip errata. It’s simplest if the hardware state hasn’t changed since the suspend was carried out, but that can only be guaranteed if the target system sleep entered was suspend-to-idle. For the other system sleep states that may not be the case (and usually isn’t for ACPI-defined system sleep states, like S3).”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Måhjqh²hubjŸ)�”}”(hXŽDrivers must also be prepared to notice that the device has been removed while the system was powered down, whenever that's physically possible. PCMCIA, MMC, USB, Firewire, SCSI, and even IDE are common examples of buses where common Linux platforms will see such removal. Details of how drivers will notice and handle such removals are currently bus-specific, and often involve a separate thread.”h]”hX�Drivers must also be prepared to notice that the device has been removed while the system was powered down, whenever that’s physically possible. PCMCIA, MMC, USB, Firewire, SCSI, and even IDE are common examples of buses where common Linux platforms will see such removal. Details of how drivers will notice and handle such removals are currently bus-specific, and often involve a separate thread.”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mîhjqh²hubjŸ)�”}”(hŒ©These callbacks may return an error value, but the PM core will ignore such errors since there's nothing it can do about them other than printing them in the system log.”h]”hŒ«These callbacks may return an error value, but the PM core will ignore such errors since there’s nothing it can do about them other than printing them in the system log.”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mõhjqh²hubeh}”(h]”Œleaving-system-suspend”ah ]”h"]”Œleaving system suspend”ah$]”h&]”uh1jihjÁ h²hh³hÇh´M©ubjj)�”}”(hhh]”(jo)�”}”(hŒEntering Hibernation”h]”hŒEntering Hibernation”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjsh²hh³hÇh´MûubjŸ)�”}”(hX2Hibernating the system is more complicated than putting it into sleep states, because it involves creating and saving a system image. Therefore there are more phases for hibernation, with a different set of callbacks. These phases always run after tasks have been frozen and enough memory has been freed.”h]”hX2Hibernating the system is more complicated than putting it into sleep states, because it involves creating and saving a system image. Therefore there are more phases for hibernation, with a different set of callbacks. These phases always run after tasks have been frozen and enough memory has been freed.”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mýhjsh²hubjŸ)�”}”(hXâThe general procedure for hibernation is to quiesce all devices ("freeze"), create an image of the system memory while everything is stable, reactivate all devices ("thaw"), write the image to permanent storage, and finally shut down the system ("power off"). The phases used to accomplish this are: ``prepare``, ``freeze``, ``freeze_late``, ``freeze_noirq``, ``thaw_noirq``, ``thaw_early``, ``thaw``, ``complete``, ``prepare``, ``poweroff``, ``poweroff_late``, ``poweroff_noirq``.”h]”(hX9The general procedure for hibernation is to quiesce all devices (“freezeâ€�), create an image of the system memory while everything is stable, reactivate all devices (“thawâ€�), write the image to permanent storage, and finally shut down the system (“power offâ€�). The phases used to accomplish this are: ”…”�”}”(hj’h²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”(hj’h²hh³Nh´Nubj )�”}”(hŒ ``freeze``”h]”hŒfreeze”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”(hj’h²hh³Nh´Nubj )�”}”(hŒ``freeze_late``”h]”hŒ freeze_late”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ``freeze_noirq``”h]”hŒ freeze_noirq”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ``thaw_noirq``”h]”hŒ thaw_noirq”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ``thaw_early``”h]”hŒ thaw_early”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ``thaw``”h]”hŒthaw”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ ``poweroff``”h]”hŒpoweroff”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ``poweroff_late``”h]”hŒ poweroff_late”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ, ”…”�”}”hj’sbj )�”}”(hŒ``poweroff_noirq``”h]”hŒpoweroff_noirq”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj’ubhŒ.”…”�”}”(hj’h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhjsh²hubjÑ)�”}”(hXq1. The ``prepare`` phase is discussed in the "Entering System Suspend" section above. 2. The ``->freeze`` methods should quiesce the device so that it doesn't generate IRQs or DMA, and they may need to save the values of device registers. However the device does not have to be put in a low-power state, and to save time it's best not to do so. Also, the device should not be prepared to generate wakeup events. 3. The ``freeze_late`` phase is analogous to the ``suspend_late`` phase described earlier, except that the device should not be put into a low-power state and should not be allowed to generate wakeup events. 4. The ``freeze_noirq`` phase is analogous to the ``suspend_noirq`` phase discussed earlier, except again that the device should not be put into a low-power state and should not be allowed to generate wakeup events. ”h]”jë )�”}”(hhh]”(jð )�”}”(hŒSThe ``prepare`` phase is discussed in the "Entering System Suspend" section above. ”h]”jŸ)�”}”(hŒRThe ``prepare`` phase is discussed in the "Entering System Suspend" section above.”h]”(hŒThe ”…”�”}”(hjƒh²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjƒubhŒG phase is discussed in the “Entering System Suspendâ€� section above.”…”�”}”(hjƒh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj|ubjð )�”}”(hXEThe ``->freeze`` methods should quiesce the device so that it doesn't generate IRQs or DMA, and they may need to save the values of device registers. However the device does not have to be put in a low-power state, and to save time it's best not to do so. Also, the device should not be prepared to generate wakeup events. ”h]”jŸ)�”}”(hXDThe ``->freeze`` methods should quiesce the device so that it doesn't generate IRQs or DMA, and they may need to save the values of device registers. However the device does not have to be put in a low-power state, and to save time it's best not to do so. Also, the device should not be prepared to generate wakeup events.”h]”(hŒThe ”…”�”}”(hj­h²hh³Nh´Nubj )�”}”(hŒ ``->freeze``”h]”hŒ->freeze”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj­ubhX8 methods should quiesce the device so that it doesn’t generate IRQs or DMA, and they may need to save the values of device registers. However the device does not have to be put in a low-power state, and to save time it’s best not to do so. Also, the device should not be prepared to generate wakeup events.”…”�”}”(hj­h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M hj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj|ubjð )�”}”(hŒÍThe ``freeze_late`` phase is analogous to the ``suspend_late`` phase described earlier, except that the device should not be put into a low-power state and should not be allowed to generate wakeup events. ”h]”jŸ)�”}”(hŒÌThe ``freeze_late`` phase is analogous to the ``suspend_late`` phase described earlier, except that the device should not be put into a low-power state and should not be allowed to generate wakeup events.”h]”(hŒThe ”…”�”}”(hj×h²hh³Nh´Nubj )�”}”(hŒ``freeze_late``”h]”hŒ freeze_late”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj×ubhŒ phase is analogous to the ”…”�”}”(hj×h²hh³Nh´Nubj )�”}”(hŒ``suspend_late``”h]”hŒ suspend_late”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj×ubhŒŽ phase described earlier, except that the device should not be put into a low-power state and should not be allowed to generate wakeup events.”…”�”}”(hj×h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MhjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj|ubjð )�”}”(hŒÕThe ``freeze_noirq`` phase is analogous to the ``suspend_noirq`` phase discussed earlier, except again that the device should not be put into a low-power state and should not be allowed to generate wakeup events. ”h]”jŸ)�”}”(hŒÔThe ``freeze_noirq`` phase is analogous to the ``suspend_noirq`` phase discussed earlier, except again that the device should not be put into a low-power state and should not be allowed to generate wakeup events.”h]”(hŒThe ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``freeze_noirq``”h]”hŒ freeze_noirq”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ phase is analogous to the ”…”�”}”(hjh²hh³Nh´Nubj )�”}”(hŒ``suspend_noirq``”h]”hŒ suspend_noirq”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubhŒ” phase discussed earlier, except again that the device should not be put into a low-power state and should not be allowed to generate wakeup events.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj|ubeh}”(h]”h ]”h"]”h$]”h&]”jjjhj j!uh1jê hjxubah}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´M hjsh²hubjŸ)�”}”(hŒÓAt this point the system image is created. All devices should be inactive and the contents of memory should remain undisturbed while this happens, so that the image forms an atomic snapshot of the system state.”h]”hŒÓAt this point the system image is created. All devices should be inactive and the contents of memory should remain undisturbed while this happens, so that the image forms an atomic snapshot of the system state.”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhjsh²hubjÑ)�”}”(hXÎ5. The ``thaw_noirq`` phase is analogous to the ``resume_noirq`` phase discussed earlier. The main difference is that its methods can assume the device is in the same state as at the end of the ``freeze_noirq`` phase. 6. The ``thaw_early`` phase is analogous to the ``resume_early`` phase described above. Its methods should undo the actions of the preceding ``freeze_late``, if necessary. 7. The ``thaw`` phase is analogous to the ``resume`` phase discussed earlier. Its methods should bring the device back to an operating state, so that it can be used for saving the image if necessary. 8. The ``complete`` phase is discussed in the "Leaving System Suspend" section above. ”h]”jë )�”}”(hhh]”(jð )�”}”(hŒØThe ``thaw_noirq`` phase is analogous to the ``resume_noirq`` phase discussed earlier. The main difference is that its methods can assume the device is in the same state as at the end of the ``freeze_noirq`` phase. ”h]”jŸ)�”}”(hŒ×The ``thaw_noirq`` phase is analogous to the ``resume_noirq`` phase discussed earlier. The main difference is that its methods can assume the device is in the same state as at the end of the ``freeze_noirq`` phase.”•h]”(hŒThe ”…”�”}”(hjph²hh³Nh´Nubj )�”}”(hŒ``thaw_noirq``”h]”hŒ thaw_noirq”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjpubhŒ phase is analogous to the ”…”�”}”(hjph²hh³Nh´Nubj )�”}”(hŒ``resume_noirq``”h]”hŒ resume_noirq”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjpubhŒƒ phase discussed earlier. The main difference is that its methods can assume the device is in the same state as at the end of the ”…”�”}”(hjph²hh³Nh´Nubj )�”}”(hŒ``freeze_noirq``”h]”hŒ freeze_noirq”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjpubhŒ phase.”…”�”}”(hjph²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjiubjð )�”}”(hŒªThe ``thaw_early`` phase is analogous to the ``resume_early`` phase described above. Its methods should undo the actions of the preceding ``freeze_late``, if necessary. ”h]”jŸ)�”}”(hŒ©The ``thaw_early`` phase is analogous to the ``resume_early`` phase described above. Its methods should undo the actions of the preceding ``freeze_late``, if necessary.”h]”(hŒThe ”…”�”}”(hj¾h²hh³Nh´Nubj )�”}”(hŒ``thaw_early``”h]”hŒ thaw_early”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj¾ubhŒ phase is analogous to the ”…”�”}”(hj¾h²hh³Nh´Nubj )�”}”(hŒ``resume_early``”h]”hŒ resume_early”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj¾ubhŒN phase described above. Its methods should undo the actions of the preceding ”…”�”}”(hj¾h²hh³Nh´Nubj )�”}”(hŒ``freeze_late``”h]”hŒ freeze_late”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj¾ubhŒ, if necessary.”…”�”}”(hj¾h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M$hjºubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjiubjð )�”}”(hŒÆThe ``thaw`` phase is analogous to the ``resume`` phase discussed earlier. Its methods should bring the device back to an operating state, so that it can be used for saving the image if necessary. ”h]”jŸ)�”}”(hŒÅThe ``thaw`` phase is analogous to the ``resume`` phase discussed earlier. Its methods should bring the device back to an operating state, so that it can be used for saving the image if necessary.”h]”(hŒThe ”…”�”}”(hj h²hh³Nh´Nubj )�”}”(hŒ``thaw``”h]”hŒthaw”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj ubhŒ phase is analogous to the ”…”�”}”(hj h²hh³Nh´Nubj )�”}”(hŒ ``resume``”h]”hŒresume”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj ubhŒ” phase discussed earlier. Its methods should bring the device back to an operating state, so that it can be used for saving the image if necessary.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M(hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjiubjð )�”}”(hŒSThe ``complete`` phase is discussed in the "Leaving System Suspend" section above. ”h]”jŸ)�”}”(hŒRThe ``complete`` phase is discussed in the "Leaving System Suspend" section above.”h]”(hŒThe ”…”�”}”(hjHh²hh³Nh´Nubj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjHubhŒF phase is discussed in the “Leaving System Suspendâ€� section above.”…”�”}”(hjHh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M,hjDubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjiubeh}”(h]”h ]”h"]”h$]”h&]”jjjhj j!Œstart”Kuh1jê hjeubah}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´Mhjsh²hubjŸ)�”}”(hXAt this point the system image is saved, and the devices then need to be prepared for the upcoming system shutdown. This is much like suspending them before putting the system into the suspend-to-idle, shallow or deep sleep state, and the phases are similar.”h]”hXAt this point the system image is saved, and the devices then need to be prepared for the upcoming system shutdown. This is much like suspending them before putting the system into the suspend-to-idle, shallow or deep sleep state, and the phases are similar.”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M/hjsh²hubjÑ)�”}”(hX 9. The ``prepare`` phase is discussed above. 10. The ``poweroff`` phase is analogous to the ``suspend`` phase. 11. The ``poweroff_late`` phase is analogous to the ``suspend_late`` phase. 12. The ``poweroff_noirq`` phase is analogous to the ``suspend_noirq`` phase. ”h]”jë )�”}”(hhh]”(jð )�”}”(hŒ*The ``prepare`` phase is discussed above. ”h]”jŸ)�”}”(hŒ)The ``prepare`` phase is discussed above.”h]”(hŒThe ”…”�”}”(hj”h²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj”ubhŒ phase is discussed above.”…”�”}”(hj”h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M4hj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj�ubjð )�”}”(hŒ>The ``poweroff`` phase is analogous to the ``suspend`` phase. ”h]”jŸ)�”}”(hŒ=The ``poweroff`` phase is analogous to the ``suspend`` phase.”h]”(hŒThe ”…”�”}”(hj¾h²hh³Nh´Nubj )�”}”(hŒ ``poweroff``”h]”hŒpoweroff”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj¾ubhŒ phase is analogous to the ”…”�”}”(hj¾h²hh³Nh´Nubj )�”}”(hŒ ``suspend``”h]”hŒsuspend”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj¾ubhŒ phase.”…”�”}”(hj¾h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M6hjºubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj�ubjð )�”}”(hŒHThe ``poweroff_late`` phase is analogous to the ``suspend_late`` phase. ”h]”jŸ)�”}”(hŒGThe ``poweroff_late`` phase is analogous to the ``suspend_late`` phase.”h]”(hŒThe ”…”�”}”(hjúh²hh³Nh´Nubj )�”}”(hŒ``poweroff_late``”h]”hŒ poweroff_late”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjúubhŒ phase is analogous to the ”…”�”}”(hjúh²hh³Nh´Nubj )�”}”(hŒ``suspend_late``”h]”hŒ suspend_late”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjúubhŒ phase.”…”�”}”(hjúh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M8hjöubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj�ubjð )�”}”(hŒJThe ``poweroff_noirq`` phase is analogous to the ``suspend_noirq`` phase. ”h]”jŸ)�”}”(hŒIThe ``poweroff_noirq`` phase is analogous to the ``suspend_noirq`` phase.”h]”(hŒThe ”…”�”}”(hj6h²hh³Nh´Nubj )�”}”(hŒ``poweroff_noirq``”h]”hŒpoweroff_noirq”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj6ubhŒ phase is analogous to the ”…”�”}”(hj6h²hh³Nh´Nubj )�”}”(hŒ``suspend_noirq``”h]”hŒ suspend_noirq”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj6ubhŒ phase.”…”�”}”(hj6h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M:hj2ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hj�ubeh}”(h]”h ]”h"]”h$]”h&]”jjjhj j!jtK uh1jê hj‰ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÐh³hÇh´M4hjsh²hubjŸ)�”}”(hX)The ``->poweroff``, ``->poweroff_late`` and ``->poweroff_noirq`` callbacks should do essentially the same things as the ``->suspend``, ``->suspend_late`` and ``->suspend_noirq`` callbacks, respectively. A notable difference is that they need not store the device register values, because the registers should already have been stored during the ``freeze``, ``freeze_late`` or ``freeze_noirq`` phases. Also, on many machines the firmware will power-down the entire system, so it is not necessary for the callback to put the device in a low-power state.”h]”(hŒThe ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ``->poweroff``”h]”hŒ ->poweroff”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ, ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ``->poweroff_late``”h]”hŒ->poweroff_late”…”�”}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ and ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ``->poweroff_noirq``”h]”hŒ->poweroff_noirq”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ8 callbacks should do essentially the same things as the ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ, ”…”�”}”hjzsbj )�”}”(hŒ``->suspend_late``”h]”hŒ->suspend_late”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ and ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ``->suspend_noirq``”h]”hŒ->suspend_noirq”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ© callbacks, respectively. A notable difference is that they need not store the device register values, because the registers should already have been stored during the ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ ``freeze``”h]”hŒfreeze”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ, ”…”�”}”hjzsbj )�”}”(hŒ``freeze_late``”h]”hŒ freeze_late”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ or ”…”�”}”(hjzh²hh³Nh´Nubj )�”}”(hŒ``freeze_noirq``”h]”hŒ freeze_noirq”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjzubhŒ  phases. Also, on many machines the firmware will power-down the entire system, so it is not necessary for the callback to put the device in a low-power state.”…”�”}”(hjzh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M<hjsh²hubeh}”(h]”Œentering-hibernation”ah ]”h"]”Œentering hibernation”ah$]”h&]”uh1jihjÁ h²hh³hÇh´Mûubjj)�”}”(hhh]”(jo)�”}”(hŒLeaving Hibernation”h]”hŒLeaving Hibernation”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhj2h²hh³hÇh´MGubjŸ)�”}”(hX4Resuming from hibernation is, again, more complicated than resuming from a sleep state in which the contents of main memory are preserved, because it requires a system image to be loaded into memory and the pre-hibernation memory contents to be restored before control can be passed back to the image kernel.”h]”hX4Resuming from hibernation is, again, more complicated than resuming from a sleep state in which the contents of main memory are preserved, because it requires a system image to be loaded into memory and the pre-hibernation memory contents to be restored before control can be passed back to the image kernel.”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MIhj2h²hubjŸ)�”}”(hXTAlthough in principle the image might be loaded into memory and the pre-hibernation memory contents restored by the boot loader, in practice this can't be done because boot loaders aren't smart enough and there is no established protocol for passing the necessary information. So instead, the boot loader loads a fresh instance of the kernel, called "the restore kernel", into memory and passes control to it in the usual way. Then the restore kernel reads the system image, restores the pre-hibernation memory contents, and passes control to the image kernel. Thus two different kernel instances are involved in resuming from hibernation. In fact, the restore kernel may be completely different from the image kernel: a different configuration and even a different version. This has important consequences for device drivers and their subsystems.”h]”hX\Although in principle the image might be loaded into memory and the pre-hibernation memory contents restored by the boot loader, in practice this can’t be done because boot loaders aren’t smart enough and there is no established protocol for passing the necessary information. So instead, the boot loader loads a fresh instance of the kernel, called “the restore kernelâ€�, into memory and passes control to it in the usual way. Then the restore kernel reads the system image, restores the pre-hibernation memory contents, and passes control to the image kernel. Thus two different kernel instances are involved in resuming from hibernation. In fact, the restore kernel may be completely different from the image kernel: a different configuration and even a different version. This has important consequences for device drivers and their subsystems.”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MNhj2h²hubjŸ)�”}”(hX÷To be able to load the system image into memory, the restore kernel needs to include at least a subset of device drivers allowing it to access the storage medium containing the image, although it doesn't need to include all of the drivers present in the image kernel. After the image has been loaded, the devices managed by the boot kernel need to be prepared for passing control back to the image kernel. This is very similar to the initial steps involved in creating a system image, and it is accomplished in the same way, using ``prepare``, ``freeze``, and ``freeze_noirq`` phases. However, the devices affected by these phases are only those having drivers in the restore kernel; other devices will still be in whatever state the boot loader left them.”h]”(hXTo be able to load the system image into memory, the restore kernel needs to include at least a subset of device drivers allowing it to access the storage medium containing the image, although it doesn’t need to include all of the drivers present in the image kernel. After the image has been loaded, the devices managed by the boot kernel need to be prepared for passing control back to the image kernel. This is very similar to the initial steps involved in creating a system image, and it is accomplished in the same way, using ”…”�”}”(hj_h²hh³Nh´Nubj )�”}”(hŒ ``prepare``”h]”hŒprepare”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj_ubhŒ, ”…”�”}”(hj_h²hh³Nh´Nubj )�”}”(hŒ ``freeze``”h]”hŒfreeze”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj_ubhŒ, and ”…”�”}”(hj_h²hh³Nh´Nubj )�”}”(hŒ``freeze_noirq``”h]”hŒ freeze_noirq”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj_ubhŒµ phases. However, the devices affected by these phases are only those having drivers in the restore kernel; other devices will still be in whatever state the boot loader left them.”…”�”}”(hj_h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M[hj2h²hubjŸ)�”}”(hXãShould the restoration of the pre-hibernation memory contents fail, the restore kernel would go through the "thawing" procedure described above, using the ``thaw_noirq``, ``thaw_early``, ``thaw``, and ``complete`` phases, and then continue running normally. This happens only rarely. Most often the pre-hibernation memory contents are restored successfully and control is passed to the image kernel, which then becomes responsible for bringing the system back to the working state.”h]”(hŒŸShould the restoration of the pre-hibernation memory contents fail, the restore kernel would go through the “thawingâ€� procedure described above, using the ”…”�”}”(hj£h²hh³Nh´Nubj )�”}”(hŒ``thaw_noirq``”h]”hŒ thaw_noirq”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj£ubhŒ, ”…”�”}”(hj£h²hh³Nh´Nubj )�”}”(hŒ``thaw_early``”h]”hŒ thaw_early”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj£ubhŒ, ”…”�”}”hj£sbj )�”}”(hŒ``thaw``”h]”hŒthaw”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj£ubhŒ, and ”…”�”}”(hj£h²hh³Nh´Nubj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj£ubhX phases, and then continue running normally. This happens only rarely. Most often the pre-hibernation memory contents are restored successfully and control is passed to the image kernel, which then becomes responsible for bringing the system back to the working state.”…”�”}”(hj£h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mfhj2h²hubjŸ)�”}”(hX!To achieve this, the image kernel must restore the devices' pre-hibernation functionality. The operation is much like waking up from a sleep state (with the memory contents preserved), although it involves different phases: ``restore_noirq``, ``restore_early``, ``restore``, ``complete``.”h]”(hŒãTo achieve this, the image kernel must restore the devices’ pre-hibernation functionality. The operation is much like waking up from a sleep state (with the memory contents preserved), although it involves different phases: ”…”�”}”(hjùh²hh³Nh´Nubj )�”}”(hŒ``restore_noirq``”h]”hŒ restore_noirq”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjùubhŒ, ”…”�”}”(hjùh²hh³Nh´Nubj )�”}”(hŒ``restore_early``”h]”hŒ restore_early”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjùubhŒ, ”…”�”}”hjùsbj )�”}”(hŒ ``restore``”h]”hŒrestore”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjùubhŒ, ”…”�”}”hjùsbj )�”}”(hŒ ``complete``”h]”hŒcomplete”…”�”}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjùubhŒ.”…”�”}”(hjùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mnhj2h²hubjÑ)�”}”(hX 1. The ``restore_noirq`` phase is analogous to the ``resume_noirq`` phase. 2. The ``restore_early`` phase is analogous to the ``resume_early`` phase. 3. The ``restore`` phase is analogous to the ``resume`` phase. 4. The ``complete`` phase is discussed above. ”h]”jë )�”}”(hhh]”(jð )�”}”(hŒHThe ``restore_noirq`` phase is analogous to the ``resume_noirq`` phase. ”h]”jŸ)�”}”(hŒGThe ``restore_noirq`` phase is analogous to the ``resume_noirq`` phase.”h]”(hŒThe ”…”�”}”(hjZh²hh³Nh´Nubj )�”}”(hŒ``restore_noirq``”h]”hŒ restore_noirq”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjZubhŒ phase is analogous to the ”…”�”}”(hjZh²hh³Nh´Nubj )�”}”(hŒ``resume_noirq``”h]”hŒ resume_noirq”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjZubhŒ phase.”…”�”}”(hjZh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MshjVubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjSubjð )�”}”(hŒHThe ``restore_early`` phase is analogous to the ``resume_early`` phase. ”h]”jŸ)�”}”(hŒGThe ``restore_early`` phase is analogous to the ``resume_early`` phase.”h]”(hŒThe ”…”�”}”(hj–h²hh³Nh´Nubj )�”}”(hŒ``restore_early``”h]”hŒ restore_early”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj–ubhŒ phase is analogous to the ”…”�”}”(hj–h²hh³Nh´Nubj )�”}”(hŒ``resume_early``”h]”hŒ resume_early”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj–ubhŒ phase.”…”�”}”(hj–h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Muhj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1jï hjSubjð )�”}”(hŒresume[_early|_noirq]`` and ``->restore[_early|_norq]`` method pointers can be set to the same routines. Nevertheless, different callback pointers are used in case there is a situation where it actually does matter.”h]”(hŒThe main difference from ”…”�”}”(hj@h²hh³Nh´Nubj )�”}”(hŒ``resume[_early|_noirq]``”h]”hŒresume[_early|_noirq]”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒ is that ”…”�”}”(hj@h²hh³Nh´Nubj )�”}”(hŒ``restore[_early|_noirq]``”h]”hŒrestore[_early|_noirq]”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒÀ must assume the device has been accessed and reconfigured by the boot loader or the restore kernel. Consequently, the state of the device may be different from the state remembered from the ”…”�”}”(hj@h²hh³Nh´Nubj )�”}”(hŒ ``freeze``”h]”hŒfreeze”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒ, ”…”�”}”(hj@h²hh³Nh´Nubj )�”}”(hŒ``freeze_late``”h]”hŒ freeze_late”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒ and ”…”�”}”(hj@h²hh³Nh´Nubj )�”}”(hŒ``freeze_noirq``”h]”hŒ freeze_noirq”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒ† phases. The device may even need to be reset and completely re-initialized. In many cases this difference doesn’t matter, so the ”…”�”}”(hj@h²hh³Nh´Nubj )�”}”(hŒ``->resume[_early|_noirq]``”h]”hŒ->resume[_early|_noirq]”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒ and ”…”�”}”hj@sbj )�”}”(hŒ``->restore[_early|_norq]``”h]”hŒ->restore[_early|_norq]”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj@ubhŒ¡ method pointers can be set to the same routines. Nevertheless, different callback pointers are used in case there is a situation where it actually does matter.”…”�”}”(hj@h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M{hj2h²hubeh}”(h]”Œleaving-hibernation”ah ]”h"]”Œleaving hibernation”ah$]”h&]”uh1jihjÁ h²hh³hÇh´MGubeh}”(h]”Œ6calling-drivers-to-enter-and-leave-system-sleep-states”ah ]”h"]”Œ6calling drivers to enter and leave system sleep states”ah$]”h&]”uh1jihjkh²hh³hÇh´Kàubjj)�”}”(hhh]”(jo)�”}”(hŒPower Management Notifiers”h]”hŒPower Management Notifiers”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjÜh²hh³hÇh´MˆubjŸ)�”}”(hXçThere are some operations that cannot be carried out by the power management callbacks discussed above, because the callbacks occur too late or too early. To handle these cases, subsystems and device drivers may register power management notifiers that are called before tasks are frozen and after they have been thawed. Generally speaking, the PM notifiers are suitable for performing actions that either require user space to be available, or at least won't interfere with user space.”h]”hXéThere are some operations that cannot be carried out by the power management callbacks discussed above, because the callbacks occur too late or too early. To handle these cases, subsystems and device drivers may register power management notifiers that are called before tasks are frozen and after they have been thawed. Generally speaking, the PM notifiers are suitable for performing actions that either require user space to be available, or at least won’t interfere with user space.”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MŠhjÜh²hubjŸ)�”}”(hŒ?For details refer to Documentation/driver-api/pm/notifiers.rst.”h]”hŒ?For details refer to Documentation/driver-api/pm/notifiers.rst.”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M’hjÜh²hubeh}”(h]”Œpower-management-notifiers”ah ]”h"]”Œpower management notifiers”ah$]”h&]”uh1jihjkh²hh³hÇh´Mˆubjj)�”}”(hhh]”(jo)�”}”(hŒ!Device Low-Power (suspend) States”h]”hŒ!Device Low-Power (suspend) States”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjh²hh³hÇh´M–ubjŸ)�”}”(hŒøDevice low-power states aren't standard. One device might only handle "on" and "off", while another might support a dozen different versions of "on" (how many engines are active?), plus a state that gets back to "on" faster than from a full "off".”h]”hXDevice low-power states aren’t standard. One device might only handle “onâ€� and “offâ€�, while another might support a dozen different versions of “onâ€� (how many engines are active?), plus a state that gets back to “onâ€� faster than from a full “offâ€�.”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M˜hjh²hubjŸ)�”}”(hXXSome buses define rules about what different suspend states mean. PCI gives one example: after the suspend sequence completes, a non-legacy PCI device may not perform DMA or issue IRQs, and any wakeup events it issues would be issued through the PME# bus signal. Plus, there are several PCI-standard device states, some of which are optional.”h]”hXXSome buses define rules about what different suspend states mean. PCI gives one example: after the suspend sequence completes, a non-legacy PCI device may not perform DMA or issue IRQs, and any wakeup events it issues would be issued through the PME# bus signal. Plus, there are several PCI-standard device states, some of which are optional.”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M�hjh²hubjŸ)�”}”(hX%In contrast, integrated system-on-chip processors often use IRQs as the wakeup event sources (so drivers would call :c:func:`enable_irq_wake`) and might be able to treat DMA completion as a wakeup event (sometimes DMA can stay active too, it'd only be the CPU and some peripherals that sleep).”h]”(hŒtIn contrast, integrated system-on-chip processors often use IRQs as the wakeup event sources (so drivers would call ”…”�”}”(hj>h²hh³Nh´Nubh)�”}”(hŒ:c:func:`enable_irq_wake`”h]”j )�”}”(hjHh]”hŒenable_irq_wake()”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjFubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œenable_irq_wake”uh1hh³hÇh´M£hj>ubhŒš) and might be able to treat DMA completion as a wakeup event (sometimes DMA can stay active too, it’d only be the CPU and some peripherals that sleep).”…”�”}”(hj>h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M£hjh²hubjŸ)�”}”(hXSSome details here may be platform-specific. Systems may have devices that can be fully active in certain sleep states, such as an LCD display that's refreshed using DMA while most of the system is sleeping lightly ... and its frame buffer might even be updated by a DSP or other non-Linux CPU while the Linux control processor stays idle.”h]”hXUSome details here may be platform-specific. Systems may have devices that can be fully active in certain sleep states, such as an LCD display that’s refreshed using DMA while most of the system is sleeping lightly ... and its frame buffer might even be updated by a DSP or other non-Linux CPU while the Linux control processor stays idle.”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M¨hjh²hubjŸ)�”}”(hX³Moreover, the specific actions taken may depend on the target system state. One target system state might allow a given device to be very operational; another might require a hard shut down with re-initialization on resume. And two different target systems might use the same device in different ways; the aforementioned LCD might be active in one product's "standby", but a different product using the same SOC might work differently.”h]”hX¹Moreover, the specific actions taken may depend on the target system state. One target system state might allow a given device to be very operational; another might require a hard shut down with re-initialization on resume. And two different target systems might use the same device in different ways; the aforementioned LCD might be active in one product’s “standbyâ€�, but a different product using the same SOC might work differently.”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M®hjh²hubeh}”(h]”Œdevice-low-power-suspend-states”ah ]”h"]”Œ!device low-power (suspend) states”ah$]”h&]”uh1jihjkh²hh³hÇh´M–ubjj)�”}”(hhh]”(jo)�”}”(hŒDevice Power Management Domains”h]”hŒDevice Power Management Domains”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhj“h²hh³hÇh´M·ubjŸ)�”}”(hXƒSometimes devices share reference clocks or other power resources. In those cases it generally is not possible to put devices into low-power states individually. Instead, a set of devices sharing a power resource can be put into a low-power state together at the same time by turning off the shared power resource. Of course, they also need to be put into the full-power state together, by turning the shared power resource on. A set of devices with this property is often referred to as a power domain. A power domain may also be nested inside another power domain. The nested domain is referred to as the sub-domain of the parent domain.”h]”hXƒSometimes devices share reference clocks or other power resources. In those cases it generally is not possible to put devices into low-power states individually. Instead, a set of devices sharing a power resource can be put into a low-power state together at the same time by turning off the shared power resource. Of course, they also need to be put into the full-power state together, by turning the shared power resource on. A set of devices with this property is often referred to as a power domain. A power domain may also be nested inside another power domain. The nested domain is referred to as the sub-domain of the parent domain.”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M¹hj“h²hubjŸ)�”}”(hXsSupport for power domains is provided through the :c:member:`pm_domain` field of struct device. This field is a pointer to an object of type struct dev_pm_domain, defined in :file:`include/linux/pm.h`, providing a set of power management callbacks analogous to the subsystem-level and device driver callbacks that are executed for the given device during all power transitions, instead of the respective subsystem-level callbacks. Specifically, if a device's :c:member:`pm_domain` pointer is not NULL, the ``->suspend()`` callback from the object pointed to by it will be executed instead of its subsystem's (e.g. bus type's) ``->suspend()`` callback and analogously for all of the remaining callbacks. In other words, power management domain callbacks, if defined for the given device, always take precedence over the callbacks provided by the device's subsystem (e.g. bus type).”h]”(hŒ2Support for power domains is provided through the ”…”�”}”(hj²h²hh³Nh´Nubh)�”}”(hŒ:c:member:`pm_domain`”h]”j )�”}”(hj¼h]”hŒ pm_domain”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjºubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ pm_domain”uh1hh³hÇh´MÃhj²ubhŒh field of struct device. This field is a pointer to an object of type struct dev_pm_domain, defined in ”…”�”}”(hj²h²hh³Nh´Nubj )�”}”(hŒ:file:`include/linux/pm.h`”h]”hŒinclude/linux/pm.h”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”Œfile”ah"]”h$]”h&]”Œrole”Œfile”uh1j hj²ubhX, providing a set of power management callbacks analogous to the subsystem-level and device driver callbacks that are executed for the given device during all power transitions, instead of the respective subsystem-level callbacks. Specifically, if a device’s ”…”�”}”(hj²h²hh³Nh´Nubh)�”}”(hŒ:c:member:`pm_domain`”h]”j )�”}”(hjôh]”hŒ pm_domain”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjòubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œ pm_domain”uh1hh³hÇh´MÃhj²ubhŒ pointer is not NULL, the ”…”�”}”(hj²h²hh³Nh´Nubj )�”}”(hŒ``->suspend()``”h]”hŒ ->suspend()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj²ubhŒm callback from the object pointed to by it will be executed instead of its subsystem’s (e.g. bus type’s) ”…”�”}”(hj²h²hh³Nh´Nubj )�”}”(hŒ``->suspend()``”h]”hŒ ->suspend()”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj²ubhŒò callback and analogously for all of the remaining callbacks. In other words, power management domain callbacks, if defined for the given device, always take precedence over the callbacks provided by the device’s subsystem (e.g. bus type).”…”�”}”(hj²h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÃhj“h²hubjŸ)�”}”(hX˜The support for device power management domains is only relevant to platforms needing to use the same device driver power management callbacks in many different power domain configurations and wanting to avoid incorporating the support for power domains into subsystem-level callbacks, for example by modifying the platform bus type. Other platforms need not implement it or take it into account in any way.”h]”hX˜The support for device power management domains is only relevant to platforms needing to use the same device driver power management callbacks in many different power domain configurations and wanting to avoid incorporating the support for power domains into subsystem-level callbacks, for example by modifying the platform bus type. Other platforms need not implement it or take it into account in any way.”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MÐhj“h²hubjŸ)�”}”(hXªDevices may be defined as IRQ-safe which indicates to the PM core that their runtime PM callbacks may be invoked with disabled interrupts (see Documentation/power/runtime_pm.rst for more information). If an IRQ-safe device belongs to a PM domain, the runtime PM of the domain will be disallowed, unless the domain itself is defined as IRQ-safe. However, it makes sense to define a PM domain as IRQ-safe only if all the devices in it are IRQ-safe. Moreover, if an IRQ-safe domain has a parent domain, the runtime PM of the parent is only allowed if the parent itself is IRQ-safe too with the additional restriction that all child domains of an IRQ-safe parent must also be IRQ-safe.”h]”hXªDevices may be defined as IRQ-safe which indicates to the PM core that their runtime PM callbacks may be invoked with disabled interrupts (see Documentation/power/runtime_pm.rst for more information). If an IRQ-safe device belongs to a PM domain, the runtime PM of the domain will be disallowed, unless the domain itself is defined as IRQ-safe. However, it makes sense to define a PM domain as IRQ-safe only if all the devices in it are IRQ-safe. Moreover, if an IRQ-safe domain has a parent domain, the runtime PM of the parent is only allowed if the parent itself is IRQ-safe too with the additional restriction that all child domains of an IRQ-safe parent must also be IRQ-safe.”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M×hj“h²hubeh}”(h]”Œdevice-power-management-domains”ah ]”h"]”Œdevice power management domains”ah$]”h&]”uh1jihjkh²hh³hÇh´M·ubjj)�”}”(hhh]”(jo)�”}”(hŒRuntime Power Management”h]”hŒRuntime Power Management”…”�”}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jnhjch²hh³hÇh´MäubjŸ)�”}”(hX Many devices are able to dynamically power down while the system is still running. This feature is useful for devices that are not being used, and can offer significant power savings on a running system. These devices often support a range of runtime power states, which might use names such as "off", "sleep", "idle", "active", and so on. Those states will in some cases (like PCI) be partially constrained by the bus the device uses, and will usually include hardware states that are also used in system sleep states.”h]”hXMany devices are able to dynamically power down while the system is still running. This feature is useful for devices that are not being used, and can offer significant power savings on a running system. These devices often support a range of runtime power states, which might use names such as “offâ€�, “sleepâ€�, “idleâ€�, “activeâ€�, and so on. Those states will in some cases (like PCI) be partially constrained by the bus the device uses, and will usually include hardware states that are also used in system sleep states.”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mæhjch²hubjŸ)�”}”(hX A system-wide power transition can be started while some devices are in low power states due to runtime power management. The system sleep PM callbacks should recognize such situations and react to them appropriately, but the necessary actions are subsystem-specific.”h]”hX A system-wide power transition can be started while some devices are in low power states due to runtime power management. The system sleep PM callbacks should recognize such situations and react to them appropriately, but the necessary actions are subsystem-specific.”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mîhjch²hubjŸ)�”}”(hXèIn some cases the decision may be made at the subsystem level while in other cases the device driver may be left to decide. In some cases it may be desirable to leave a suspended device in that state during a system-wide power transition, but in other cases the device must be put back into the full-power state temporarily, for example so that its system wakeup capability can be disabled. This all depends on the hardware and the design of the subsystem and device driver in question.”h]”hXèIn some cases the decision may be made at the subsystem level while in other cases the device driver may be left to decide. In some cases it may be desirable to leave a suspended device in that state during a system-wide power transition, but in other cases the device must be put back into the full-power state temporarily, for example so that its system wakeup capability can be disabled. This all depends on the hardware and the design of the subsystem and device driver in question.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Móhjch²hubjŸ)�”}”(hXSIf it is necessary to resume a device from runtime suspend during a system-wide transition into a sleep state, that can be done by calling :c:func:`pm_runtime_resume` from the ``->suspend`` callback (or the ``->freeze`` or ``->poweroff`` callback for transitions related to hibernation) of either the device's driver or its subsystem (for example, a bus type or a PM domain). However, subsystems must not otherwise change the runtime status of devices from their ``->prepare`` and ``->suspend`` callbacks (or equivalent) *before* invoking device drivers' ``->suspend`` callbacks (or equivalent).”h]”(hŒ‹If it is necessary to resume a device from runtime suspend during a system-wide transition into a sleep state, that can be done by calling ”…”�”}”(hjžh²hh³Nh´Nubh)�”}”(hŒ:c:func:`pm_runtime_resume`”h]”j )�”}”(hj¨h]”hŒpm_runtime_resume()”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj¦ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œpm_runtime_resume”uh1hh³hÇh´MûhjžubhŒ from the ”…”�”}”(hjžh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjžubhŒ callback (or the ”…”�”}”(hjžh²hh³Nh´Nubj )�”}”(hŒ ``->freeze``”h]”hŒ->freeze”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjžubhŒ or ”…”�”}”(hjžh²hh³Nh´Nubj )�”}”(hŒ``->poweroff``”h]”hŒ ->poweroff”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjžubhŒä callback for transitions related to hibernation) of either the device’s driver or its subsystem (for example, a bus type or a PM domain). However, subsystems must not otherwise change the runtime status of devices from their ”…”�”}”(hjžh²hh³Nh´Nubj )�”}”(hŒ ``->prepare``”h]”hŒ ->prepare”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjžubhŒ and ”…”�”}”(hjžh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjžubhŒ callbacks (or equivalent) ”…”�”}”(hjžh²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ*before*”h]”hŒbefore”…”�”}”(hj% h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j# hjžubhŒ invoking device drivers’ ”…”�”}”(hjžh²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj7 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjžubhŒ callbacks (or equivalent).”…”�”}”(hjžh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mûhjch²hubj\)�”}”(hŒ.. _smart_suspend_flag:”h]”h}”(h]”h ]”h"]”h$]”h&]”jgŒsmart-suspend-flag”uh1j[h´MZhjch²hh³hÇŒ referenced”Kubjj)�”}”(hhh]”(jo)�”}”(hŒ*The ``DPM_FLAG_SMART_SUSPEND`` Driver Flag”h]”(hŒThe ”…”�”}”(hj^ h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjf h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^ ubhŒ Driver Flag”…”�”}”(hj^ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhj[ h²hh³hÇh´MubjŸ)�”}”(hX¦Some bus types and PM domains have a policy to resume all devices from runtime suspend upfront in their ``->suspend`` callbacks, but that may not be really necessary if the device's driver can cope with runtime-suspended devices. The driver can indicate this by setting ``DPM_FLAG_SMART_SUSPEND`` in :c:member:`power.driver_flags` at probe time, with the assistance of the :c:func:`dev_pm_set_driver_flags` helper routine.”h]”(hŒhSome bus types and PM domains have a policy to resume all devices from runtime suspend upfront in their ”…”�”}”(hj~ h²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj† h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhŒ› callbacks, but that may not be really necessary if the device’s driver can cope with runtime-suspended devices. The driver can indicate this by setting ”…”�”}”(hj~ h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hj˜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj~ ubhŒ in ”…”�”}”(hj~ h²hh³Nh´Nubh)�”}”(hŒ:c:member:`power.driver_flags`”h]”j )�”}”(hj¬ h]”hŒpower.driver_flags”…”�”}”(hj® h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjª ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpower.driver_flags”uh1hh³hÇh´M hj~ ubhŒ+ at probe time, with the assistance of the ”…”�”}”(hj~ h²hh³Nh´Nubh)�”}”(hŒ!:c:func:`dev_pm_set_driver_flags`”h]”j )�”}”(hjÏ h]”hŒdev_pm_set_driver_flags()”…”�”}”(hjÑ h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjÍ ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdev_pm_set_driver_flags”uh1hh³hÇh´M hj~ ubhŒ helper routine.”…”�”}”(hj~ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M hj[ h²hubjŸ)�”}”(hX6Setting that flag causes the PM core and middle-layer code (bus types, PM domains etc.) to skip the ``->suspend_late`` and ``->suspend_noirq`` callbacks provided by the driver if the device remains in runtime suspend throughout those phases of the system-wide suspend (and similarly for the "freeze" and "poweroff" parts of system hibernation). [Otherwise the same driver callback might be executed twice in a row for the same device, which would not be valid in general.] If the middle-layer system-wide PM callbacks are present for the device then they are responsible for skipping these driver callbacks; if not then the PM core skips them. The subsystem callback routines can determine whether they need to skip the driver callbacks by testing the return value from the :c:func:`dev_pm_skip_suspend` helper function.”h]”(hŒdSetting that flag causes the PM core and middle-layer code (bus types, PM domains etc.) to skip the ”…”�”}”(hjö h²hh³Nh´Nubj )�”}”(hŒ``->suspend_late``”h]”hŒ->suspend_late”…”�”}”(hjþ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjö ubhŒ and ”…”�”}”(hjö h²hh³Nh´Nubj )�”}”(hŒ``->suspend_noirq``”h]”hŒ->suspend_noirq”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjö ubhX‚ callbacks provided by the driver if the device remains in runtime suspend throughout those phases of the system-wide suspend (and similarly for the “freezeâ€� and “poweroffâ€� parts of system hibernation). [Otherwise the same driver callback might be executed twice in a row for the same device, which would not be valid in general.] If the middle-layer system-wide PM callbacks are present for the device then they are responsible for skipping these driver callbacks; if not then the PM core skips them. The subsystem callback routines can determine whether they need to skip the driver callbacks by testing the return value from the ”…”�”}”(hjö h²hh³Nh´Nubh)�”}”(hŒ:c:func:`dev_pm_skip_suspend`”h]”j )�”}”(hj$!h]”hŒdev_pm_skip_suspend()”…”�”}”(hj&!h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hj"!ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdev_pm_skip_suspend”uh1hh³hÇh´Mhjö ubhŒ helper function.”…”�”}”(hjö h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhj[ h²hubjŸ)�”}”(hXpIn addition, with ``DPM_FLAG_SMART_SUSPEND`` set, the driver's ``->thaw_noirq`` and ``->thaw_early`` callbacks are skipped in hibernation if the device remained in runtime suspend throughout the preceding "freeze" transition. Again, if the middle-layer callbacks are present for the device, they are responsible for doing this, otherwise the PM core takes care of it.”h]”(hŒIn addition, with ”…”�”}”(hjK!h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjS!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjK!ubhŒ set, the driver’s ”…”�”}”(hjK!h²hh³Nh´Nubj )�”}”(hŒ``->thaw_noirq``”h]”hŒ ->thaw_noirq”…”�”}”(hje!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjK!ubhŒ and ”…”�”}”(hjK!h²hh³Nh´Nubj )�”}”(hŒ``->thaw_early``”h]”hŒ ->thaw_early”…”�”}”(hjw!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjK!ubhX callbacks are skipped in hibernation if the device remained in runtime suspend throughout the preceding “freezeâ€� transition. Again, if the middle-layer callbacks are present for the device, they are responsible for doing this, otherwise the PM core takes care of it.”…”�”}”(hjK!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhj[ h²hubeh}”(h]”(Œ&the-dpm-flag-smart-suspend-driver-flag”jY eh ]”h"]”(Œ&the dpm_flag_smart_suspend driver flag”Œsmart_suspend_flag”eh$]”h&]”uh1jihjch²hh³hÇh´MŒexpect_referenced_by_name”}”j•!jO sŒexpect_referenced_by_id”}”jY jO sjZ Kubjj)�”}”(hhh]”(jo)�”}”(hŒ,The ``DPM_FLAG_MAY_SKIP_RESUME`` Driver Flag”h]”(hŒThe ”…”�”}”(hjŸ!h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hj§!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjŸ!ubhŒ Driver Flag”…”�”}”(hjŸ!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhjœ!h²hh³hÇh´M%ubjŸ)�”}”(hX$During system-wide resume from a sleep state it's easiest to put devices into the full-power state, as explained in Documentation/power/runtime_pm.rst. [Refer to that document for more information regarding this particular issue as well as for information on the device runtime power management framework in general.] However, it often is desirable to leave devices in suspend after system transitions to the working state, especially if those devices had been in runtime suspend before the preceding system-wide suspend (or analogous) transition.”h]”hX&During system-wide resume from a sleep state it’s easiest to put devices into the full-power state, as explained in Documentation/power/runtime_pm.rst. [Refer to that document for more information regarding this particular issue as well as for information on the device runtime power management framework in general.] However, it often is desirable to leave devices in suspend after system transitions to the working state, especially if those devices had been in runtime suspend before the preceding system-wide suspend (or analogous) transition.”…”�”}”(hj¿!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M'hjœ!h²hubjŸ)�”}”(hXáTo that end, device drivers can use the ``DPM_FLAG_MAY_SKIP_RESUME`` flag to indicate to the PM core and middle-layer code that they allow their "noirq" and "early" resume callbacks to be skipped if the device can be left in suspend after system-wide PM transitions to the working state. Whether or not that is the case generally depends on the state of the device before the given system suspend-resume cycle and on the type of the system transition under way. In particular, the "thaw" and "restore" transitions related to hibernation are not affected by ``DPM_FLAG_MAY_SKIP_RESUME`` at all. [All callbacks are issued during the "restore" transition regardless of the flag settings, and whether or not any driver callbacks are skipped during the "thaw" transition depends whether or not the ``DPM_FLAG_SMART_SUSPEND`` flag is set (see `above `_). In addition, a device is not allowed to remain in runtime suspend if any of its children will be returned to full power.]”h]”(hŒ(To that end, device drivers can use the ”…”�”}”(hjÍ!h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hjÕ!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÍ!ubhXú flag to indicate to the PM core and middle-layer code that they allow their “noirqâ€� and “earlyâ€� resume callbacks to be skipped if the device can be left in suspend after system-wide PM transitions to the working state. Whether or not that is the case generally depends on the state of the device before the given system suspend-resume cycle and on the type of the system transition under way. In particular, the “thawâ€� and “restoreâ€� transitions related to hibernation are not affected by ”…”�”}”(hjÍ!h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hjç!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÍ!ubhŒÙ at all. [All callbacks are issued during the “restoreâ€� transition regardless of the flag settings, and whether or not any driver callbacks are skipped during the “thawâ€� transition depends whether or not the ”…”�”}”(hjÍ!h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjù!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÍ!ubhŒ flag is set (see ”…”�”}”(hjÍ!h²hh³Nh´Nubj¬)�”}”(hŒ`above `_”h]”hŒabove”…”�”}”(hj "h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œabove”jgjY uh1j«hjÍ!Œresolved”Kubj\)�”}”(hŒ ”h]”h}”(h]”h ]”h"]”Œabove”ah$]”h&]”jgjY uh1j[Œindirect_reference_name”Œsmart_suspend_flag”hjÍ!j"KubhŒ|). In addition, a device is not allowed to remain in runtime suspend if any of its children will be returned to full power.]”…”�”}”(hjÍ!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M0hjœ!h²hubjŸ)�”}”(hX¦The ``DPM_FLAG_MAY_SKIP_RESUME`` flag is taken into account in combination with the :c:member:`power.may_skip_resume` status bit set by the PM core during the "suspend" phase of suspend-type transitions. If the driver or the middle layer has a reason to prevent the driver's "noirq" and "early" resume callbacks from being skipped during the subsequent system resume transition, it should clear :c:member:`power.may_skip_resume` in its ``->suspend``, ``->suspend_late`` or ``->suspend_noirq`` callback. [Note that the drivers setting ``DPM_FLAG_SMART_SUSPEND`` need to clear :c:member:`power.may_skip_resume` in their ``->suspend`` callback in case the other two are skipped.]”h]”(hŒThe ”…”�”}”(hj3"h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hj;"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj3"ubhŒ4 flag is taken into account in combination with the ”…”�”}”(hj3"h²hh³Nh´Nubh)�”}”(hŒ!:c:member:`power.may_skip_resume`”h]”j )�”}”(hjO"h]”hŒpower.may_skip_resume”…”�”}”(hjQ"h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjM"ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpower.may_skip_resume”uh1hh³hÇh´M?hj3"ubhX% status bit set by the PM core during the “suspendâ€� phase of suspend-type transitions. If the driver or the middle layer has a reason to prevent the driver’s “noirqâ€� and “earlyâ€� resume callbacks from being skipped during the subsequent system resume transition, it should clear ”…”�”}”(hj3"h²hh³Nh´Nubh)�”}”(hŒ!:c:member:`power.may_skip_resume`”h]”j )�”}”(hjr"h]”hŒpower.may_skip_resume”…”�”}”(hjt"h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjp"ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpower.may_skip_resume”uh1hh³hÇh´M?hj3"ubhŒ in its ”…”�”}”(hj3"h²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hj“"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj3"ubhŒ, ”…”�”}”(hj3"h²hh³Nh´Nubj )�”}”(hŒ``->suspend_late``”h]”hŒ->suspend_late”…”�”}”(hj¥"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj3"ubhŒ or ”…”�”}”(hj3"h²hh³Nh´Nubj )�”}”(hŒ``->suspend_noirq``”h]”hŒ->suspend_noirq”…”�”}”(hj·"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj3"ubhŒ+ callback. [Note that the drivers setting ”…”�”}”(hj3"h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjÉ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj3"ubhŒ need to clear ”…”�”}”(hj3"h²hh³Nh´Nubh)�”}”(hŒ!:c:member:`power.may_skip_resume`”h]”j )�”}”(hjÝ"h]”hŒpower.may_skip_resume”…”�”}”(hjß"h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hjÛ"ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpower.may_skip_resume”uh1hh³hÇh´M?hj3"ubhŒ in their ”…”�”}”(hj3"h²hh³Nh´Nubj )�”}”(hŒ ``->suspend``”h]”hŒ ->suspend”…”�”}”(hjþ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj3"ubhŒ- callback in case the other two are skipped.]”…”�”}”(hj3"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´M?hjœ!h²hubjŸ)�”}”(hXSSetting the :c:member:`power.may_skip_resume` status bit along with the ``DPM_FLAG_MAY_SKIP_RESUME`` flag is necessary, but generally not sufficient, for the driver's "noirq" and "early" resume callbacks to be skipped. Whether or not they should be skipped can be determined by evaluating the :c:func:`dev_pm_skip_resume` helper function.”h]”(hŒ Setting the ”…”�”}”(hj#h²hh³Nh´Nubh)�”}”(hŒ!:c:member:`power.may_skip_resume`”h]”j )�”}”(hj #h]”hŒpower.may_skip_resume”…”�”}”(hj"#h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-member”eh"]”h$]”h&]”uh1j hj#ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œmember”Œ refexplicit”‰Œrefwarn”‰j>Œpower.may_skip_resume”uh1hh³hÇh´MIhj#ubhŒ status bit along with the ”…”�”}”(hj#h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hjA#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj#ubhŒÌ flag is necessary, but generally not sufficient, for the driver’s “noirqâ€� and “earlyâ€� resume callbacks to be skipped. Whether or not they should be skipped can be determined by evaluating the ”…”�”}”(hj#h²hh³Nh´Nubh)�”}”(hŒ:c:func:`dev_pm_skip_resume`”h]”j )�”}”(hjU#h]”hŒdev_pm_skip_resume()”…”�”}”(hjW#h²hh³Nh´Nubah}”(h]”h ]”(j+j,Œc-func”eh"]”h$]”h&]”uh1j hjS#ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j8Œ refdomain”j,Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j>Œdev_pm_skip_resume”uh1hh³hÇh´MIhj#ubhŒ helper function.”…”�”}”(hj#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MIhjœ!h²hubjŸ)�”}”(hXaIf that function returns ``true``, the driver's "noirq" and "early" resume callbacks should be skipped and the device's runtime PM status will be set to "suspended" by the PM core. Otherwise, if the device was runtime-suspended during the preceding system-wide suspend transition and its ``DPM_FLAG_SMART_SUSPEND`` is set, its runtime PM status will be set to "active" by the PM core. [Hence, the drivers that do not set ``DPM_FLAG_SMART_SUSPEND`` should not expect the runtime PM status of their devices to be changed from "suspended" to "active" by the PM core during system-wide resume-type transitions.]”h]”(hŒIf that function returns ”…”�”}”(hj|#h²hh³Nh´Nubj )�”}”(hŒ``true``”h]”hŒtrue”…”�”}”(hj„#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj|#ubhX, the driver’s “noirqâ€� and “earlyâ€� resume callbacks should be skipped and the device’s runtime PM status will be set to “suspendedâ€� by the PM core. Otherwise, if the device was runtime-suspended during the preceding system-wide suspend transition and its ”…”�”}”(hj|#h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hj–#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj|#ubhŒp is set, its runtime PM status will be set to “activeâ€� by the PM core. [Hence, the drivers that do not set ”…”�”}”(hj|#h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hj¨#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj|#ubhŒ¨ should not expect the runtime PM status of their devices to be changed from “suspendedâ€� to “activeâ€� by the PM core during system-wide resume-type transitions.]”…”�”}”(hj|#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MOhjœ!h²hubjŸ)�”}”(hXIf the ``DPM_FLAG_MAY_SKIP_RESUME`` flag is not set for a device, but ``DPM_FLAG_SMART_SUSPEND`` is set and the driver's "late" and "noirq" suspend callbacks are skipped, its system-wide "noirq" and "early" resume callbacks, if present, are invoked as usual and the device's runtime PM status is set to "active" by the PM core before enabling runtime PM for it. In that case, the driver must be prepared to cope with the invocation of its system-wide resume callbacks back-to-back with its ``->runtime_suspend`` one (without the intervening ``->runtime_resume`` and system-wide suspend callbacks) and the final state of the device must reflect the "active" runtime PM status in that case. [Note that this is not a problem at all if the driver's ``->suspend_late`` callback pointer points to the same function as its ``->runtime_suspend`` one and its ``->resume_early`` callback pointer points to the same function as the ``->runtime_resume`` one, while none of the other system-wide suspend-resume callbacks of the driver are present, for example.]”h]”(hŒIf the ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hjÈ#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒ# flag is not set for a device, but ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjÚ#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhX£ is set and the driver’s “lateâ€� and “noirqâ€� suspend callbacks are skipped, its system-wide “noirqâ€� and “earlyâ€� resume callbacks, if present, are invoked as usual and the device’s runtime PM status is set to “activeâ€� by the PM core before enabling runtime PM for it. In that case, the driver must be prepared to cope with the invocation of its system-wide resume callbacks back-to-back with its ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``->runtime_suspend``”h]”hŒ->runtime_suspend”…”�”}”(hjì#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒ one (without the intervening ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``->runtime_resume``”h]”hŒ->runtime_resume”…”�”}”(hjþ#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒ¿ and system-wide suspend callbacks) and the final state of the device must reflect the “activeâ€� runtime PM status in that case. [Note that this is not a problem at all if the driver’s ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``->suspend_late``”h]”hŒ->suspend_late”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒ5 callback pointer points to the same function as its ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``->runtime_suspend``”h]”hŒ->runtime_suspend”…”�”}”(hj"$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒ one and its ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``->resume_early``”h]”hŒ->resume_early”…”�”}”(hj4$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒ5 callback pointer points to the same function as the ”…”�”}”(hjÀ#h²hh³Nh´Nubj )�”}”(hŒ``->runtime_resume``”h]”hŒ->runtime_resume”…”�”}”(hjF$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjÀ#ubhŒk one, while none of the other system-wide suspend-resume callbacks of the driver are present, for example.]”…”�”}”(hjÀ#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´MYhjœ!h²hubjŸ)�”}”(hXªLikewise, if ``DPM_FLAG_MAY_SKIP_RESUME`` is set for a device, its driver's system-wide "noirq" and "early" resume callbacks may be skipped while its "late" and "noirq" suspend callbacks may have been executed (in principle, regardless of whether or not ``DPM_FLAG_SMART_SUSPEND`` is set). In that case, the driver needs to be able to cope with the invocation of its ``->runtime_resume`` callback back-to-back with its "late" and "noirq" suspend ones. [For instance, that is not a concern if the driver sets both ``DPM_FLAG_SMART_SUSPEND`` and ``DPM_FLAG_MAY_SKIP_RESUME`` and uses the same pair of suspend/resume callback functions for runtime PM and system-wide suspend/resume.]”h]”(hŒ Likewise, if ”…”�”}”(hj^$h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hjf$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^$ubhŒç is set for a device, its driver’s system-wide “noirqâ€� and “earlyâ€� resume callbacks may be skipped while its “lateâ€� and “noirqâ€� suspend callbacks may have been executed (in principle, regardless of whether or not ”…”�”}”(hj^$h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjx$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^$ubhŒX is set). In that case, the driver needs to be able to cope with the invocation of its ”…”�”}”(hj^$h²hh³Nh´Nubj )�”}”(hŒ``->runtime_resume``”h]”hŒ->runtime_resume”…”�”}”(hjŠ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^$ubhŒ‡ callback back-to-back with its “lateâ€� and “noirqâ€� suspend ones. [For instance, that is not a concern if the driver sets both ”…”�”}”(hj^$h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_SMART_SUSPEND``”h]”hŒDPM_FLAG_SMART_SUSPEND”…”�”}”(hjœ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^$ubhŒ and ”…”�”}”(hj^$h²hh³Nh´Nubj )�”}”(hŒ``DPM_FLAG_MAY_SKIP_RESUME``”h]”hŒDPM_FLAG_MAY_SKIP_RESUME”…”�”}”(hj®$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj^$ubhŒl and uses the same pair of suspend/resume callback functions for runtime PM and system-wide suspend/resume.]”…”�”}”(hj^$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jžh³hÇh´Mhhjœ!h²hubeh}”(h]”Œ(the-dpm-flag-may-skip-resume-driver-flag”ah ]”h"]”Œ(the dpm_flag_may_skip_resume driver flag”ah$]”h&]”uh1jihjch²hh³hÇh´M%ubeh}”(h]”Œruntime-power-management”ah ]”h"]”Œruntime power management”ah$]”h&]”uh1jihjkh²hh³hÇh´Mäubeh}”(h]”(Œdevice-power-management-basics”jheh ]”h"]”(Œdevice power management basics”Œdriverapi_pm_devices”eh$]”h&]”uh1jihhh²hh³hÇh´Kj˜!}”jÜ$j]sjš!}”jhj]subeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(jnNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”•½Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j%Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”j"aŒsubstitution_defs”}”(hóhçjhöjjj jj/j#j>j2jMjAj\jPjkj_jzjnj‰j}j˜jŒj§j›j¶jªjÅj¹jÔjÈjãj×jòjæjjõjjjjj.j"j=j1jLj@j[jOjjj^jyjmjˆj|j—j‹j¦jšjµj©jÄj¸jÓjÇjâjÖjñjåjjôjjjjj-j!j<j0jKj?jZjNjij]jxjlj‡j{j–jŠj¥j™j´j¨jÃj·jÒjÆjájÕjðjäjÿjójjjjj,j j;j/jJj>jYjMjhj\jwjkj†jzj•j‰j¤j˜j³j§jÂj¶jÑjÅjàjÔjïjãjþjòj jjjj+jj:j.jIj=jXjLuŒsubstitution_names”}”(Œamp”hóŒapos”jŒast”jŒbrvbar”j Œbsol”j/Œcent”j>Œcolon”jMŒcomma”j\Œcommat”jkŒcopy”jzŒcurren”j‰Œdarr”j˜Œdeg”j§Œdivide”j¶Œdollar”jÅŒequals”jÔŒexcl”jãŒfrac12”jòŒfrac14”jŒfrac18”jŒfrac34”jŒfrac38”j.Œfrac58”j=Œfrac78”jLŒgt”j[Œhalf”jjŒhorbar”jyŒhyphen”jˆŒiexcl”j—Œiquest”j¦Œlaquo”jµŒlarr”jÄŒlcub”jÓŒldquo”jâŒlowbar”jñŒlpar”jŒlsqb”jŒlsquo”jŒlt”j-Œmicro”j<Œmiddot”jKŒnbsp”jZŒnot”jiŒnum”jxŒohm”j‡Œordf”j–Œordm”j¥Œpara”j´Œpercnt”jÃŒperiod”jÒŒplus”jáŒplusmn”jðŒpound”jÿŒquest”jŒquot”jŒraquo”j,Œrarr”j;Œrcub”jJŒrdquo”jYŒreg”jhŒrpar”jwŒrsqb”j†Œrsquo”j•Œsect”j¤Œsemi”j³Œshy”jÂŒsol”jÑŒsung”jàŒsup1”jïŒsup2”jþŒsup3”j Œtimes”jŒtrade”j+Œuarr”j:Œverbar”jIŒyen”jXuŒrefnames”}”Œsmart_suspend_flag”]”(j"j "esŒrefids”}”(jh]”j]ajY ]”(jO j"euŒnameids”}”(jÜ$jhjÛ$jØ$j˜j•j¾ j» jjþjŽj‹j' j$ j¶ j³ jÙjÖjJ jG j{jxjnjkjpjmj/j,jÑjÎjj j�j�j`j]jÓ$jÐ$j•!jY j”!j‘!jË$jÈ$uŒ nametypes”}”(jÜ$ˆjÛ$‰j˜‰j¾ ‰j‰jމj' ‰j¶ ‰jÙ‰jJ ‰j{‰jn‰jp‰j/‰jщj‰j�‰j`‰jÓ$‰j•!ˆj”!‰jË$‰uh}”(jhjkjØ$jkj•j±j» j›jþjºj‹jj$ j‘j³ j* jÖjÁ jG j jxjM jkj~jmjqj,jsjÎj2j jÜj�jj]j“jÐ$jcjY j[ j‘!j[ jÈ$jœ!uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”(hŒsystem_message”“”)�”}”(hhh]”jŸ)�”}”(hŒ:Enumerated list start value not ordinal-1: "5" (ordinal 5)”h]”hŒ>Enumerated list start value not ordinal-1: “5â€� (ordinal 5)”…”�”}”(hj»%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhj¸%ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1j¶%hjeubj·%)�”}”(hhh]”jŸ)�”}”(hŒ:Enumerated list start value not ordinal-1: "9" (ordinal 9)”h]”hŒ>Enumerated list start value not ordinal-1: “9â€� (ordinal 9)”…”�”}”(hj×%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhjÔ%ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jÑ%Œsource”hÇŒline”Kuh1j¶%hj‰ubeŒtransform_messages”]”(j·%)�”}”(hhh]”jŸ)�”}”(hhh]”hŒ:Hyperlink target "driverapi-pm-devices" is not referenced.”…”�”}”hjô%sbah}”(h]”h ]”h"]”h$]”h&]”uh1jžhjñ%ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jÑ%Œsource”hÇŒline”KZuh1j¶%ubj·%)�”}”(hhh]”jŸ)�”}”(hhh]”hŒ+Hyperlink target "above" is not referenced.”…”�”}”hj&sbah}”(h]”h ]”h"]”h$]”h&]”uh1jžhj &ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jÑ%Œsource”hÇŒline”M0uh1j¶%ubeŒ transformer”NŒ include_log”]”Œ'Documentation/driver-api/pm/devices.rst”(NNNNt”†”aŒ decoration”Nh²hub.