mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
icnss2: Avoid race between SOC wake requests
Add check for ref count inside work that if SOC wake request is already sent, increment ref count and return without actually sending request to FW. Change-Id: Ia70e1699001c885b2a76b173ca1106f5555d55ea Signed-off-by: Naman Padhiar <npadhiar@codeaurora.org>
This commit is contained in:
parent
610e9488fb
commit
dbb6f25a6d
1 changed files with 7 additions and 0 deletions
|
|
@ -850,6 +850,7 @@ static int icnss_driver_event_fw_ready_ind(struct icnss_priv *priv, void *data)
|
|||
|
||||
set_bit(ICNSS_FW_READY, &priv->state);
|
||||
clear_bit(ICNSS_MODE_ON, &priv->state);
|
||||
atomic_set(&priv->soc_wake_ref_count, 0);
|
||||
|
||||
if (priv->device_id == WCN6750_DEVICE_ID)
|
||||
icnss_free_qdss_mem(priv);
|
||||
|
|
@ -1091,6 +1092,12 @@ static int icnss_event_soc_wake_request(struct icnss_priv *priv, void *data)
|
|||
if (!priv)
|
||||
return -ENODEV;
|
||||
|
||||
if (atomic_inc_not_zero(&priv->soc_wake_ref_count)) {
|
||||
icnss_pr_dbg("SOC awake after posting work, Ref count: %d",
|
||||
atomic_read(&priv->soc_wake_ref_count));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = wlfw_send_soc_wake_msg(priv, QMI_WLFW_WAKE_REQUEST_V01);
|
||||
if (!ret)
|
||||
atomic_inc(&priv->soc_wake_ref_count);
|
||||
|
|
|
|||
Loading…
Reference in a new issue