You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2025/11/25 01:50:19 UTC

(nuttx) branch master updated (02db473e97b -> df17524e551)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from 02db473e97b drivers/eeprom: Set the bus frequency
     new a2328156487 sched/signal: Fix remaining time calculation in nxsig_clockwait()
     new 7421846c94b sched/signal: Remove redundant wd_cancel() in nxsig_clockwait()
     new df17524e551 sched/signal: Use clock_compare() in nxsig_clockwait()

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 sched/signal/sig_timedwait.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)


(nuttx) 03/03: sched/signal: Use clock_compare() in nxsig_clockwait()

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit df17524e55176fda4c45b845b7ced7e064faf0db
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Sun Nov 23 22:36:40 2025 +0800

    sched/signal: Use clock_compare() in nxsig_clockwait()
    
    clock_compare() should be used when comparing clock tick values to
    ensure correct handling of tick wrap-around and time ordering.
    
    Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
---
 sched/signal/sig_timedwait.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c
index e419305d51f..234e472fb07 100644
--- a/sched/signal/sig_timedwait.c
+++ b/sched/signal/sig_timedwait.c
@@ -256,7 +256,7 @@ int nxsig_clockwait(int clockid, int flags,
         }
 
         wd_start_abstick(&rtcb->waitdog, expect,
-                          nxsig_timeout, (uintptr_t)rtcb);
+                         nxsig_timeout, (uintptr_t)rtcb);
     }
 
   /* Remove the tcb task from the ready-to-run list. */
@@ -283,7 +283,8 @@ int nxsig_clockwait(int clockid, int flags,
 
   if (rqtp && rmtp && expect)
     {
-      clock_ticks2time(rmtp, expect > stop ? expect - stop : 0);
+      clock_ticks2time(rmtp,
+                       clock_compare(stop, expect) ? expect - stop : 0);
     }
 
   return 0;


(nuttx) 01/03: sched/signal: Fix remaining time calculation in nxsig_clockwait()

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a2328156487656157e92cfc12c8db3fe91325e81
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Sun Nov 23 21:46:34 2025 +0800

    sched/signal: Fix remaining time calculation in nxsig_clockwait()
    
    Always compute the expected wake-up time by default, so the remaining
    time can be calculated correctly when the flag is not TIMER_ABSTIME.
    
    Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
---
 sched/signal/sig_timedwait.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c
index 1837a7a4547..55c193ccbe6 100644
--- a/sched/signal/sig_timedwait.c
+++ b/sched/signal/sig_timedwait.c
@@ -238,19 +238,25 @@ int nxsig_clockwait(int clockid, int flags,
       if ((flags & TIMER_ABSTIME) == 0)
         {
           expect = clock_delay2abstick(clock_time2ticks(rqtp));
-          wd_start_abstick(&rtcb->waitdog, expect,
-                           nxsig_timeout, (uintptr_t)rtcb);
         }
       else if (clockid == CLOCK_REALTIME)
         {
-          wd_start_realtime(&rtcb->waitdog, rqtp,
-                            nxsig_timeout, (uintptr_t)rtcb);
+#ifdef CONFIG_CLOCK_TIMEKEEPING
+          clock_t delay;
+
+          clock_abstime2ticks(CLOCK_REALTIME, rqtp, &delay);
+          expect = clock_delay2abstick(delay);
+#else
+          clock_realtime2absticks(rqtp, &expect);
+#endif
         }
       else
         {
-          wd_start_abstime(&rtcb->waitdog, rqtp,
-                           nxsig_timeout, (uintptr_t)rtcb);
+          expect = clock_time2ticks(rqtp);
         }
+
+        wd_start_abstick(&rtcb->waitdog, expect,
+                          nxsig_timeout, (uintptr_t)rtcb);
     }
 
   /* Remove the tcb task from the ready-to-run list. */


(nuttx) 02/03: sched/signal: Remove redundant wd_cancel() in nxsig_clockwait()

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7421846c94bf152f2a612b0793e40efac95dfdc7
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Sun Nov 23 21:48:32 2025 +0800

    sched/signal: Remove redundant wd_cancel() in nxsig_clockwait()
    
    Both the watchdog timeout and signal dispatch paths already cancel
    the watchdog timer, so the explicit wd_cancel() call is redundant.
    
    Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
---
 sched/signal/sig_timedwait.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c
index 55c193ccbe6..e419305d51f 100644
--- a/sched/signal/sig_timedwait.c
+++ b/sched/signal/sig_timedwait.c
@@ -276,7 +276,6 @@ int nxsig_clockwait(int clockid, int flags,
 
   if (rqtp)
     {
-      wd_cancel(&rtcb->waitdog);
       stop = clock_systime_ticks();
     }