Zepp-Hanzj opened a new pull request, #19514:
URL: https://github.com/apache/nuttx/pull/19514

   ## Summary
   
   Registering `/dev/rtc0` from `up_rtc_initialize()` creates its
   PseudoFS inode before `clock_inittime()` synchronizes
   `CLOCK_REALTIME`. As a result, the inode timestamp is zero and
   `ls -l /dev` omits the date for `rtc0`.
   
   Keep the RTC lower-half setup in the early initialization path so it
   can still provide the system time. Defer registration of the RTC
   character device to `up_initialize()`, after clock initialization has
   completed.
   
   Fixes #19504.
   
   ## Impact
   
   This change only affects the SIM RTC initialization order. The
   `/dev/rtc0` inode now receives a valid creation timestamp. RTC time
   synchronization and the RTC driver interface are unchanged.
   
   ## Testing
   
   Host:
   
   - Ubuntu 20.04.6 LTS under WSL2, x86_64
   - Board configuration: `sim:nsh`
   
   The baseline and fixed builds used identical `.config` files, verified
   with `cmp`.
   
   Before this change on `master`:
   
   ```text
   nsh> ls -l /dev
    crw-------           0 rtc0
   nsh> date
   Fri, Jul 24 02:24:43 2026
   ```
   
   After this change:
   
   ```text
   nsh> ls -l /dev
    crw-------           0 2026-07-24 02:16 rtc0
   nsh> date
   Fri, Jul 24 02:16:59 2026
   ```
   
   Additional checks:
   
   - `./tools/checkpatch.sh -f` passes for all modified files.
   - `sim:nsh` builds successfully.
   - `sim:ostest`, which does not enable RTC support, builds successfully.
   


-- 
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]

Reply via email to