xhh233 commented on PR #22457: URL: https://github.com/apache/nuttx/pull/22457#issuecomment-7236494121
Revised per your point — the fix now lives entirely in `pm_changestate()` and `pm_idle.c` is back to its upstream form. Three changes: 1. a positive veto is mapped to `-EBUSY`, so the return value is `OK` or a negative errno as the rest of the kernel expects; 2. `pm_stats_preparefail()` now tests `ret != OK` instead of `ret < 0`, so a positive veto is also counted in the prepare-failure statistics (the revert pass does not call it — see the `if (!restore)` guard — so the forward traversal was the only path to fix); 3. the caller statement in my earlier note was wrong and is corrected: 94 of 95 in-tree call sites only use the value as a predicate, but `BOARDIOC_PM_CHANGESTATE` (`boards/boardctl.c:338`) forwards it to userspace, where the negative case becomes `-1` with `errno == EBUSY`. That is the observable correction the defecwas about, not a hidden compatibility break. Diff is `drivers/power/pm/pm_changestate.c +13 −1`; the previous `pm_idle.c` hunk is dropped. Re-requesting review. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
