Browse Source

icnss2: create soc wake wq only for wcn6750 device

Soc wake feature is only required for wcn6750 device.
So, this change moves soc wake wq creation only for
wcn6750 device.

Change-Id: Ib564d8bfd10c98aad3595bb10e5a2660f9049f85
Signed-off-by: Sandeep Singh <[email protected]>
Sandeep Singh 3 years ago
parent
commit
3f3761e143
2 changed files with 17 additions and 17 deletions
  1. 16 17
      icnss2/main.c
  2. 1 0
      icnss2/qmi.c

+ 16 - 17
icnss2/main.c

@@ -4215,21 +4215,10 @@ static int icnss_probe(struct platform_device *pdev)
 	INIT_WORK(&priv->event_work, icnss_driver_event_work);
 	INIT_LIST_HEAD(&priv->event_list);
 
-	priv->soc_wake_wq = alloc_workqueue("icnss_soc_wake_event",
-					    WQ_UNBOUND|WQ_HIGHPRI, 1);
-	if (!priv->soc_wake_wq) {
-		icnss_pr_err("Soc wake Workqueue creation failed\n");
-		ret = -EFAULT;
-		goto out_destroy_wq;
-	}
-
-	INIT_WORK(&priv->soc_wake_msg_work, icnss_soc_wake_msg_work);
-	INIT_LIST_HEAD(&priv->soc_wake_msg_list);
-
 	ret = icnss_register_fw_service(priv);
 	if (ret < 0) {
 		icnss_pr_err("fw service registration failed: %d\n", ret);
-		goto out_destroy_soc_wq;
+		goto out_destroy_wq;
 	}
 
 	icnss_enable_recovery(priv);
@@ -4248,6 +4237,17 @@ static int icnss_probe(struct platform_device *pdev)
 	init_completion(&priv->unblock_shutdown);
 
 	if (priv->device_id == WCN6750_DEVICE_ID) {
+		priv->soc_wake_wq = alloc_workqueue("icnss_soc_wake_event",
+						    WQ_UNBOUND|WQ_HIGHPRI, 1);
+		if (!priv->soc_wake_wq) {
+			icnss_pr_err("Soc wake Workqueue creation failed\n");
+			ret = -EFAULT;
+			goto out_unregister_fw_service;
+		}
+
+		INIT_WORK(&priv->soc_wake_msg_work, icnss_soc_wake_msg_work);
+		INIT_LIST_HEAD(&priv->soc_wake_msg_list);
+
 		ret = icnss_genl_init();
 		if (ret < 0)
 			icnss_pr_err("ICNSS genl init failed %d\n", ret);
@@ -4276,8 +4276,8 @@ static int icnss_probe(struct platform_device *pdev)
 
 	return 0;
 
-out_destroy_soc_wq:
-	destroy_workqueue(priv->soc_wake_wq);
+out_unregister_fw_service:
+	icnss_unregister_fw_service(priv);
 out_destroy_wq:
 	destroy_workqueue(priv->event_wq);
 smmu_cleanup:
@@ -4340,6 +4340,8 @@ static int icnss_remove(struct platform_device *pdev)
 		icnss_destroy_ramdump_device(priv->m3_dump_wmac0reg);
 		icnss_destroy_ramdump_device(priv->m3_dump_wcssdbg);
 		icnss_destroy_ramdump_device(priv->m3_dump_phyapdmem);
+		if (priv->soc_wake_wq)
+			destroy_workqueue(priv->soc_wake_wq);
 	}
 
 	class_destroy(priv->icnss_ramdump_class);
@@ -4349,9 +4351,6 @@ static int icnss_remove(struct platform_device *pdev)
 	if (priv->event_wq)
 		destroy_workqueue(priv->event_wq);
 
-	if (priv->soc_wake_wq)
-		destroy_workqueue(priv->soc_wake_wq);
-
 	priv->iommu_domain = NULL;
 
 	icnss_hw_power_off(priv);

+ 1 - 0
icnss2/qmi.c

@@ -2972,6 +2972,7 @@ int icnss_register_fw_service(struct icnss_priv *priv)
 
 void icnss_unregister_fw_service(struct icnss_priv *priv)
 {
+	set_bit(ICNSS_DEL_SERVER, &priv->state);
 	qmi_handle_release(&priv->qmi);
 }