Browse Source

qcacld-3.0: Check for vdev/pdev leaks during SSR

Currently, all resource leaks are skipped during the SSR reinit stage.
However, recently added vdev and pdev leak checks apply equally as well
to SSR reinit. During SSR do as many resource leak checks as possible,
while retaining the entire set for normal use cases.

Change-Id: I33248a9fb0fbacddf9ea8682ff984290712c29d3
CRs-Fixed: 2284384
Dustin Brown 6 years ago
parent
commit
29533f2ca1
2 changed files with 12 additions and 10 deletions
  1. 12 8
      core/hdd/src/wlan_hdd_main.c
  2. 0 2
      core/hdd/src/wlan_hdd_power.c

+ 12 - 8
core/hdd/src/wlan_hdd_main.c

@@ -2703,6 +2703,7 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx)
 /**
  * hdd_check_for_leaks() - Perform runtime memory leak checks
  * @hdd_ctx: the global HDD context
+ * @is_ssr: true if SSR is in progress
  *
  * This API triggers runtime memory leak detection. This feature enforces the
  * policy that any memory allocated at runtime must also be released at runtime.
@@ -2714,12 +2715,17 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx)
  *
  * Return: None
  */
-static void hdd_check_for_leaks(struct hdd_context *hdd_ctx)
+static void hdd_check_for_leaks(struct hdd_context *hdd_ctx, bool is_ssr)
 {
 	/* DO NOT REMOVE these checks; for false positives, read above first */
 
 	wlan_objmgr_psoc_check_for_vdev_leaks(hdd_ctx->hdd_psoc);
 	wlan_objmgr_psoc_check_for_pdev_leaks(hdd_ctx->hdd_psoc);
+
+	/* many adapter resources are not freed by design during SSR */
+	if (is_ssr)
+		return;
+
 	qdf_mc_timer_check_for_leaks();
 	qdf_nbuf_map_check_for_leaks();
 	qdf_mem_check_for_leaks();
@@ -2727,7 +2733,8 @@ static void hdd_check_for_leaks(struct hdd_context *hdd_ctx)
 
 #define hdd_debug_domain_set(domain) qdf_debug_domain_set(domain)
 #else
-static inline void hdd_check_for_leaks(struct hdd_context *hdd_ctx) { }
+static inline void hdd_check_for_leaks(struct hdd_context *hdd_ctx, bool is_ssr)
+{ }
 
 #define hdd_debug_domain_set(domain)
 #endif /* CONFIG_LEAK_DETECTION */
@@ -2980,9 +2987,8 @@ release_lock:
 		qdf_mem_free(hdd_ctx->target_hw_name);
 		hdd_ctx->target_hw_name = NULL;
 	}
-	/* many adapter resources are not freed by design in SSR case */
-	if (!reinit)
-		hdd_check_for_leaks(hdd_ctx);
+
+	hdd_check_for_leaks(hdd_ctx, reinit);
 	hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT);
 
 	hdd_exit();
@@ -10923,9 +10929,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
 				ret);
 	}
 
-	/* many adapter resources are not freed by design in SSR case */
-	if (!is_recovery_stop)
-		hdd_check_for_leaks(hdd_ctx);
+	hdd_check_for_leaks(hdd_ctx, is_recovery_stop);
 	hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT);
 
 	/* Once the firmware sequence is completed reset this flag */

+ 0 - 2
core/hdd/src/wlan_hdd_power.c

@@ -1246,8 +1246,6 @@ QDF_STATUS hdd_wlan_shutdown(void)
 
 	hdd_lpass_notify_stop(hdd_ctx);
 
-	wlan_objmgr_print_ref_all_objects_per_psoc(hdd_ctx->hdd_psoc);
-
 	hdd_info("WLAN driver shutdown complete");
 
 	return QDF_STATUS_SUCCESS;