mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:05:39 +08:00
drivers/rpmsg: fix recursive assert when call rpmsg_dump_all() in irq
Because call mutex lock is forbidden in interrupt. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
+10
-2
@@ -491,7 +491,11 @@ int rpmsg_ioctl(FAR const char *cpuname, int cmd, unsigned long arg)
|
||||
FAR struct metal_list *node;
|
||||
int ret = OK;
|
||||
|
||||
nxrmutex_lock(&g_rpmsg_lock);
|
||||
if (!up_interrupt_context())
|
||||
{
|
||||
nxrmutex_lock(&g_rpmsg_lock);
|
||||
}
|
||||
|
||||
metal_list_for_each(&g_rpmsg, node)
|
||||
{
|
||||
FAR struct rpmsg_s *rpmsg =
|
||||
@@ -507,7 +511,11 @@ int rpmsg_ioctl(FAR const char *cpuname, int cmd, unsigned long arg)
|
||||
}
|
||||
}
|
||||
|
||||
nxrmutex_unlock(&g_rpmsg_lock);
|
||||
if (!up_interrupt_context())
|
||||
{
|
||||
nxrmutex_unlock(&g_rpmsg_lock);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user