€•ŸŒ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Œ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)”…””}”(hj hž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:”…””}”(hjhž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:”…””}”(hj8hž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”…””}”hjFsbah}”(h]”h ]”h"]”h$]”h&]”j6j7uh1j&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.”…””}”(hjThž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:”…””}”(hjbhž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”…””}”hjpsbah}”(h]”h ]”h"]”h$]”h&]”j6j7uh1j&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”…””}”(hjhž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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÄhŸh¶h K8hj ubjÕ)”}”(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 K8hj"ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhjubah}”(h]”h ]”h"]”h$]”h&]”jüjýuh1jÙhŸh¶h K8hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔhj ubeh}”(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”…””}”(hjPhž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”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”j6j7uh1j&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{hjüubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhjáhžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”jüjýuh1jÙ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.”…””}”(hjhž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.”…””}”(hj6hž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.”…””}”(hjDhž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.”…””}”(hjRhž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.”…””}”(hj`hž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”…””}”(hjyhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjvhž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 hjvhž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®hjvhž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&]”j6j7uh1j&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.”…””}”(hjôhž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¦hj hž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 (”…””}”(hjhžhhŸNh NubhÓ)”}”(hŒ!http://v3.sk/~lkundrak/firescope/”h]”hŒ!http://v3.sk/~lkundrak/firescope/”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j%uh1hÒhjubhŒj). On x86 it is also possible to use the PM_TRACE mechanism documented in Documentation/power/s2ram.rst .”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KÎhj hž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)”…””}”(hjOhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjLhž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 ”…””}”(hj]hžhhŸNh NubhÓ)”}”(hŒhttp://suspend.sf.net”h]”hŒhttp://suspend.sf.net”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jguh1hÒhj]ubhŒ and documented at ”…””}”(hj]hžhhŸNh NubhÓ)”}”(hŒ)http://en.opensuse.org/SDB:Suspend_to_RAM”h]”hŒ)http://en.opensuse.org/SDB:Suspend_to_RAM”…””}”(hjxhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jzuh1hÒhj]ubhŒ (S2RAM_LINK).”…””}”(hj]hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KÜhjLhž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àhjLhž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éhjLhž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íhjLhž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õhjLhž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&]”j6j7uh1j&hŸh¶h KøhjLhž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 hjLhž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”]”(jrjÈjesŒrefids”}”Œnameids”}”(jòjïjIjFjsjpj|j‚j¨j¥jjjAj>jêjçuŒ nametypes”}”(jò‰jI‰js‰j|ˆj¨‰j‰jA‰jê‰uh}”(jïh£jFjjpjšj|jrjÒjÈj'jj‚jVj¥jvjj«j>j jçjLuŒ footnote_refs”}”jX]”(jrjÈjesŒ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”jVaŒ 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Èhjubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”h¶Œline”Kuh1j}hh¹ubaŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.