Browse Source

qcacld-3.0: Fix tx queue is paused forever

Put flow control setting in the flow_pool_lock, which can avoid
race condition between ol_tx_desc_free and ol_tx_desc_alloc.
This is a refine based on Ib60139fd94a4fb88c92a7f8aaf886ae9d3ca4c75.

Change-Id: I8d89323b5631039d7ff5a141775cc5825389c18b
CRs-Fixed: 2297190
Jingxiang Ge 6 years ago
parent
commit
7cdb955b0f
1 changed files with 3 additions and 4 deletions
  1. 3 4
      core/dp/txrx/ol_tx_desc.c

+ 3 - 4
core/dp/txrx/ol_tx_desc.c

@@ -209,7 +209,6 @@ struct ol_tx_desc_t *ol_tx_desc_alloc(struct ol_txrx_pdev_t *pdev,
 				(pool->avail_desc >= pool->stop_priority_th) &&
 				(pool->status == FLOW_POOL_ACTIVE_UNPAUSED))) {
 			pool->status = FLOW_POOL_NON_PRIO_PAUSED;
-			qdf_spin_unlock_bh(&pool->flow_pool_lock);
 			/* pause network NON PRIORITY queues */
 			pdev->pause_cb(vdev->vdev_id,
 				       WLAN_STOP_NON_PRIORITY_QUEUE,
@@ -218,14 +217,14 @@ struct ol_tx_desc_t *ol_tx_desc_alloc(struct ol_txrx_pdev_t *pdev,
 						pool->stop_priority_th) &&
 				pool->status == FLOW_POOL_NON_PRIO_PAUSED)) {
 			pool->status = FLOW_POOL_ACTIVE_PAUSED;
-			qdf_spin_unlock_bh(&pool->flow_pool_lock);
 			/* pause priority queue */
 			pdev->pause_cb(vdev->vdev_id,
 				       WLAN_NETIF_PRIORITY_QUEUE_OFF,
 				       WLAN_DATA_FLOW_CONTROL_PRIORITY);
-		} else {
-			qdf_spin_unlock_bh(&pool->flow_pool_lock);
 		}
+
+		qdf_spin_unlock_bh(&pool->flow_pool_lock);
+
 		ol_tx_desc_sanity_checks(pdev, tx_desc);
 		ol_tx_desc_compute_delay(tx_desc);
 		ol_tx_desc_update_tx_ts(tx_desc);