Merge lp://staging/~jhodapp/powerd/fix-music-app-next into lp://staging/powerd
Proposed by
Jim Hodapp
Status: | Rejected |
---|---|
Rejected by: | Ricardo Salveti |
Proposed branch: | lp://staging/~jhodapp/powerd/fix-music-app-next |
Merge into: | lp://staging/powerd |
Diff against target: |
44 lines (+19/-5) 1 file modified
src/power-request.c (+19/-5) |
To merge this branch: | bzr merge lp://staging/~jhodapp/powerd/fix-music-app-next |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Seth Forshee (community) | Disapprove | ||
Ricardo Salveti | Pending | ||
Review via email: mp+229823@code.staging.launchpad.net |
Commit message
To prevent the device from suspending right away after the last lock is released, add a timeout and wait 6 seconds to release the final lock. This fixes bug: https:/
Description of the change
To prevent the device from suspending right away after the last lock is released, add a timeout and wait 6 seconds to release the final lock. This fixes bug: https:/
To post a comment you must log in.
Unmerged revisions
- 137. By Jim Hodapp
-
To prevent the device from suspending right away after the last lock is released, add a timeout and wait 6 seconds to release the final lock. This fixes bug: https:/
/bugs.launchpad .net/music- app/+bug/ 1342351
First, I'd argue that powerd shouldn't have this sort of behavior at all, and that the media hub or whoever shouldn't release it's active state request until it's really okay for the device to suspend.
Assuming that powerd should have this behavior, this isn't the right way to do it. The point of using a wake lock here is to avoid a race with the in-kernel autosuspend and handling an incoming request. I.e., block suspend in the kernel until the reqeust can get handed over to the main thread and that thread disables suspend. If powerd were ever used with a kernel lacking autosuspend (e.g. the stock distro kernels) this will fail, because there's no notion of wake locks in these kernels.
It would be better to move the call to enter_suspend() to happen in a timeout 6 seconds in the future, but you've got to make sure that the timeout is cancelled if leaving the suspend state in the interim.