qcacld-3.0: Initialize some locks before they are used
htt_tx_mutex, NBUF_QUEUE_MUTEX and HTT credit_mutex should all be initialized before the related message handlers are connected to their corresponding services, or there will be racing conditions happening during WLAN driver initialization which will cause the Linux kernel complaining for bad magic of spin locks and triggers watch dog bite. Change-Id: Id89185d811bcbed95732f142ed6fd611e0d6e2a4 CRs-Fixed: 2109674
This commit is contained in:
@@ -430,6 +430,9 @@ htt_pdev_alloc(ol_txrx_pdev_handle txrx_pdev,
|
||||
* since htt_rx_attach involves sending a rx ring configure
|
||||
* message to the target.
|
||||
*/
|
||||
HTT_TX_MUTEX_INIT(&pdev->htt_tx_mutex);
|
||||
HTT_TX_NBUF_QUEUE_MUTEX_INIT(pdev);
|
||||
HTT_TX_MUTEX_INIT(&pdev->credit_mutex);
|
||||
if (htt_htc_attach_all(pdev))
|
||||
goto htt_htc_attach_fail;
|
||||
if (hif_ce_fastpath_cb_register(osc, htt_t2h_msg_handler_fast, pdev))
|
||||
@@ -439,6 +442,9 @@ success:
|
||||
return pdev;
|
||||
|
||||
htt_htc_attach_fail:
|
||||
HTT_TX_MUTEX_DESTROY(&pdev->credit_mutex);
|
||||
HTT_TX_MUTEX_DESTROY(&pdev->htt_tx_mutex);
|
||||
HTT_TX_NBUF_QUEUE_MUTEX_DESTROY(pdev);
|
||||
qdf_mem_free(pdev);
|
||||
|
||||
fail1:
|
||||
@@ -467,10 +473,6 @@ htt_attach(struct htt_pdev_t *pdev, int desc_pool_size)
|
||||
if (ret)
|
||||
goto fail2;
|
||||
|
||||
HTT_TX_MUTEX_INIT(&pdev->htt_tx_mutex);
|
||||
HTT_TX_NBUF_QUEUE_MUTEX_INIT(pdev);
|
||||
HTT_TX_MUTEX_INIT(&pdev->credit_mutex);
|
||||
|
||||
/* pre-allocate some HTC_PACKET objects */
|
||||
for (i = 0; i < HTT_HTC_PKT_POOL_INIT_SIZE; i++) {
|
||||
struct htt_htc_pkt_union *pkt;
|
||||
|
Reference in New Issue
Block a user