[linux-pm] States we need to represent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

pm_message_t should represent distinct values at least for following: 

APM_STANDBY     -- prepare for APM event. Theoretically, drivers do
		not need to do anything. In practice, it is very good
		idea to put devices into low power state.
APM_SUSPEND	-- same as APM_STANDBY, but it we should probably
		avoid spinning down disks.
SYSTEM_HALT     -- nothing is needed except in very rare cases. 
SYSTEM_REBOOT   -- nothing is needed except in very rare cases. 
SYSTEM_SHUTDOWN -- at least disks need to be spun down, or data is
		lost. On non-broken hardware, nothing is needed.
SUSPEND_DISK_DOWN -- very similar to SYSTEM_SHUTDOWN, except wake
		may need to be enabled on some devices.
SUSPEND_RAM      -- put devices into low power state
SUSPEND_DISK_FREEZE -- stop DMA and interrupts. No need to put devices
		into low power mode, but you must be able to
		reinitialize device from scratch in resume method.
DEV_DETACH      -- deinitialize device; proably same as
		SYSTEM_SHUTDOWN, I do not understand this one too much.
FULL_ON      -- device is working normally; this is probably never passed
		to suspend() method...

Now... How to split this? Perhaps we need major code and flags field?
If driver does not know major code, it aborts the request, returning
error. Unknown flag should be non-fatal.

What are major codes? Probably

ON
FREEZE
SUSPEND

are needed. Then mapping would be

APM_STANDBY     -- major = SUSPEND, flags = APM_TO_RAM
APM_SUSPEND	-- major = SUSPEND, flags = APM_TO_DISK
SYSTEM_HALT     -- major = ON, flags = HALT
SYSTEM_REBOOT   -- major = ON, flags = REBOOT
SYSTEM_SHUTDOWN -- major = ON, flags = SHUTDOWN
SUSPEND_DISK_DOWN -- major = ON, flags = SHUTDOWN, SUSPEND_TO_DISK
SUSPEND_RAM      -- major = SUSPEND, flags = SUSPEND_TO_RAM
SUSPEND_DISK_FREEZE -- major = FREEZE, flags = ON_SUSPENDING_KERNEL
SUSPEND_DISK_FREEZE -- major = FREEZE, flags = ON_RESUMING_KERNEL
DEV_DETACH      -- major = FREEZE, flags = DEV_DETACH

How does this look? [Ok, major scares me, probably it should be
event=, flags=]
								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux