Prechádzať zdrojové kódy

qcacmn: Fix ext Tx descriptor pool lock issue

Replace internal spin_lock macros with qdf_spin_lock APIs for lock
operating on TSO/EXT descriptor pools.
TX_DESC_LOCK_* APIs are used only by the flow_control V2 support
to by pass them.

Change-Id: I926c279de3878b6f48efd798194fa896072c1f6d
CRs-Fixed: 2142815
Manjunathappa Prakash 7 rokov pred
rodič
commit
ddf07405c5
2 zmenil súbory, kde vykonal 27 pridanie a 27 odobranie
  1. 12 12
      dp/wifi3.0/dp_tx_desc.c
  2. 15 15
      dp/wifi3.0/dp_tx_desc.h

+ 12 - 12
dp/wifi3.0/dp_tx_desc.c

@@ -246,7 +246,7 @@ QDF_STATUS dp_tx_ext_desc_pool_alloc(struct dp_soc *soc, uint8_t pool_id,
 	}
 
 	soc->tx_ext_desc[pool_id].num_free = num_elem;
-	TX_DESC_LOCK_CREATE(&soc->tx_ext_desc[pool_id].lock);
+	qdf_spinlock_create(&soc->tx_ext_desc[pool_id].lock);
 	return QDF_STATUS_SUCCESS;
 
 free_ext_link_desc_page:
@@ -281,7 +281,7 @@ QDF_STATUS dp_tx_ext_desc_pool_free(struct dp_soc *soc, uint8_t pool_id)
 		qdf_get_dma_mem_context((&soc->tx_ext_desc[pool_id]), memctx),
 		false);
 
-	TX_DESC_LOCK_DESTROY(&soc->tx_ext_desc[pool_id].lock);
+	qdf_spinlock_destroy(&soc->tx_ext_desc[pool_id].lock);
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -331,7 +331,7 @@ QDF_STATUS dp_tx_tso_desc_pool_alloc(struct dp_soc *soc, uint8_t pool_id,
 	TSO_DEBUG("Number of free descriptors: %u\n",
 			soc->tx_tso_desc[pool_id].num_free);
 	soc->tx_tso_desc[pool_id].pool_size = num_elem;
-	TX_DESC_LOCK_CREATE(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spinlock_create(&soc->tx_tso_desc[pool_id].lock);
 
 	return QDF_STATUS_SUCCESS;
 
@@ -359,11 +359,11 @@ void dp_tx_tso_desc_pool_free(struct dp_soc *soc, uint8_t pool_id)
 	struct qdf_tso_seg_elem_t *c_element;
 	struct qdf_tso_seg_elem_t *temp;
 
-	TX_DESC_LOCK_LOCK(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_tso_desc[pool_id].lock);
 	c_element = soc->tx_tso_desc[pool_id].freelist;
 
 	if (!c_element) {
-		TX_DESC_LOCK_UNLOCK(&soc->tx_tso_desc[pool_id].lock);
+		qdf_spin_unlock_bh(&soc->tx_tso_desc[pool_id].lock);
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 			FL("Desc Pool Corrupt %d"), pool_id);
 			return;
@@ -380,8 +380,8 @@ void dp_tx_tso_desc_pool_free(struct dp_soc *soc, uint8_t pool_id)
 	soc->tx_tso_desc[pool_id].freelist = NULL;
 	soc->tx_tso_desc[pool_id].num_free = 0;
 	soc->tx_tso_desc[pool_id].pool_size = 0;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_tso_desc[pool_id].lock);
-	TX_DESC_LOCK_DESTROY(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spinlock_destroy(&soc->tx_tso_desc[pool_id].lock);
 	return;
 }
 /**
@@ -429,7 +429,7 @@ QDF_STATUS dp_tx_tso_num_seg_pool_alloc(struct dp_soc *soc, uint8_t pool_id,
 	}
 
 	soc->tx_tso_num_seg[pool_id].num_seg_pool_size = num_elem;
-	TX_DESC_LOCK_CREATE(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spinlock_create(&soc->tx_tso_num_seg[pool_id].lock);
 
 	return QDF_STATUS_SUCCESS;
 
@@ -457,11 +457,11 @@ void dp_tx_tso_num_seg_pool_free(struct dp_soc *soc, uint8_t pool_id)
 	struct qdf_tso_num_seg_elem_t *c_element;
 	struct qdf_tso_num_seg_elem_t *temp;
 
-	TX_DESC_LOCK_LOCK(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_tso_num_seg[pool_id].lock);
 	c_element = soc->tx_tso_num_seg[pool_id].freelist;
 
 	if (!c_element) {
-		TX_DESC_LOCK_UNLOCK(&soc->tx_tso_num_seg[pool_id].lock);
+		qdf_spin_unlock_bh(&soc->tx_tso_num_seg[pool_id].lock);
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 			FL("Desc Pool Corrupt %d"), pool_id);
 			return;
@@ -478,8 +478,8 @@ void dp_tx_tso_num_seg_pool_free(struct dp_soc *soc, uint8_t pool_id)
 	soc->tx_tso_num_seg[pool_id].freelist = NULL;
 	soc->tx_tso_num_seg[pool_id].num_free = 0;
 	soc->tx_tso_num_seg[pool_id].num_seg_pool_size = 0;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_tso_num_seg[pool_id].lock);
-	TX_DESC_LOCK_DESTROY(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spinlock_destroy(&soc->tx_tso_num_seg[pool_id].lock);
 	return;
 }
 

+ 15 - 15
dp/wifi3.0/dp_tx_desc.h

@@ -367,16 +367,16 @@ struct dp_tx_ext_desc_elem_s *dp_tx_ext_desc_alloc(struct dp_soc *soc,
 {
 	struct dp_tx_ext_desc_elem_s *c_elem;
 
-	TX_DESC_LOCK_LOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 	if (soc->tx_ext_desc[desc_pool_id].num_free <= 0) {
-		TX_DESC_LOCK_UNLOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+		qdf_spin_unlock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 		return NULL;
 	}
 	c_elem = soc->tx_ext_desc[desc_pool_id].freelist;
 	soc->tx_ext_desc[desc_pool_id].freelist =
 		soc->tx_ext_desc[desc_pool_id].freelist->next;
 	soc->tx_ext_desc[desc_pool_id].num_free--;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 	return c_elem;
 }
 
@@ -391,11 +391,11 @@ struct dp_tx_ext_desc_elem_s *dp_tx_ext_desc_alloc(struct dp_soc *soc,
 static inline void dp_tx_ext_desc_free(struct dp_soc *soc,
 	struct dp_tx_ext_desc_elem_s *elem, uint8_t desc_pool_id)
 {
-	TX_DESC_LOCK_LOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 	elem->next = soc->tx_ext_desc[desc_pool_id].freelist;
 	soc->tx_ext_desc[desc_pool_id].freelist = elem;
 	soc->tx_ext_desc[desc_pool_id].num_free++;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 	return;
 }
 
@@ -431,11 +431,11 @@ static inline void dp_tx_ext_desc_free_multiple(struct dp_soc *soc,
 	/* caller should always guarantee atleast list of num_free nodes */
 	qdf_assert_always(tail);
 
-	TX_DESC_LOCK_LOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 	tail->next = soc->tx_ext_desc[desc_pool_id].freelist;
 	soc->tx_ext_desc[desc_pool_id].freelist = head;
 	soc->tx_ext_desc[desc_pool_id].num_free += num_free;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_ext_desc[desc_pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_ext_desc[desc_pool_id].lock);
 
 	return;
 }
