Repository navigation
system/nxinit: retry pollers that declare events - #4048
Merged
xiaoxiang781216 merged 4 commits intoNov 14, 2026
Merged
Conversation
Call the poller handler when its fd is negative, so a poller that opens its fd later gets a chance to open it. Signed-off-by: fangpeina <fangpeina@xiaomi.com> Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Cap the ppoll timeout at 100ms while any poller has a negative fd so its handler keeps being called when init is idle, and also call the handler when its fd reports POLLHUP or POLLERR. Assisted-by: OpenCode:mimo-v2.6-pro Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The simple property backend keeps its poll fd at -1, so the INIT_POLLER_RETRY_MS (100ms) retry woke init ten times a second. Only retry pollers that declare events. Assisted-by: OpenCode:mimo-v2.6-pro Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Passing a plain char to isblank() may yield a negative value other than EOF on signed-char target, which violates MISRA C:2012 Rule 21.13 and is undefined behavior. Cast the arguments to unsigned char. Signed-off-by: shenjunyuan <shenjunyuan@xiaomi.com> Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
JianyuWang0623
marked this pull request as ready for review
November 13, 2026 09:02
xiaoxiang781216
approved these changes
Nov 13, 2026
acassis
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Let nxinit pollers that open their fd lazily retry while init is idle,
and only retry pollers that declare poll events, so a poller with no fd
and no events (such as the simple property backend) no longer wakes init
every 100ms. Also cast isblank() arguments to unsigned char in the
init.rc parser.
Impact
Testing
Environment: esp32p4-pico-wifi-wareshare:nsh (simple property
backend),
apache/nuttx562db43781f5,nuttx-apps= this branch.A temporary test chain (init.rc snippet below, not part of the
patch) prints the marker
TEST_PROPTRIG_OKfrom theon property:action, so the marker in the boot log proves
setpropreached theaction:
Boot log — init starts the console service and the test chain fires
(
Error TEST_PROPTRIG_OK argv1=baris the marker printed by theon property:action above):Services (
ps):Idle wake counting: a temporary counter (not in the patch) counts
every
ppoll()return and prints oneWAKECOUNTline per secondthat contains a return. Two captures: reset + 40s window (including
sim:nsh (CONFIG_SYSTEM_NXINIT=y) build clean, smoke boot:
checkpatch (community CI profile):