qcacld-3.0: Init start completion in fw down instead of reovery shutdown

Currently driver initializes start completion on recovery shutdown
which leads to an issue where userspace thread does not wait when
it writes state ctrl params with below event sequence because of
which wifi on fails.
On fw down driver sets recovery in progress, on shutdown it resets
wlan_start_complete and on reinit, it sets wlan_start_complete.
Now if driver again receives fw down it sets recovery in progress and
when userspace tries to write state ctrl param this thread does not
wait here as wlan_start_comp was set in previous SSR sequence.
If driver does not block this thread, userspace tries to iface up
which fails because SSR is still in progress.

To address above issue, init start completion in fw down instead of
recovery shutdown so that driver can block the state ctrl param thread
until SSR completes, when it tries to set the params.

Change-Id: I3fe3768b1ec431620b37055d783de0201371e774
CRs-Fixed: 3244479
This commit is contained in:
Ashish 2022-04-14 18:27:17 +05:30 committed by Madan Koyyalamudi
parent d1bd8e66e9
commit 4c069f07e7
2 changed files with 4 additions and 1 deletions

View File

@ -982,7 +982,6 @@ static void __hdd_soc_recovery_shutdown(void)
/* recovery starts via firmware down indication; ensure we got one */
QDF_BUG(cds_is_driver_recovering());
hdd_init_start_completion();
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
@ -2097,6 +2096,7 @@ wlan_hdd_pld_uevent(struct device *dev, struct pld_uevent_data *event_data)
cds_set_target_ready(false);
cds_set_recovery_in_progress(true);
hdd_init_start_completion();
/* Notify external threads currently waiting on firmware
* by forcefully completing waiting events with a "reset"

View File

@ -16870,6 +16870,9 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
goto exit;
}
hdd_info("is_driver_loaded %d is_driver_recovering %d",
cds_is_driver_loaded(), cds_is_driver_recovering());
if (!cds_is_driver_loaded() || cds_is_driver_recovering()) {
rc = wait_for_completion_timeout(&wlan_start_comp,
msecs_to_jiffies(HDD_WLAN_START_WAIT_TIME));