Documentation/power/s2ram.txt

Chinese translated version of Documentation/power/s2ram.txt

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: 徐红 1534342777@qq.com
---------------------------------------------------------------------
Documentation/power/s2ram.txt的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者: 徐红 1534342777@qq.com
中文版翻译者: 徐红 1534342777@qq.com

以下为正文

---------------------------------------------------------------------
How to get s2ram working
~~~~~~~~~~~~~~~~~~~~~~~~
2006 Linus Torvalds
2006 Pavel Machek
 如何使s2ram工作
2006 林纳斯 托瓦兹
2006 帕维尔 迈克
1) Check suspend.sf.net, program s2ram there has long whitelist of
   "known ok" machines, along with tricks to use on each one.

2) If that does not help, try reading tricks.txt and
   video.txt. Perhaps problem is as simple as broken module, and
   simple module unload can fix it.

3) You can use Linus' TRACE_RESUME infrastructure, described below.

1)检查suspend.sf.net、s2ram程序,每个好的机器都有很长的白名单以及
使用技巧。

2)如果白名单和技巧不起作用,可以试着去阅读tricks.txt and video.txt
文档。可能问题就如同模块损坏一样简单,简单的模块卸载就能修复。

3)你可以使用下面描述的林纳斯的跟踪-恢复模式

     Using TRACE_RESUME
     ~~~~~~~~~~~~~~~~~~
       使用跟踪-恢复模式
 
I've been working at making the machines I have able to STR, and almost
always it's a driver that is buggy. Thank God for the suspend/resume
debugging - the thing that Chuck tried to disable. That's often the _only_
way to debug these things, and it's actually pretty powerful (but
time-consuming - having to insert TRACE_RESUME() markers into the device
driver that doesn't resume and recompile and reboot).
我一直努力使机器能够同步收发,他经常就像一个发疯的司机。感谢挂起/恢复
调试——查克试图禁用的东西。那通常是唯一可以调试这些东西的方法。而且非常
强大(但是很耗时,必须向未恢复、重新编译和重新引导的设备驱动插入
TRACE_RESUME()标记,)。


Anyway, the way to debug this for people who are interested (have a
machine that doesn't boot) is:


 - enable PM_DEBUG, and PM_TRACE
 
 - use a script like this:


#!/bin/sh
sync
echo 1 > /sys/power/pm_trace
echo mem > /sys/power/state


   to suspend
有兴趣的人(有一个没有引导的机器)调试的方法是:
-启用PM_DEBUG和PM_TRACE
用下面的脚本挂起:
#!/bin/sh
sync
echo 1 > /sys/power/pm_trace
echo mem > /sys/power/state

 - if it doesn't come back up (which is usually the problem), reboot by
   holding the power button down, and look at the dmesg output for things
   like


Magic number: 4:156:725
hash matches drivers/base/power/resume.c:28
hash matches device 0000:01:00.0


   which means that the last trace event was just before trying to resume
   device 0000:01:00.0. Then figure out what driver is controlling that
   device (lspci and /sys/devices/pci* is your friend), and see if you can
   fix it, disable it, or trace into its resume function.


   If no device matches the hash (or any matches appear to be false positives),
   the culprit may be a device from a loadable kernel module that is not loaded
   until after the hash is checked. You can check the hash against the current
   devices again after more modules are loaded using sysfs:


cat /sys/power/pm_trace_dev_match
如果不能恢复(这通常是问题所在),关掉电源重新引导,并查看下面的设备输出信息:
幻数:4:156:725
哈希匹配drivers/base/power/resume.c:28
哈希匹配设备0000:01:00.0
这表明最后一次追踪事件恰好在试图恢复设备0000:01:00.0之前。然后指出哪个驱动
正在控制设备(lspci and /sys/devices/pci* 是你的朋友),看你是否能够修复、禁用
或跟踪到它的恢复功能。
如果没有设备匹配哈希表(或者所有的机器都显示假阳性),罪魁祸首可能是来自哈
希查询之前不会加载的内核可加载设备。当很多模块用系统文件
cat /sys/power/pm_trace_dev_match加载之后,你可以在当前设备再次查询哈希表。


For example, the above happens to be the VGA device on my EVO, which I
used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out
that "radeonfb" simply cannot resume that device - it tries to set the
PLL's, and it just _hangs_. Using the regular VGA console and letting X
resume it instead works fine.
例如,上面的恰好是我的EVO上的VGA装置,是我用来运行"radeonfb"的(这是一个ATI Radeon
移动显卡)。这表明"radeonfb"无法恢复他试图设置锁相环的设备,他只是挂起。用常规的VGA控
制台让X回复而不是正常工作。


NOTE
====
pm_trace uses the system's Real Time Clock (RTC) to save the magic number.
Reason for this is that the RTC is the only reliably available piece of
hardware during resume operations where a value can be set that will
survive a reboot.
注意
====
pm_trace使用系统的实时时钟(RTC)来保存幻数。因为实时时钟是在恢复操作期间
唯一可靠的硬件机构。它的数值设置将导致重启。


Consequence is that after a resume (even if it is successful) your system
clock will have a value corresponding to the magic number instead of the
correct date/time! It is therefore advisable to use a program like ntp-date
or rdate to reset the correct date/time from an external time source when
using this trace option.
结果是,恢复之后(即便是成功的),你的系统时间将会根据幻数矫正而不是而
不是正确的日期/时间!这就是为什么当你使用这种跟踪方式时建议你用一个
来自外部的时间源,像ntp-date or rdate程序,重置正确的日期/时间。


As the clock keeps ticking it is also essential that the reboot is done
quickly after the resume failure. The trace option does not use the seconds
or the low order bits of the minutes of the RTC, but a too long delay will
corrupt the magic value.
如同时钟运转,恢复失败后迅速重启也很重要。跟踪选项不会使用实时时钟的秒或
分钟的低阶位,但是较长的延时会损坏幻数。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值