summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoddar, Siddarth <siddpodd@codeaurora.org>2017-01-04 16:51:54 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-06 21:07:30 -0800
commit0ad41429ca1e06bb27f6f804115e9c51d9582cdd (patch)
treed275542be97e603bc29c6bf07ccb9f852fc08098
parent42970ee11eb526e61c3861bea9e08705721c6728 (diff)
qcacld-3.0: Move TXRX_PRINT outside of peer_map_unmap_lock spinlock
Sometimes TXRX_PRINT is taking more time to process as some other printks' are already in progress. As this TXRX_PRINT is inside spinlock, so when some other core is also competing for this spinlock, that core keeps iterating in a loop. After some time spinlock bug is triggered as it is suspected that this core is locked on this spinlock. To fix this, move the TXRX_PRINT outside spinlock so that the other core don't have to wait to acquire spinlock due to this TXRX_PRINT. CRs-Fixed: 1107213 Change-Id: Ie6f8a7c8f9731883c2440641b8b9542f9d40c4a9
-rw-r--r--core/dp/txrx/ol_txrx_peer_find.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/core/dp/txrx/ol_txrx_peer_find.c b/core/dp/txrx/ol_txrx_peer_find.c
index 9b1263751a8a..e287f25cfd1d 100644
--- a/core/dp/txrx/ol_txrx_peer_find.c
+++ b/core/dp/txrx/ol_txrx_peer_find.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -530,6 +530,7 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id)
{
struct ol_txrx_peer_t *peer;
int i = 0;
+ int32_t ref_cnt;
if (peer_id == HTT_INVALID_PEER) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
@@ -544,12 +545,12 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id)
/* This peer_id belongs to a peer already deleted */
qdf_atomic_dec(&pdev->peer_id_to_obj_map[peer_id].
del_peer_id_ref_cnt);
+ ref_cnt = qdf_atomic_read(&pdev->peer_id_to_obj_map[peer_id].
+ del_peer_id_ref_cnt);
qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock);
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
"%s: Remove the ID %d reference to deleted peer. del_peer_id_ref_cnt %d",
- __func__, peer_id,
- qdf_atomic_read(&pdev->peer_id_to_obj_map[peer_id].
- del_peer_id_ref_cnt));
+ __func__, peer_id, ref_cnt);
return;
}
peer = pdev->peer_id_to_obj_map[peer_id].peer;
@@ -577,11 +578,11 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id)
}
}
}
- TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
- "%s: Remove the ID %d reference to peer %p peer_id_ref_cnt %d",
- __func__, peer_id, peer,
- qdf_atomic_read
- (&pdev->peer_id_to_obj_map[peer_id].peer_id_ref_cnt));
+
+ ref_cnt = qdf_atomic_read
+ (&pdev->peer_id_to_obj_map[peer_id].peer_id_ref_cnt);
+
+ qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock);
/*
* Remove a reference to the peer.
@@ -589,7 +590,9 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id)
*/
ol_txrx_peer_unref_delete(peer);
- qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock);
+ TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
+ "%s: Remove the ID %d reference to peer %p peer_id_ref_cnt %d",
+ __func__, peer_id, peer, ref_cnt);
}
/**