Merge "cnss2: Avoid race condition between time sync and system suspend"

This commit is contained in:
qctecmdr 2020-11-12 09:55:03 -08:00 • committed by Gerrit - the friendly Code Review server
commit e8315dfb98

View file

@ -1685,7 +1685,9 @@ static void cnss_pci_time_sync_work_hdlr(struct work_struct *work)
if (cnss_pci_pm_runtime_get_sync(pci_priv, RTPM_ID_CNSS) < 0)
goto runtime_pm_put;
mutex_lock(&pci_priv->bus_lock);
cnss_pci_update_timestamp(pci_priv);
mutex_unlock(&pci_priv->bus_lock);
schedule_delayed_work(&pci_priv->time_sync_work,
msecs_to_jiffies(time_sync_period_ms));
@ -2794,7 +2796,9 @@ static int cnss_pci_suspend(struct device *dev)
goto clear_flag;
if (!pci_priv->disable_pc) {
mutex_lock(&pci_priv->bus_lock);
ret = cnss_pci_suspend_bus(pci_priv);
mutex_unlock(&pci_priv->bus_lock);
if (ret)
goto resume_driver;
}