From ac26de207784fb1e4adba2f8807ff3c99be979b6 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Fri, 22 Jun 2018 12:53:06 -0700 Subject: [PATCH] qcacld-3.0: Use the regulatory sync kernel API with no lock The init thread takes the rtnl lock during initialization. So use kernel API regulatory_set_wiphy_regd that does not take the rtnl lock. Change-Id: I50e7aa96dd8c819d1531b84b181a058197d9b24f CRs-Fixed: 2265624 --- core/hdd/src/wlan_hdd_main.c | 5 +++-- core/hdd/src/wlan_hdd_regulatory.c | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fdab2b3d3240..e00298043b3b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7167,12 +7167,13 @@ static int hdd_wiphy_init(struct hdd_context *hdd_ctx) hdd_err("wiphy registration failed"); return ret_val; } + /* Check the kernel version for upstream commit aced43ce780dc5 that * has support for processing user cell_base hints when wiphy is * self managed or check the backport flag for the same. */ -#if defined CFG80211_USER_HINT_CELL_BASE_SELF_MANAGED || \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)) +#if defined CFG80211_USER_HINT_CELL_BASE_SELF_MANAGED || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)) hdd_send_wiphy_regd_sync_event(hdd_ctx); #endif diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index b8fb6b6e6186..b020b827d542 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -1270,6 +1270,9 @@ void hdd_send_wiphy_regd_sync_event(struct hdd_context *hdd_ctx) regd_rules[i].power_rule.max_eirp, regd_rules[i].flags); } + + regulatory_set_wiphy_regd(hdd_ctx->wiphy, regd); + hdd_debug("regd sync event sent with reg rules info"); qdf_mem_free(regd); }