rptun: add ns_match callback to resolve rptun deadlock

thread A: accept -> net_lock -> socket_rpmsg_accept
          -> rpmsg_register_callabck -> rptun_lock
thread B: ns_bind -> rpmsg_socket_ns_bind -> get_tx_payload_buffer
          -> rptun_wait_tx -> usrsock_rpmsg_ept_cb -> usrsockdev_write
          -> net_lock -> deadlock

fix:
add ns_match callback

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2022-06-06 16:38:11 +08:00
committed by Xiang Xiao
parent 033cd4d7df
commit 8a3683fb9f
15 changed files with 213 additions and 112 deletions
+1
View File
@@ -450,5 +450,6 @@ int syslog_rpmsg_init(void)
return rpmsg_register_callback(&g_syslog_rpmsg,
syslog_rpmsg_device_created,
syslog_rpmsg_device_destroy,
NULL,
NULL);
}