@@ -456,14 +456,14 @@ static inline struct qdf_tso_seg_elem_t *dp_tx_tso_desc_alloc(
 {
 	struct qdf_tso_seg_elem_t *tso_seg = NULL;
 
-	TX_DESC_LOCK_LOCK(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_tso_desc[pool_id].lock);
 	if (soc->tx_tso_desc[pool_id].freelist) {
 		soc->tx_tso_desc[pool_id].num_free--;
 		tso_seg = soc->tx_tso_desc[pool_id].freelist;
 		soc->tx_tso_desc[pool_id].freelist =
 			soc->tx_tso_desc[pool_id].freelist->next;
 	}
-	TX_DESC_LOCK_UNLOCK(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_tso_desc[pool_id].lock);
 
 	return tso_seg;
 }
@@ -482,11 +482,11 @@ static inline struct qdf_tso_seg_elem_t *dp_tx_tso_desc_alloc(
 static inline void dp_tx_tso_desc_free(struct dp_soc *soc,
 		uint8_t pool_id, struct qdf_tso_seg_elem_t *tso_seg)
 {
-	TX_DESC_LOCK_LOCK(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_tso_desc[pool_id].lock);
 	tso_seg->next = soc->tx_tso_desc[pool_id].freelist;
 	soc->tx_tso_desc[pool_id].freelist = tso_seg;
 	soc->tx_tso_desc[pool_id].num_free++;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_tso_desc[pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_tso_desc[pool_id].lock);
 }
 
 static inline
@@ -495,14 +495,14 @@ struct qdf_tso_num_seg_elem_t  *dp_tso_num_seg_alloc(struct dp_soc *soc,
 {
 	struct qdf_tso_num_seg_elem_t *tso_num_seg = NULL;
 
-	TX_DESC_LOCK_LOCK(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_tso_num_seg[pool_id].lock);
 	if (soc->tx_tso_num_seg[pool_id].freelist) {
 		soc->tx_tso_num_seg[pool_id].num_free--;
 		tso_num_seg = soc->tx_tso_num_seg[pool_id].freelist;
 		soc->tx_tso_num_seg[pool_id].freelist =
 			soc->tx_tso_num_seg[pool_id].freelist->next;
 	}
-	TX_DESC_LOCK_UNLOCK(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_tso_num_seg[pool_id].lock);
 
 	return tso_num_seg;
 }
@@ -511,11 +511,11 @@ static inline
 void dp_tso_num_seg_free(struct dp_soc *soc,
 		uint8_t pool_id, struct qdf_tso_num_seg_elem_t *tso_num_seg)
 {
-	TX_DESC_LOCK_LOCK(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spin_lock_bh(&soc->tx_tso_num_seg[pool_id].lock);
 	tso_num_seg->next = soc->tx_tso_num_seg[pool_id].freelist;
 	soc->tx_tso_num_seg[pool_id].freelist = tso_num_seg;
 	soc->tx_tso_num_seg[pool_id].num_free++;
-	TX_DESC_LOCK_UNLOCK(&soc->tx_tso_num_seg[pool_id].lock);
+	qdf_spin_unlock_bh(&soc->tx_tso_num_seg[pool_id].lock);
 }
 #endif