Ver Fonte

qcacmn: Fix issue that DFS NOL can't be cleared

When SAP off and psoc idle shutdown happens before NOL timeout,
DFS pdev obj is destroyed, NOL timer is cleared, NOL channel
is failed to clear for regulatory pdev obj is freed already.

To fix it, let NOL timer and NOL be cleared in dispatcher_pdev_close,
before pdev destroy and regulatory pdev obj destroyed.

Change-Id: I5818f8a0284a6c45e8a435ac59269df73507deeb
CRs-Fixed: 3151099
Jianmin Zhu há 3 anos atrás
pai
commit
d94f0fb619

+ 8 - 0
init_deinit/dispatcher/src/dispatcher_init_deinit.c

@@ -492,6 +492,12 @@ static QDF_STATUS dispatcher_regulatory_pdev_close(struct wlan_objmgr_pdev
 	return regulatory_pdev_close(pdev);
 }
 
+static QDF_STATUS dispatcher_dfs_pdev_close(struct wlan_objmgr_pdev
+						  *pdev)
+{
+	return dfs_pdev_close(pdev);
+}
+
 #ifdef WLAN_SA_API_ENABLE
 static QDF_STATUS dispatcher_init_sa_api(void)
 {
@@ -1563,6 +1569,8 @@ QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev)
 
 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_pdev_close(pdev));
 
+	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dfs_pdev_close(pdev));
+
 	return QDF_STATUS_SUCCESS;
 }
 qdf_export_symbol(dispatcher_pdev_close);

+ 9 - 1
umac/dfs/dispatcher/inc/wlan_dfs_init_deinit_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
- *
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -49,6 +49,14 @@ QDF_STATUS dfs_init(void);
  */
 QDF_STATUS dfs_deinit(void);
 
+/**
+ * dfs_pdev_close() - Close dfs component
+ * @pdev: Pointer to pdev structure.
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS dfs_pdev_close(struct wlan_objmgr_pdev *pdev);
+
 /**
  * wlan_dfs_pdev_obj_create_notification() - DFS pdev object create handler.
  * @pdev: Pointer to DFS pdev object.

+ 16 - 1
umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c

@@ -406,6 +406,22 @@ QDF_STATUS dfs_deinit(void)
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS dfs_pdev_close(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_dfs *dfs = NULL;
+
+	if (!pdev) {
+		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,  "PDEV is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	dfs = wlan_pdev_get_dfs_obj(pdev);
+	if (dfs)
+		dfs_detach(dfs);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev,
 		void *arg)
 {
@@ -528,7 +544,6 @@ QDF_STATUS wlan_dfs_pdev_obj_destroy_notification(struct wlan_objmgr_pdev *pdev,
 
 	/* DFS is NULL during unload. should we call this function before */
 	if (dfs) {
-		dfs_detach(dfs);
 		global_dfs_to_mlme.pdev_component_obj_detach(pdev,
 				WLAN_UMAC_COMP_DFS,
 				(void *)dfs);