rptun_dump: don't get lock in IRQ handler

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-04-24 15:25:13 +08:00 committed by Xiang Xiao
parent 9e7e45df76
commit 631eb516c9

View File

@ -100,7 +100,10 @@ void rptun_dump(FAR struct rpmsg_virtio_device *rvdev)
return;
}
metal_mutex_acquire(&rdev->lock);
if (!up_interrupt_context() && !sched_idletask())
{
metal_mutex_acquire(&rdev->lock);
}
metal_log(METAL_LOG_INFO,
"Dump rpmsg info between cpu %s <==> %s:\n",
@ -119,5 +122,8 @@ void rptun_dump(FAR struct rpmsg_virtio_device *rvdev)
rptun_dump_buffer(rvdev, true);
rptun_dump_buffer(rvdev, false);
metal_mutex_release(&rdev->lock);
if (!up_interrupt_context() && !sched_idletask())
{
metal_mutex_release(&rdev->lock);
}
}