yushuailong opened a new pull request, #20139:
URL: https://github.com/apache/nuttx/pull/20139
## Summary
Fix three issues found while reviewing the clock and CPU-load paths:
* Keep the RTC synchronized when `CLOCK_REALTIME` is changed with
`CONFIG_CLOCK_TIMEKEEPING=y`. The existing RTC update path is now shared by
both timekeeping and non-timekeeping configurations, including the LPWORK path
for RTC drivers that may block.
* Validate the PID hash entry before updating critical-monitor CPU-load
data. This prevents an invalid or stale PID from passing a NULL TCB to
`nxsched_update_critmon()` and keeps the TCB stable under the existing
scheduler critical section.
* Normalize `CLOCK_FD` failures from `clock_getres()`. Errors from PTP clock
lookup and `PTP_CLOCK_GETRES` now return `ERROR` and set `errno`, matching the
public API convention used by the other `clock_getres()` paths.
## Impact
bug fix only
## Testing
* Build host: macOS 26.6.2 ARM64, Apple Clang 21.0.0.
* Target: `sim:ostest`.
* Relevant configuration:
* `CONFIG_CLOCK_TIMEKEEPING=y`
* `CONFIG_RTC=y`
* `CONFIG_RTC_ARCH=y`
* `CONFIG_RTC_DRIVER=y`
* `CONFIG_SCHED_LPWORK=y`
* `CONFIG_SCHED_CRITMONITOR=y`
* `CONFIG_SCHED_CPULOAD_CRITMONITOR=y`
* `CONFIG_PTP_CLOCK=y`
* `CONFIG_PTP_CLOCK_DUMMY=y`
* Build: `make` completes successfully with `LD: nuttx`.
* Static checks: `nxstyle`, `checkpatch` pass.
* Runtime smoke test: `./nuttx` starts and proceeds through enabled OSTest
cases without an assertion in the observed run.
--
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]