icnss2: Fix race condition during SOC wake req/release

Read ref count in soc event work to avoid race between
reading and updating ref count.

Change-Id: Ife9249cc4c76577a0ccd7113d17cef3fd703215a
Signed-off-by: Naman Padhiar <npadhiar@codeaurora.org>
This commit is contained in:
Naman Padhiar 2020-09-30 18:18:52 +05:30
commit 4fdb5b1f58

View file

@ -2347,12 +2347,6 @@ int icnss_force_wake_request(struct device *dev)
icnss_pr_dbg("Calling SOC Wake request");
if (atomic_read(&priv->soc_wake_ref_count)) {
count = atomic_inc_return(&priv->soc_wake_ref_count);
icnss_pr_dbg("SOC already awake, Ref count: %d", count);
return 0;
}
icnss_soc_wake_event_post(priv, ICNSS_SOC_WAKE_REQUEST_EVENT,
0, NULL);