Skip to content

Commit

Permalink
arm/cxd56xx: replace spin lock to critical section to avoid recursion
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <anchao@lixiang.com>
  • Loading branch information
anchao committed Oct 13, 2024
1 parent 5010235 commit 0e4b190
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/src/cxd56xx/cxd56_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ int up_rtc_settime(const struct timespec *tp)
irqstate_t flags;
uint64_t count;

flags = spin_lock_irqsave(NULL);
flags = enter_critical_section();

#ifdef RTC_DIRECT_CONTROL
/* wait until previous write request is completed */
Expand All @@ -455,7 +455,7 @@ int up_rtc_settime(const struct timespec *tp)
g_rtc_save->offset = (int64_t)count - (int64_t)cxd56_rtc_count();
#endif

spin_unlock_irqrestore(NULL, flags);
leave_critical_section(flags);

rtc_dumptime(tp, "Setting time");

Expand Down

0 comments on commit 0e4b190

Please sign in to comment.