From 0e4b190b73bf0e57ad45300d7ba959aa77f19af9 Mon Sep 17 00:00:00 2001 From: chao an Date: Sun, 13 Oct 2024 17:50:05 +0800 Subject: [PATCH] arm/cxd56xx: replace spin lock to critical section to avoid recursion Signed-off-by: chao an --- arch/arm/src/cxd56xx/cxd56_rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/cxd56xx/cxd56_rtc.c b/arch/arm/src/cxd56xx/cxd56_rtc.c index 4f68af643ecc1..593f7111fd7ec 100644 --- a/arch/arm/src/cxd56xx/cxd56_rtc.c +++ b/arch/arm/src/cxd56xx/cxd56_rtc.c @@ -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 */ @@ -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");