From 6142448043e1c82b57aa0cb9fa82fd568497ee8b Mon Sep 17 00:00:00 2001 From: Vignesh Kulothungan Date: Tue, 12 May 2020 14:20:35 -0700 Subject: [PATCH] soc: remove reslock usage during wakeup vote/unvote Remove reslock usage from device wakeup vote and unvote functions. Mutex lock 'reslock' is to used only within runtime resume and suspend functions, to avoid race conditions between them. Change-Id: I221b00db2e762a0803b898a62cd98db1fe3ae3fa Signed-off-by: Vignesh Kulothungan --- soc/swr-mstr-ctrl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index 7deb11b2ba83..2762d08b290e 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -2204,14 +2204,12 @@ static void swrm_device_wakeup_vote(struct swr_master *mstr) dev_err(swrm->dev, "%s Failed to hold suspend\n", __func__); return; } - mutex_lock(&swrm->reslock); if (swrm_request_hw_vote(swrm, LPASS_HW_CORE, true)) dev_err(swrm->dev, "%s:lpass core hw enable failed\n", __func__); if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) dev_err(swrm->dev, "%s:lpass audio hw enable failed\n", __func__); - mutex_unlock(&swrm->reslock); pm_runtime_get_sync(swrm->dev); } @@ -2228,10 +2226,8 @@ static void swrm_device_wakeup_unvote(struct swr_master *mstr) pm_runtime_mark_last_busy(swrm->dev); pm_runtime_put_autosuspend(swrm->dev); - mutex_lock(&swrm->reslock); swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false); swrm_request_hw_vote(swrm, LPASS_HW_CORE, false); - mutex_unlock(&swrm->reslock); swrm_unlock_sleep(swrm); }