mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
Merge "cnss2: Serialize driver unload and idle restart"
This commit is contained in:
commit
6f6eca97d9
3 changed files with 20 additions and 5 deletions
|
|
@ -32,7 +32,6 @@
|
|||
#define FW_ASSERT_TIMEOUT 5000
|
||||
#define CNSS_EVENT_PENDING 2989
|
||||
#define COLD_BOOT_CAL_SHUTDOWN_DELAY_MS 50
|
||||
#define WLAN_WD_TIMEOUT_MS 60000
|
||||
|
||||
#define CNSS_QUIRKS_DEFAULT BIT(DISABLE_IO_COHERENCY)
|
||||
#ifdef CONFIG_CNSS_EMULATION
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#define QMI_WLFW_MAX_BUILD_ID_LEN 128
|
||||
#define CNSS_RDDM_TIMEOUT_MS 20000
|
||||
#define RECOVERY_TIMEOUT 60000
|
||||
#define WLAN_WD_TIMEOUT_MS 60000
|
||||
#define TIME_CLOCK_FREQ_HZ 19200000
|
||||
#define CNSS_RAMDUMP_MAGIC 0x574C414E
|
||||
#define CNSS_RAMDUMP_VERSION 0
|
||||
|
|
|
|||
|
|
@ -1428,7 +1428,7 @@ int cnss_pci_call_driver_probe(struct cnss_pci_data *pci_priv)
|
|||
}
|
||||
clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state);
|
||||
clear_bit(CNSS_DRIVER_IDLE_RESTART, &plat_priv->driver_state);
|
||||
complete(&plat_priv->power_up_complete);
|
||||
complete_all(&plat_priv->power_up_complete);
|
||||
} else {
|
||||
complete(&plat_priv->power_up_complete);
|
||||
}
|
||||
|
|
@ -2123,25 +2123,40 @@ void cnss_wlan_unregister_driver(struct cnss_wlan_driver *driver_ops)
|
|||
{
|
||||
struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL);
|
||||
int ret = 0;
|
||||
unsigned int timeout;
|
||||
|
||||
if (!plat_priv) {
|
||||
cnss_pr_err("plat_priv is NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (plat_priv->device_id == QCA6174_DEVICE_ID ||
|
||||
!test_bit(CNSS_DRIVER_IDLE_RESTART, &plat_priv->driver_state))
|
||||
goto skip_wait_idle_restart;
|
||||
|
||||
timeout = cnss_get_qmi_timeout(plat_priv);
|
||||
ret = wait_for_completion_timeout(&plat_priv->power_up_complete,
|
||||
msecs_to_jiffies((timeout << 1) +
|
||||
WLAN_WD_TIMEOUT_MS));
|
||||
if (!ret) {
|
||||
cnss_pr_err("Timeout waiting for idle restart to complete\n");
|
||||
CNSS_ASSERT(0);
|
||||
}
|
||||
|
||||
skip_wait_idle_restart:
|
||||
if (!test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state) &&
|
||||
!test_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state))
|
||||
goto skip_wait;
|
||||
goto skip_wait_recovery;
|
||||
|
||||
reinit_completion(&plat_priv->recovery_complete);
|
||||
ret = wait_for_completion_timeout(&plat_priv->recovery_complete,
|
||||
RECOVERY_TIMEOUT);
|
||||
msecs_to_jiffies(RECOVERY_TIMEOUT));
|
||||
if (!ret) {
|
||||
cnss_pr_err("Timeout waiting for recovery to complete\n");
|
||||
CNSS_ASSERT(0);
|
||||
}
|
||||
|
||||
skip_wait:
|
||||
skip_wait_recovery:
|
||||
cnss_driver_event_post(plat_priv,
|
||||
CNSS_DRIVER_EVENT_UNREGISTER_DRIVER,
|
||||
CNSS_EVENT_SYNC_UNINTERRUPTIBLE, NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue