News for hackers. Stuff that matters.
Re:Why does Linux have so much trouble sleeping and waking? by Overdr0ne on Friday December 11, 2020 @12:57PM (#25388584)
No. Linux drivers are supposed to implement runtime_pm callbacks. These are called based on the usage counter of those devices. ACPI is an Intel/microsoft standard for power state definition with spotty compliance. How and when you put those devices into whatever power state, ACPI or not is dictated by those callbacks. Bugs seem to most often occur when you turn off something when it is still being used cuz someone failed to claim it or released it too soon. Also asic bugs in their definitions of their power states.
Re:Why does Linux have so much trouble sleeping and waking? by dyingkneepad on Friday December 11, 2020 @01:44PM (#25389120)
runtime_pm is generally for runtime suspend (Intel calls it s0ix) instead of S3 suspend. You can implement S3 suspend using the same callbacks as your runtime_pm callbacks, but you don't need to.

The runtime_pm framework is for when applications are still running but the device goes to sleep. In S3 suspend first every single user space application freezes, then the drivers go to sleep. S3 is much easier to implement.

Re:Why does Linux have so much trouble sleeping and waking? by Overdr0ne on Friday December 11, 2020 @04:57PM (#25391751)
I think ideally all pm would be controlled by the runtime_pm and qos frameworks. You then don't need to define explicit power states like 'sleep' or 'suspend', you instead simply use what you need for a given performance spec and naturally use a minimum of power. I think that is the ultimate plan
Re:Why does Linux have so much trouble sleeping and waking? by dyingkneepad on Friday December 11, 2020 @06:20PM (#25393006)
It's not that simple. There's a lot of predicting the future when it comes to power management. When you put things to sleep in order to save power you add latency, because waking up the hardware and restoring its state takes a long time. It's all tradeoffs, and "use minimum power" is taking the slider and shifting it all the way to one side.