This is an automated email from the ASF dual-hosted git repository.
GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 5e0fd7eb12f drivers/misc/rpmsgdev_server: keep the work queue per CPU
in BMP mode
5e0fd7eb12f is described below
commit 5e0fd7eb12f521ffb039e27546419f3047601c6e
Author: Yongrong Wang <[email protected]>
AuthorDate: Wed Nov 25 23:55:18 2026 +0800
drivers/misc/rpmsgdev_server: keep the work queue per CPU in BMP mode
Under CONFIG_BMP every CPU runs its own rpmsgdev server with its own
work queue, created on its first export, so g_rpmsgdev_wqueue must be
private to each CPU. Define it with DEFINE_PER_CPU_BSS_BMP(), which
leaves it a plain global when BMP is off.
Signed-off-by: Yongrong Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
---
drivers/misc/rpmsgdev_server.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/rpmsgdev_server.c b/drivers/misc/rpmsgdev_server.c
index 15f0e2b2a48..3762ad04a58 100644
--- a/drivers/misc/rpmsgdev_server.c
+++ b/drivers/misc/rpmsgdev_server.c
@@ -36,6 +36,7 @@
#include <nuttx/kmalloc.h>
#include <nuttx/mutex.h>
#include <nuttx/fs/fs.h>
+#include <nuttx/percpu.h>
#include <nuttx/wqueue.h>
#include <nuttx/drivers/rpmsgdev.h>
#include <nuttx/rpmsg/rpmsg.h>
@@ -158,7 +159,9 @@ static const rpmsg_ept_cb g_rpmsgdev_handler[] =
[RPMSGDEV_POLL] = rpmsgdev_poll_handler,
};
-static FAR struct kwork_wqueue_s *g_rpmsgdev_wqueue = NULL;
+static DEFINE_PER_CPU_BSS_BMP(FAR struct kwork_wqueue_s *,
+ g_rpmsgdev_wqueue);
+#define g_rpmsgdev_wqueue this_cpu_var_bmp(g_rpmsgdev_wqueue)
/****************************************************************************
* Private Functions