mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 02:36:11 +08:00
rpmsgdev_server: use a separate workqueue to process poll
it will block other works of the list of hpwork when it waits to get buffer for too long. so use a separate workqueue for rpmsgdev. Signed-off-by: liaoao <liaoao@xiaomi.com>
This commit is contained in:
@@ -39,6 +39,18 @@ config DEV_RPMSG_SERVER
|
||||
default n
|
||||
depends on RPMSG
|
||||
|
||||
if DEV_RPMSG_SERVER
|
||||
|
||||
config DEV_RPMSG_SERVER_WORK_PRIORITY
|
||||
int "Rpmsg Device Server Work Priority"
|
||||
default 224
|
||||
|
||||
config DEV_RPMSG_SERVER_WORK_STACKSIZE
|
||||
int "Rpmsg Device Server Work Stack Size"
|
||||
default DEFAULT_TASK_STACKSIZE
|
||||
|
||||
endif # DEV_RPMSG_SERVER
|
||||
|
||||
choice
|
||||
prompt "Select OP-TEE dev implementation"
|
||||
default DEV_OPTEE_NONE
|
||||
|
||||
@@ -134,6 +134,8 @@ static const rpmsg_ept_cb g_rpmsgdev_handler[] =
|
||||
[RPMSGDEV_POLL] = rpmsgdev_poll_handler,
|
||||
};
|
||||
|
||||
static FAR struct kwork_wqueue_s *g_rpmsgdev_wqueue = NULL;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
@@ -361,7 +363,8 @@ static void rpmsgdev_poll_cb(FAR struct pollfd *fds)
|
||||
DEBUGASSERT(fds != NULL);
|
||||
|
||||
server = fds->arg;
|
||||
work_queue(HPWORK, &server->work, rpmsgdev_poll_worker, fds, 0);
|
||||
work_queue_wq(g_rpmsgdev_wqueue, &server->work, rpmsgdev_poll_worker,
|
||||
fds, 0);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -566,6 +569,17 @@ int rpmsgdev_export(FAR const char *remotecpu, FAR const char *localpath)
|
||||
|
||||
int rpmsgdev_server_init(void)
|
||||
{
|
||||
if (g_rpmsgdev_wqueue == NULL)
|
||||
{
|
||||
g_rpmsgdev_wqueue = work_queue_create("rpmsgdev_server",
|
||||
CONFIG_DEV_RPMSG_SERVER_WORK_PRIORITY, NULL,
|
||||
CONFIG_DEV_RPMSG_SERVER_WORK_STACKSIZE, 1);
|
||||
if (g_rpmsgdev_wqueue == NULL)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
}
|
||||
|
||||
return rpmsg_register_callback(NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
Reference in New Issue
Block a user