qcacmn: Tie PM usage count to descriptor allocation and free

Tie increment and decrement PM usage count to descriptor allocation
and free instead of HW enqueue and TX completion since allocation
and free will be the most accurate places to track if the packet
has been sent or not.

Change-Id: Ia61c5bb26386d20590e87149d0fe88dba02d0fb7
CRs-fixed: 2302214
This commit is contained in:
Yue Ma
2018-08-23 12:39:23 -07:00
committed by nshrivas
parent 1f8f319500
commit 442d36e967
2 changed files with 16 additions and 11 deletions

View File

@@ -185,6 +185,15 @@ dp_tx_desc_alloc(struct dp_soc *soc, uint8_t desc_pool_id)
} else {
qdf_spin_unlock_bh(&pool->flow_pool_lock);
}
/*
* If one packet is going to be sent, PM usage count
* needs to be incremented by one to prevent future
* runtime suspend. This should be tied with the
* success of allocating one descriptor. It will be
* decremented after the packet has been sent.
*/
hif_pm_runtime_get_noresume(soc->hif_handle);
} else {
pool->pkt_drop_no_desc++;
qdf_spin_unlock_bh(&pool->flow_pool_lock);
@@ -230,7 +239,7 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc,
qdf_spin_unlock_bh(&pool->flow_pool_lock);
qdf_print("%s %d pool is freed!!",
__func__, __LINE__);
return;
goto out;
}
break;
@@ -244,6 +253,12 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc,
qdf_spin_unlock_bh(&pool->flow_pool_lock);
out:
/**
* Decrement PM usage count if the packet has been sent. This
* should be tied with the success of freeing one descriptor.
*/
hif_pm_runtime_put(soc->hif_handle);
}
#else /* QCA_LL_TX_FLOW_CONTROL_V2 */