From 993758ccc4fc49ba6488951f088abc407abc4b0d Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Thu, 17 Jun 2021 18:32:54 +0530 Subject: [PATCH] qcacld-3.0: Reschedule country change work Country change is a psoc operation and currently driver does not try to reschedule country change work if it fails to start this psoc operation and because of which it does not update the scan channel list to the FW because of which host and FW are not in sync. To address this issue, reschedule country change work if it gets and status of -EAGAIN when it tries to start the country change psoc operation. Change-Id: Ib93674b600a5d19fe3091d58e0689e806366659d CRs-Fixed: 2968772 --- core/hdd/src/wlan_hdd_regulatory.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index d607a8165d87..4ef4e33e8d35 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -122,6 +122,7 @@ hdd_world_regrules_67_68_6A_6C = { } }; +#define OSIF_PSOC_SYNC_OP_WAIT_TIME 500 /** * hdd_get_world_regrules() - get the appropriate world regrules * @reg: regulatory data @@ -1644,8 +1645,16 @@ static void hdd_country_change_work_handle(void *arg) return; errno = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy), &psoc_sync); - if (errno) + + if (errno == -EAGAIN) { + qdf_sleep(OSIF_PSOC_SYNC_OP_WAIT_TIME); + hdd_debug("rescheduling country change work"); + qdf_sched_work(0, &hdd_ctx->country_change_work); return; + } else if (errno) { + hdd_err("can not handle country change %d", errno); + return; + } __hdd_country_change_work_handle(hdd_ctx);