浏览代码

qcacld-3.0: Fix stability issue while unload driver

During unload driver, if hdd_reg_notifier to be called
from kernel, it has the possibility that cause
regulatory_update_event to be reset after it has been
destroyed, which causes "Failed assertion 'event->cookie
== LINUX_EVENT_COOKIE'". So adds this fix to ignore the
regulatory notify request if it is in unloading state.
Meanwhile destroy the event after unregister wiphy
also can help on such kind of issue.

Change-Id: I527517c7f1443a4e211782f74b03e2fca40ab552
CRs-Fixed: 3028357
Chaoli Zhou 3 年之前
父节点
当前提交
f4c44548b4
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 1 2
      core/hdd/src/wlan_hdd_main.c
  2. 6 0
      core/hdd/src/wlan_hdd_regulatory.c

+ 1 - 2
core/hdd/src/wlan_hdd_main.c

@@ -9001,8 +9001,6 @@ void hdd_wlan_exit(struct hdd_context *hdd_ctx)
 
 	hdd_wlan_stop_modules(hdd_ctx, false);
 
-	hdd_deinit_regulatory_update_event(hdd_ctx);
-
 	hdd_driver_memdump_deinit();
 
 	qdf_nbuf_deinit_replenish_timer();
@@ -9032,6 +9030,7 @@ void hdd_wlan_exit(struct hdd_context *hdd_ctx)
 		hdd_lpass_notify_stop(hdd_ctx);
 	}
 
+	hdd_deinit_regulatory_update_event(hdd_ctx);
 	hdd_exit_netlink_services(hdd_ctx);
 #ifdef FEATURE_WLAN_CH_AVOID
 	mutex_destroy(&hdd_ctx->avoid_freq_lock);

+ 6 - 0
core/hdd/src/wlan_hdd_regulatory.c

@@ -940,6 +940,12 @@ void hdd_reg_notifier(struct wiphy *wiphy,
 	bool update_already_in_progress =
 		hdd_ctx->is_regulatory_update_in_progress;
 
+	if (cds_is_driver_unloading() || cds_is_driver_recovering() ||
+	    cds_is_driver_in_bad_state()) {
+		hdd_err("unloading or ssr in progress, ignore");
+		return;
+	}
+
 	hdd_debug("country: %c%c, initiator %d, dfs_region: %d",
 		  request->alpha2[0],
 		  request->alpha2[1],