Commit fc44a2e
pm: fix suspend counter increment only on successful validation
The suspend counter was incremented even when VALIDATE_REQ()
failed, causing the counter to grow indefinitely on duplicate pause
requests. This led to continuous validation failures and required
multiple resume calls to exit the suspended state.
Move the counter increment inside the VALIDATE_REQ() conditional block
to ensure it only increments on successful validation.
Before fix: Multiple resume requests needed to match pause count
After fix: Single resume request properly exits suspended state
Reproduce sequence:
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b true
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b true
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b true
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b true
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b true
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b false
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b false
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b false
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b false
busctl --user introspect org.clight.clight /org/clight/clight | grep Suspended
.Suspended property b true emits-change
busctl --user call org.clight.clight /org/clight/clight org.clight.clight Pause b false
busctl --user introspect org.clight.clight /org/clight/clight | grep Suspended
.Suspended property b false emits-change
Signed-off-by: LI Qingwu <[email protected]>1 parent 3842dcb commit fc44a2e
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | 271 | | |
0 commit comments