Skip to content
Commit 11a59047 authored by Maochen Wang's avatar Maochen Wang Committed by Alberto Escolar
Browse files

net: arp: Fix dead lock caused by arp_mutex



Fix the dead lock between rx_q and tx_q thread.
When tx_q thread prepares to send ARP packet, it might get
the net_if_tx_lock in net_if_tx(), then in net_arp_prepare(),
it will try to get the arp_mutex.
At the same time, if the rx_q thread receives an ARP reply
packet, in arp_update(), it will get the arp_mutex first,
and flush the packets in arp pending_queue and try to get
the net_if_tx_lock. Then the dead lock occurs, two threads
stuck and all the packcets can't be freed.
In arp_update(), taking the net_if_tx_lock first then taking
the arp_mutex can fix this issue.

Signed-off-by: default avatarMaochen Wang <maochen.wang@nxp.com>
parent f9dddc38
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment