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:
parent
67e41d0e32
commit
1f96a0b5e9
@ -491,7 +491,11 @@ int rpmsg_ioctl(FAR const char *cpuname, int cmd, unsigned long arg)
|
|||||||
FAR struct metal_list *node;
|
FAR struct metal_list *node;
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
nxrmutex_lock(&g_rpmsg_lock);
|
if (!up_interrupt_context())
|
||||||
|
{
|
||||||
|
nxrmutex_lock(&g_rpmsg_lock);
|
||||||
|
}
|
||||||
|
|
||||||
metal_list_for_each(&g_rpmsg, node)
|
metal_list_for_each(&g_rpmsg, node)
|
||||||
{
|
{
|
||||||
FAR struct rpmsg_s *rpmsg =
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user