diff options
| author | wadesong <wadesong@codeaurora.org> | 2017-09-14 14:58:34 +0800 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-09-21 13:17:21 -0700 |
| commit | a3ffbac10f82badba84ab90d6b604763a23db78d (patch) | |
| tree | 7f3edf7d5b7cea9c6c7260ae8b7016689e64dd6c | |
| parent | d4a8db2614038ace11ada2fdec6a9ae6ad7bef37 (diff) | |
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
| -rw-r--r-- | core/dp/htt/htt.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c index efe0448242f2..6de0442a237c 100644 --- a/core/dp/htt/htt.c +++ b/core/dp/htt/htt.c @@ -423,6 +423,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)) @@ -464,10 +467,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; |
