|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
Why can't you support sleep at any arbitrary time?
Why can't you take whatever action you would be taking at "user selects 'prepare for sleep' time" at actual ystem go to sleep time?
What is it you need to do in the 'prepare for sleep' menu item? I'd suggest that you bite the bullet and go ahead and implement a full sleep/wake handler, because disabling sleep isn't an option.
• Your driver can stall the going to sleep process for an arbitrary amount of time to finish whatever it needs to do, like complete outstanding I/Os
• And there are a number of ways to block incoming I/O requests while your device is going to sleep, and any time the hardware is unavailable. I'd be happy to talk about some IOWorkLoop techniques you can use to synchronize access to your hw if this is the problem.
You cannot disable sleep on a portable.
Desktop machines will not fully sleep if there's a non-power managed PCI card attached. We intentionally don't grant portables this luxury. If you're writing a driver for a ExpressCard, it needs to be power managed.
Even in userland, a menu item sleep or a closed-clamshell sleep does not generate a kIOMessageCanSystemSleep message. Only idle sleep is cancellable; any kind of "forced" sleep is non-cancellable.
Bummer. Are you familiar with FireWire kprintf debugging? As long as your device isn't a FireWire device of some sort, this will be super handy for you. FireWire kprintf's let you get printf-style logs out of a computer via the FireWire port throughout the sleep/wake process, past the point where ethernet and disks power off.
So I'd recommend you get some FireWire kprintf logs of this sleep problem and send it to me, or preferably file a bug to Apple through ADC. Here's FW kprintf debugging instructions:
1. Download and install FireWire SDK 23:
2. Navigate to /Developer/FireWireSDK23/Tools/FireWireKPrintf 1.1.5
3. Open ReadMe.rtf
4. Per instructions in ReadMe.rtf:
• Install AppleFireWireKPrintf.kext on PowerBook with wake issue
• Run: sudo nvram boot-args = "debug=0x14e io=0x80"
• Connect to a 2nd mac and run FireWireKPrintfViewer to collect logs
Please collect logs from one successful sleep/wake, and at least one or two failed wakes from sleep. And thank you!!
I/O Kit Power Management
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
|>Power Management (sleep) questions (From: Jim Wintermyre <email@hidden>)|
Visit the Apple Store online or at retail locations.
Copyright © 2011 Apple Inc. All rights reserved.