€•ðŸŒ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/power/basic-pm-debugging”Œ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/power/basic-pm-debugging”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/it_IT/power/basic-pm-debugging”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/ja_JP/power/basic-pm-debugging”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ,/translations/ko_KR/power/basic-pm-debugging”Œ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/power/basic-pm-debugging”Œ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/power/basic-pm-debugging”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ!Debugging hibernation and suspend”h]”hŒ!Debugging hibernation and suspend”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒF/var/lib/git/docbuild/linux/Documentation/power/basic-pm-debugging.rst”h´KubhŒ block_quote”“”)”}”(hŒ.(C) 2007 Rafael J. Wysocki , GPL ”h]”hŒenumerated_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒ*2007 Rafael J. Wysocki , GPL ”h]”hŒ paragraph”“”)”}”(hŒ)2007 Rafael J. Wysocki , GPL”h]”(hŒ2007 Rafael J. Wysocki <”…””}”(hhÞh²hh³Nh´NubhŒ reference”“”)”}”(hŒ rjw@sisk.pl”h]”hŒ rjw@sisk.pl”…””}”(hhèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rjw@sisk.pl”uh1hæhhÞubhŒ>, GPL”…””}”(hhÞh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhØubah}”(h]”h ]”h"]”h$]”h&]”uh1hÖhhÓubah}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ upperalpha”Œprefix”Œ(”Œsuffix”Œ)”Œstart”Kuh1hÑhhÍubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ31. Testing hibernation (aka suspend to disk or STD)”h]”hŒ31. Testing hibernation (aka suspend to disk or STD)”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KubhÝ)”}”(hŒNTo check if hibernation works, you can try to hibernate in the "reboot" mode::”h]”hŒQTo check if hibernation works, you can try to hibernate in the “reboot†mode:”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hjh²hubhŒ literal_block”“”)”}”(hŒ># echo reboot > /sys/power/disk # echo disk > /sys/power/state”h]”hŒ># echo reboot > /sys/power/disk # echo disk > /sys/power/state”…””}”hj<sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j:h³hÊh´K hjh²hubhÝ)”}”(hX¿and the system should create a hibernation image, reboot, resume and get back to the command prompt where you have started the transition. If that happens, hibernation is most likely to work correctly. Still, you need to repeat the test at least a couple of times in a row for confidence. [This is necessary, because some problems only show up on a second attempt at suspending and resuming the system.] Moreover, hibernating in the "reboot" and "shutdown" modes causes the PM core to skip some platform-related callbacks which on ACPI systems might be necessary to make hibernation work. Thus, if your machine fails to hibernate or resume in the "reboot" mode, you should try the "platform" mode::”h]”hXÎand the system should create a hibernation image, reboot, resume and get back to the command prompt where you have started the transition. If that happens, hibernation is most likely to work correctly. Still, you need to repeat the test at least a couple of times in a row for confidence. [This is necessary, because some problems only show up on a second attempt at suspending and resuming the system.] Moreover, hibernating in the “reboot†and “shutdown†modes causes the PM core to skip some platform-related callbacks which on ACPI systems might be necessary to make hibernation work. Thus, if your machine fails to hibernate or resume in the “reboot†mode, you should try the “platform†mode:”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjh²hubj;)”}”(hŒ@# echo platform > /sys/power/disk # echo disk > /sys/power/state”h]”hŒ@# echo platform > /sys/power/disk # echo disk > /sys/power/state”…””}”hjZsbah}”(h]”h ]”h"]”h$]”h&]”jJjKuh1j:h³hÊh´Khjh²hubhÝ)”}”(hŒ9which is the default and recommended mode of hibernation.”h]”hŒ9which is the default and recommended mode of hibernation.”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjh²hubhÝ)”}”(hŒ¢Unfortunately, the "platform" mode of hibernation does not work on some systems with broken BIOSes. In such cases the "shutdown" mode of hibernation might work::”h]”hŒ©Unfortunately, the “platform†mode of hibernation does not work on some systems with broken BIOSes. In such cases the “shutdown†mode of hibernation might work:”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjh²hubj;)”}”(hŒ@# echo shutdown > /sys/power/disk # echo disk > /sys/power/state”h]”hŒ@# echo shutdown > /sys/power/disk # echo disk > /sys/power/state”…””}”hj„sbah}”(h]”h ]”h"]”h$]”h&]”jJjKuh1j:h³hÊh´K#hjh²hubhÝ)”}”(hŒn(it is similar to the "reboot" mode, but it requires you to press the power button to make the system resume).”h]”hŒr(it is similar to the “reboot†mode, but it requires you to press the power button to make the system resume).”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K&hjh²hubhÝ)”}”(hŒgIf neither "platform" nor "shutdown" hibernation mode works, you will need to identify what goes wrong.”h]”hŒoIf neither “platform†nor “shutdown†hibernation mode works, you will need to identify what goes wrong.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K)hjh²hubh¶)”}”(hhh]”(h»)”}”(hŒa) Test modes of hibernation”h]”hŒa) Test modes of hibernation”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj®h²hh³hÊh´K-ubhÝ)”}”(hX'To find out why hibernation fails on your system, you can use a special testing facility available if the kernel is compiled with CONFIG_PM_DEBUG set. Then, there is the file /sys/power/pm_test that can be used to make the hibernation core run in a test mode. There are 5 test modes available:”h]”hX'To find out why hibernation fails on your system, you can use a special testing facility available if the kernel is compiled with CONFIG_PM_DEBUG set. Then, there is the file /sys/power/pm_test that can be used to make the hibernation core run in a test mode. There are 5 test modes available:”…””}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K/hj®h²hubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒ)freezer - test the freezing of processes ”h]”(hŒterm”“”)”}”(hŒfreezer”h]”hŒfreezer”…””}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jØh³hÊh´K5hjÔubhŒ definition”“”)”}”(hhh]”hŒ bullet_list”“”)”}”(hhh]”h×)”}”(hŒtest the freezing of processes ”h]”hÝ)”}”(hŒtest the freezing of processes”h]”hŒtest the freezing of processes”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K5hjòubah}”(h]”h ]”h"]”h$]”h&]”uh1hÖhjïubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jíh³hÊh´K5hjêubah}”(h]”h ]”h"]”h$]”h&]”uh1jèhjÔubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÒh³hÊh´K5hjÏubjÓ)”}”(hŒCdevices - test the freezing of processes and suspending of devices ”h]”(jÙ)”}”(hŒdevices”h]”hŒdevices”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jØh³hÊh´K8hjubjé)”}”(hhh]”jî)”}”(hhh]”h×)”}”(hŒ9test the freezing of processes and suspending of devices ”h]”hÝ)”}”(hŒ8test the freezing of processes and suspending of devices”h]”hŒ8test the freezing of processes and suspending of devices”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K8hj6ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÖhj3ubah}”(h]”h ]”h"]”h$]”h&]”jjuh1jíh³hÊh´K8hj0ubah}”(h]”h ]”h"]”h$]”h&]”uh1jèhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÒh³hÊh´K8hjÏh²hubjÓ)”}”(hŒlplatform - test the freezing of processes, suspending of devices and platform global control methods [1]_ ”h]”(jÙ)”}”(hŒplatform”h]”hŒplatform”…””}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jØh³hÊh´K /sys/power/pm_test # echo platform > /sys/power/disk # echo disk > /sys/power/state”h]”hŒd# echo devices > /sys/power/pm_test # echo platform > /sys/power/disk # echo disk > /sys/power/state”…””}”hj¡sbah}”(h]”h ]”h"]”h$]”h&]”jJjKuh1j:h³hÊh´KRhj®h²hubhÝ)”}”(hX4Then, the kernel will try to freeze processes, suspend devices, wait a few seconds (5 by default, but configurable by the suspend.pm_test_delay module parameter), resume devices and thaw processes. If "platform" is written to /sys/power/pm_test , then after suspending devices the kernel will additionally invoke the global control methods (eg. ACPI global control methods) used to prepare the platform firmware for hibernation. Next, it will wait a configurable number of seconds and invoke the platform (eg. ACPI) global methods used to cancel hibernation etc.”h]”hX8Then, the kernel will try to freeze processes, suspend devices, wait a few seconds (5 by default, but configurable by the suspend.pm_test_delay module parameter), resume devices and thaw processes. If “platform†is written to /sys/power/pm_test , then after suspending devices the kernel will additionally invoke the global control methods (eg. ACPI global control methods) used to prepare the platform firmware for hibernation. Next, it will wait a configurable number of seconds and invoke the platform (eg. ACPI) global methods used to cancel hibernation etc.”…””}”(hj¯h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KVhj®h²hubhÝ)”}”(hXSWriting "none" to /sys/power/pm_test causes the kernel to switch to the normal hibernation/suspend operations. Also, when open for reading, /sys/power/pm_test contains a space-separated list of all available tests (including "none" that represents the normal functionality) in which the current test level is indicated by square brackets.”h]”hX[Writing “none†to /sys/power/pm_test causes the kernel to switch to the normal hibernation/suspend operations. Also, when open for reading, /sys/power/pm_test contains a space-separated list of all available tests (including “none†that represents the normal functionality) in which the current test level is indicated by square brackets.”…””}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K_hj®h²hubhÝ)”}”(hXGenerally, as you can see, each test level is more "invasive" than the previous one and the "core" level tests the hardware and drivers as deeply as possible without creating a hibernation image. Obviously, if the "devices" test fails, the "platform" test will fail as well and so on. Thus, as a rule of thumb, you should try the test modes starting from "freezer", through "devices", "platform" and "processors" up to "core" (repeat the test on each level a couple of times to make sure that any random factors are avoided).”h]”hX3Generally, as you can see, each test level is more “invasive†than the previous one and the “core†level tests the hardware and drivers as deeply as possible without creating a hibernation image. Obviously, if the “devices†test fails, the “platform†test will fail as well and so on. Thus, as a rule of thumb, you should try the test modes starting from “freezerâ€, through “devicesâ€, “platform†and “processors†up to “core†(repeat the test on each level a couple of times to make sure that any random factors are avoided).”…””}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kehj®h²hubhÝ)”}”(hX@If the "freezer" test fails, there is a task that cannot be frozen (in that case it usually is possible to identify the offending task by analysing the output of dmesg obtained after the failing test). Failure at this level usually means that there is a problem with the tasks freezer subsystem that should be reported.”h]”hXDIf the “freezer†test fails, there is a task that cannot be frozen (in that case it usually is possible to identify the offending task by analysing the output of dmesg obtained after the failing test). Failure at this level usually means that there is a problem with the tasks freezer subsystem that should be reported.”…””}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kmhj®h²hubhÝ)”}”(hX'If the "devices" test fails, most likely there is a driver that cannot suspend or resume its device (in the latter case the system may hang or become unstable after the test, so please take that into consideration). To find this driver, you can carry out a binary search according to the rules:”h]”hX+If the “devices†test fails, most likely there is a driver that cannot suspend or resume its device (in the latter case the system may hang or become unstable after the test, so please take that into consideration). To find this driver, you can carry out a binary search according to the rules:”…””}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kshj®h²hubjî)”}”(hhh]”(h×)”}”(hŒ½if the test fails, unload a half of the drivers currently loaded and repeat (that would probably involve rebooting the system, so always note what drivers have been loaded before the test),”h]”hÝ)”}”(hŒ½if the test fails, unload a half of the drivers currently loaded and repeat (that would probably involve rebooting the system, so always note what drivers have been loaded before the test),”h]”hŒ½if the test fails, unload a half of the drivers currently loaded and repeat (that would probably involve rebooting the system, so always note what drivers have been loaded before the test),”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kxhjøubah}”(h]”h ]”h"]”h$]”h&]”uh1hÖhjõh²hh³hÊh´Nubh×)”}”(hŒ]if the test succeeds, load a half of the drivers you have unloaded most recently and repeat. ”h]”hÝ)”}”(hŒ\if the test succeeds, load a half of the drivers you have unloaded most recently and repeat.”h]”hŒ\if the test succeeds, load a half of the drivers you have unloaded most recently and repeat.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K{hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hÖhjõh²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jjuh1jíh³hÊh´Kxhj®h²hubhÝ)”}”(hŒÌOnce you have found the failing driver (there can be more than just one of them), you have to unload it every time before hibernation. In that case please make sure to report the problem with the driver.”h]”hŒÌOnce you have found the failing driver (there can be more than just one of them), you have to unload it every time before hibernation. In that case please make sure to report the problem with the driver.”…””}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K~hj®h²hubhÝ)”}”(hXzIt is also possible that the "devices" test will still fail after you have unloaded all modules. In that case, you may want to look in your kernel configuration for the drivers that can be compiled as modules (and test again with these drivers compiled as modules). You may also try to use some special kernel command line options such as "noapic", "noacpi" or even "acpi=off".”h]”hXŠIt is also possible that the “devices†test will still fail after you have unloaded all modules. In that case, you may want to look in your kernel configuration for the drivers that can be compiled as modules (and test again with these drivers compiled as modules). You may also try to use some special kernel command line options such as “noapicâ€, “noacpi†or even “acpi=offâ€.”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K‚hj®h²hubhÝ)”}”(hX If the "platform" test fails, there is a problem with the handling of the platform (eg. ACPI) firmware on your system. In that case the "platform" mode of hibernation is not likely to work. You can try the "shutdown" mode, but that is rather a poor man's workaround.”h]”hXIf the “platform†test fails, there is a problem with the handling of the platform (eg. ACPI) firmware on your system. In that case the “platform†mode of hibernation is not likely to work. You can try the “shutdown†mode, but that is rather a poor man’s workaround.”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kˆhj®h²hubhÝ)”}”(hXIIf the "processors" test fails, the disabling/enabling of nonboot CPUs does not work (of course, this only may be an issue on SMP systems) and the problem should be reported. In that case you can also try to switch the nonboot CPUs off and on using the /sys/devices/system/cpu/cpu*/online sysfs attributes and see if that works.”h]”hXMIf the “processors†test fails, the disabling/enabling of nonboot CPUs does not work (of course, this only may be an issue on SMP systems) and the problem should be reported. In that case you can also try to switch the nonboot CPUs off and on using the /sys/devices/system/cpu/cpu*/online sysfs attributes and see if that works.”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj®h²hubhÝ)”}”(hŒòIf the "core" test fails, which means that suspending of the system/platform devices has failed (these devices are suspended on one CPU with interrupts off), the problem is most probably hardware-related and serious, so it should be reported.”h]”hŒöIf the “core†test fails, which means that suspending of the system/platform devices has failed (these devices are suspended on one CPU with interrupts off), the problem is most probably hardware-related and serious, so it should be reported.”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K“hj®h²hubhÝ)”}”(hXA failure of any of the "platform", "processors" or "core" tests may cause your system to hang or become unstable, so please beware. Such a failure usually indicates a serious problem that very well may be related to the hardware, but please report it anyway.”h]”hXA failure of any of the “platformâ€, “processors†or “core†tests may cause your system to hang or become unstable, so please beware. Such a failure usually indicates a serious problem that very well may be related to the hardware, but please report it anyway.”…””}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K˜hj®h²hubeh}”(h]”Œa-test-modes-of-hibernation”ah ]”h"]”Œa) test modes of hibernation”ah$]”h&]”uh1hµhjh²hh³hÊh´K-ubh¶)”}”(hhh]”(h»)”}”(hŒ b) Testing minimal configuration”h]”hŒ b) Testing minimal configuration”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjŠh²hh³hÊh´KžubhÝ)”}”(hXQIf all of the hibernation test modes work, you can boot the system with the "init=/bin/bash" command line parameter and attempt to hibernate in the "reboot", "shutdown" and "platform" modes. If that does not work, there probably is a problem with a driver statically compiled into the kernel and you can try to compile more drivers as modules, so that they can be tested individually. Otherwise, there is a problem with a modular driver and you can find it by loading a half of the modules you normally use and binary searching in accordance with the algorithm: - if there are n modules loaded and the attempt to suspend and resume fails, unload n/2 of the modules and try again (that would probably involve rebooting the system), - if there are n modules loaded and the attempt to suspend and resume succeeds, load n/2 modules more and try again.”h]”hXaIf all of the hibernation test modes work, you can boot the system with the “init=/bin/bash†command line parameter and attempt to hibernate in the “rebootâ€, “shutdown†and “platform†modes. If that does not work, there probably is a problem with a driver statically compiled into the kernel and you can try to compile more drivers as modules, so that they can be tested individually. Otherwise, there is a problem with a modular driver and you can find it by loading a half of the modules you normally use and binary searching in accordance with the algorithm: - if there are n modules loaded and the attempt to suspend and resume fails, unload n/2 of the modules and try again (that would probably involve rebooting the system), - if there are n modules loaded and the attempt to suspend and resume succeeds, load n/2 modules more and try again.”…””}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hjŠh²hubhÝ)”}”(hŒ‘Again, if you find the offending module(s), it(they) must be unloaded every time before hibernation, and please report the problem with it(them).”h]”hŒ‘Again, if you find the offending module(s), it(they) must be unloaded every time before hibernation, and please report the problem with it(them).”…””}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K®hjŠh²hubeh}”(h]”Œb-testing-minimal-configuration”ah ]”h"]”Œ b) testing minimal configuration”ah$]”h&]”uh1hµhjh²hh³hÊh´Kžubh¶)”}”(hhh]”(h»)”}”(hŒ-c) Using the "test_resume" hibernation option”h]”hŒ1c) Using the “test_resume†hibernation option”…””}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¿h²hh³hÊh´K²ubhÝ)”}”(hŒé/sys/power/disk generally tells the kernel what to do after creating a hibernation image. One of the available options is "test_resume" which causes the just created image to be used for immediate restoration. Namely, after doing::”h]”hŒì/sys/power/disk generally tells the kernel what to do after creating a hibernation image. One of the available options is “test_resume†which causes the just created image to be used for immediate restoration. Namely, after doing:”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K´hj¿h²hubj;)”}”(hŒC# echo test_resume > /sys/power/disk # echo disk > /sys/power/state”h]”hŒC# echo test_resume > /sys/power/disk # echo disk > /sys/power/state”…””}”hjÞsbah}”(h]”h ]”h"]”h$]”h&]”jJjKuh1j:h³hÊh´K¹hj¿h²hubhÝ)”}”(hŒŠa hibernation image will be created and a resume from it will be triggered immediately without involving the platform firmware in any way.”h]”hŒŠa hibernation image will be created and a resume from it will be triggered immediately without involving the platform firmware in any way.”…””}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¼hj¿h²hubhÝ)”}”(hX(That test can be used to check if failures to resume from hibernation are related to bad interactions with the platform firmware. That is, if the above works every time, but resume from actual hibernation does not work or is unreliable, the platform firmware may be responsible for the failures.”h]”hX(That test can be used to check if failures to resume from hibernation are related to bad interactions with the platform firmware. That is, if the above works every time, but resume from actual hibernation does not work or is unreliable, the platform firmware may be responsible for the failures.”…””}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¿hj¿h²hubhÝ)”}”(hXŽOn architectures and platforms that support using different kernels to restore hibernation images (that is, the kernel used to read the image from storage and load it into memory is different from the one included in the image) or support kernel address space randomization, it also can be used to check if failures to resume may be related to the differences between the restore and image kernels.”h]”hXŽOn architectures and platforms that support using different kernels to restore hibernation images (that is, the kernel used to read the image from storage and load it into memory is different from the one included in the image) or support kernel address space randomization, it also can be used to check if failures to resume may be related to the differences between the restore and image kernels.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÄhj¿h²hubeh}”(h]”Œ*c-using-the-test-resume-hibernation-option”ah ]”h"]”Œ-c) using the "test_resume" hibernation option”ah$]”h&]”uh1hµhjh²hh³hÊh´K²ubh¶)”}”(hhh]”(h»)”}”(hŒd) Advanced debugging”h]”hŒd) Advanced debugging”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KÌubhÝ)”}”(hXìIn case that hibernation does not work on your system even in the minimal configuration and compiling more drivers as modules is not practical or some modules cannot be unloaded, you can use one of the more advanced debugging techniques to find the problem. First, if there is a serial port in your box, you can boot the kernel with the 'no_console_suspend' parameter and try to log kernel messages using the serial console. This may provide you with some information about the reasons of the suspend (resume) failure. Alternatively, it may be possible to use a FireWire port for debugging with firescope (http://v3.sk/~lkundrak/firescope/). On x86 it is also possible to use the PM_TRACE mechanism documented in Documentation/power/s2ram.rst .”h]”(hXeIn case that hibernation does not work on your system even in the minimal configuration and compiling more drivers as modules is not practical or some modules cannot be unloaded, you can use one of the more advanced debugging techniques to find the problem. First, if there is a serial port in your box, you can boot the kernel with the ‘no_console_suspend’ parameter and try to log kernel messages using the serial console. This may provide you with some information about the reasons of the suspend (resume) failure. Alternatively, it may be possible to use a FireWire port for debugging with firescope (”…””}”(hj/h²hh³Nh´Nubhç)”}”(hŒ!http://v3.sk/~lkundrak/firescope/”h]”hŒ!http://v3.sk/~lkundrak/firescope/”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j9uh1hæhj/ubhŒj). On x86 it is also possible to use the PM_TRACE mechanism documented in Documentation/power/s2ram.rst .”…””}”(hj/h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÎhjh²hubeh}”(h]”Œd-advanced-debugging”ah ]”h"]”Œd) advanced debugging”ah$]”h&]”uh1hµhjh²hh³hÊh´KÌubeh}”(h]”Œ.testing-hibernation-aka-suspend-to-disk-or-std”ah ]”h"]”Œ31. testing hibernation (aka suspend to disk or std)”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒ2. Testing suspend to RAM (STR)”h]”hŒ2. Testing suspend to RAM (STR)”…””}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj`h²hh³hÊh´KÚubhÝ)”}”(hŒÂTo verify that the STR works, it is generally more convenient to use the s2ram tool available from http://suspend.sf.net and documented at http://en.opensuse.org/SDB:Suspend_to_RAM (S2RAM_LINK).”h]”(hŒcTo verify that the STR works, it is generally more convenient to use the s2ram tool available from ”…””}”(hjqh²hh³Nh´Nubhç)”}”(hŒhttp://suspend.sf.net”h]”hŒhttp://suspend.sf.net”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j{uh1hæhjqubhŒ and documented at ”…””}”(hjqh²hh³Nh´Nubhç)”}”(hŒ)http://en.opensuse.org/SDB:Suspend_to_RAM”h]”hŒ)http://en.opensuse.org/SDB:Suspend_to_RAM”…””}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jŽuh1hæhjqubhŒ (S2RAM_LINK).”…””}”(hjqh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÜhj`h²hubhÝ)”}”(hXNamely, after writing "freezer", "devices", "platform", "processors", or "core" into /sys/power/pm_test (available if the kernel is compiled with CONFIG_PM_DEBUG set) the suspend code will work in the test mode corresponding to given string. The STR test modes are defined in the same way as for hibernation, so please refer to Section 1 for more information about them. In particular, the "core" test allows you to test everything except for the actual invocation of the platform firmware in order to put the system into the sleep state.”h]”hX4Namely, after writing “freezerâ€, “devicesâ€, “platformâ€, “processorsâ€, or “core†into /sys/power/pm_test (available if the kernel is compiled with CONFIG_PM_DEBUG set) the suspend code will work in the test mode corresponding to given string. The STR test modes are defined in the same way as for hibernation, so please refer to Section 1 for more information about them. In particular, the “core†test allows you to test everything except for the actual invocation of the platform firmware in order to put the system into the sleep state.”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kàhj`h²hubhÝ)”}”(hŒÑAmong other things, the testing with the help of /sys/power/pm_test may allow you to identify drivers that fail to suspend or resume their devices. They should be unloaded every time before an STR transition.”h]”hŒÑAmong other things, the testing with the help of /sys/power/pm_test may allow you to identify drivers that fail to suspend or resume their devices. They should be unloaded every time before an STR transition.”…””}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kéhj`h²hubhÝ)”}”(hXûNext, you can follow the instructions at S2RAM_LINK to test the system, but if it does not work "out of the box", you may need to boot it with "init=/bin/bash" and test s2ram in the minimal configuration. In that case, you may be able to search for failing drivers by following the procedure analogous to the one described in section 1. If you find some failing drivers, you will have to unload them every time before an STR transition (ie. before you run s2ram), and please report the problems with them.”h]”hXNext, you can follow the instructions at S2RAM_LINK to test the system, but if it does not work “out of the boxâ€, you may need to boot it with “init=/bin/bash†and test s2ram in the minimal configuration. In that case, you may be able to search for failing drivers by following the procedure analogous to the one described in section 1. If you find some failing drivers, you will have to unload them every time before an STR transition (ie. before you run s2ram), and please report the problems with them.”…””}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kíhj`h²hubhÝ)”}”(hŒfThere is a debugfs entry which shows the suspend to RAM statistics. Here is an example of its output::”h]”hŒeThere is a debugfs entry which shows the suspend to RAM statistics. Here is an example of its output:”…””}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Kõhj`h²hubj;)”}”(hX”# mount -t debugfs none /sys/kernel/debug # cat /sys/kernel/debug/suspend_stats success: 20 fail: 5 failed_freeze: 0 failed_prepare: 0 failed_suspend: 5 failed_suspend_noirq: 0 failed_resume: 0 failed_resume_noirq: 0 failures: last_failed_dev: alarm adc last_failed_errno: -16 -16 last_failed_step: suspend suspend”h]”hX”# mount -t debugfs none /sys/kernel/debug # cat /sys/kernel/debug/suspend_stats success: 20 fail: 5 failed_freeze: 0 failed_prepare: 0 failed_suspend: 5 failed_suspend_noirq: 0 failed_resume: 0 failed_resume_noirq: 0 failures: last_failed_dev: alarm adc last_failed_errno: -16 -16 last_failed_step: suspend suspend”…””}”hjÝsbah}”(h]”h ]”h"]”h$]”h&]”jJjKuh1j:h³hÊh´Køhj`h²hubhÝ)”}”(hXField success means the success number of suspend to RAM, and field fail means the failure number. Others are the failure number of different steps of suspend to RAM. suspend_stats just lists the last 2 failed devices, error number and failed step of suspend.”h]”hXField success means the success number of suspend to RAM, and field fail means the failure number. Others are the failure number of different steps of suspend to RAM. suspend_stats just lists the last 2 failed devices, error number and failed step of suspend.”…””}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hj`h²hubeh}”(h]”Œtesting-suspend-to-ram-str”ah ]”h"]”Œ2. testing suspend to ram (str)”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÚubeh}”(h]”Œ!debugging-hibernation-and-suspend”ah ]”h"]”Œ!debugging hibernation and suspend”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ 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”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œ1”]”(j†jÜj1esŒrefids”}”Œnameids”}”(jjj]jZj‡j„jj–j¼j¹jjjUjRjþjûuŒ nametypes”}”(j‰j]‰j‡‰jˆj¼‰j‰jU‰jþ‰uh}”(jh·jZjj„j®jj†jæjÜj;j1j–jjj¹jŠjj¿jRjjûj`uŒ footnote_refs”}”jl]”(j†jÜj1esŒ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”jjaŒ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”j:Ks…”R”Œparse_messages”]”hŒsystem_message”“”)”}”(hhh]”hÝ)”}”(hŒ:Enumerated list start value not ordinal-1: "C" (ordinal 3)”h]”hŒ>Enumerated list start value not ordinal-1: “C†(ordinal 3)”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜhj“ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÊŒline”Kuh1j‘hhÍubaŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.