问题:
就先只说PC上的。 对应的往/sys/power/state写一个字符串,会进入suspend态, 但是Linux目前就至少支持3个:
ACPI的状态 Linux的String 说明
==============================================
S1, "standby" 很低的延迟就能回到工作状态
S3, "mem", suspend-to-RAM, STR
S4, "disk" suspend-to-disk, STD,也叫Hibernation
我想请教, 是不是这3种睡眠的 路径中, 都会调用 pci驱动的suspend/resume方法? 还是有哪种不会调用?
解答:
drivers' suspend/resume are invoked at two cases:
a) device specific Dx transition, like D0->D3
b) system level sleep request with all drivers forced with a D0->D3 request
For b), normally S3/S4 are in this category. S1 by definition doesn't require due to all device contexts preserved, but at least Linux is lazy and thus reuse same S3 path for S1.
然后是我继续确认一下有没有理解错:
Oops, what does "lazy" here mean? We usually say "lazy" as doing things until they have to be done, such as "demanding page". But here seem the "lazy" means linux doesn't implement S1 path, right?
后是得到肯定的答复
Yes, Linux treats S1/S3 exactly same.
文章来源CU社区:PCI驱动的suspend/resume方法,在何时调用?