From 0e1214d89ab427aa367afb265f540c6cbe4fc4e7 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 20 Jan 2025 14:56:49 +0800 Subject: [PATCH] syslog/intbuffer: fix spinlock deadlock just read the code, still have the deadlock after below change: | commit 3b6f463ce2b54d1934e4357b4ea1d81635161c95 | Author: chenrun1 | Date: Tue Dec 31 14:31:46 2024 +0800 | | syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario | | Summary: | When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer | | Signed-off-by: chenrun1 Signed-off-by: chao an --- drivers/syslog/syslog_intbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/syslog/syslog_intbuffer.c b/drivers/syslog/syslog_intbuffer.c index 2c7ea76df7f..49ff7409392 100644 --- a/drivers/syslog/syslog_intbuffer.c +++ b/drivers/syslog/syslog_intbuffer.c @@ -165,7 +165,7 @@ void syslog_add_intbuffer(FAR const char *buffer, size_t buflen) } else { - syslog_flush_intbuffer(true); + syslog_flush_internal(true, sizeof(g_syslog_intbuffer.buffer)); space = buflen - sizeof(g_syslog_intbuffer.buffer); syslog_write_foreach(buffer, space, true); circbuf_write(&g_syslog_intbuffer.circ,