You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/17 11:01:03 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5232: rpmsg_rtc: resolve deadlock when the receive SYNC cmd

pkarashchenko commented on a change in pull request #5232:
URL: https://github.com/apache/incubator-nuttx/pull/5232#discussion_r785837255



##########
File path: drivers/timers/rpmsg_rtc.c
##########
@@ -472,18 +468,22 @@ static int rpmsg_rtc_server_settime(FAR struct rtc_lowerhalf_s *lower,
                          (FAR struct rpmsg_rtc_server_s *)lower;
   FAR struct rpmsg_rtc_client_s *client;
   FAR struct list_node *node;
-  struct rpmsg_rtc_header_s header;
   int ret;
+  struct rpmsg_rtc_set_s msg =
+  {
+    .sec  = timegm((FAR struct tm *)rtctime),
+    .nsec = rtctime->tm_nsec,

Review comment:
       C89 incompatible

##########
File path: sched/clock/clock_initialize.c
##########
@@ -155,14 +155,22 @@ int clock_basetime(FAR struct timespec *tp)
  ****************************************************************************/
 
 #ifdef CONFIG_RTC
-static void clock_inittime(void)
+static void clock_inittime(FAR const struct timespec *tp)
 {
   /* (Re-)initialize the time value to match the RTC */
 
 #ifndef CONFIG_CLOCK_TIMEKEEPING
   struct timespec ts;
 
-  clock_basetime(&g_basetime);
+  if (tp)
+    {
+      memcpy(&g_basetime, tp, sizeof(struct timespec));

Review comment:
       Maybe can go with the shorter `g_clock_wall_time = *tp;` as in `clock_timekeeping_set_wall_time` or switch to `memcpy` there. Just for style consistency.

##########
File path: drivers/timers/rpmsg_rtc.c
##########
@@ -310,7 +297,16 @@ static int rpmsg_rtc_ept_cb(FAR struct rpmsg_endpoint *ept, FAR void *data,
       break;
 
     case RPMSG_RTC_SYNC:
-      rpmsg_rtc_sync_handler(priv);
+        {
+          struct rpmsg_rtc_set_s *msg = data;
+          struct timespec tp =
+          {
+            .tv_sec  = msg->sec,
+            .tv_nsec = msg->nsec,
+          };

Review comment:
       C89 incompatible




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org