From 3f2ceb8b9fe0e1e1f93c04e84ada2f909bd4c326 Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Fri, 10 May 2019 15:33:09 +0530 Subject: [PATCH] qcacmn: Fix deadlock due to peer_ref_mutex and scn_lock Deadlock happens when control path takes scn_lock and calls dp_peer_unref_delete() which in tern tries to acquire peer_ref_mutex. At the same time, if other core starts handling peer_unmap by acquiring peer_ref_mutex and calls dp_reset_and_release_peer_mem() which in turn calls ol_ath_node_free() and tries to acquire scn_lock leading to a deadlock. Fix this by unlocking peer_ref_mutex before calling dp_reset_and_release_peer_mem(). Change-Id: I343a8ef8f0914f9245a06b2818c9cbbe1db5218f CRs-Fixed: 2449878 --- dp/wifi3.0/dp_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index e0a0a742c4b2..3c962fc6332a 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -5655,7 +5655,9 @@ void dp_peer_unref_delete(void *peer_handle) /* cleanup the peer data */ dp_peer_cleanup(vdev, peer); + qdf_spin_unlock_bh(&soc->peer_ref_mutex); dp_reset_and_release_peer_mem(soc, pdev, peer, vdev); + qdf_spin_lock_bh(&soc->peer_ref_mutex); /* check whether the parent vdev has no peers left */ if (TAILQ_EMPTY(&vdev->peer_list)) {