Merge "soc: qcom: rpmh: Do not use spin_trylock()"

This commit is contained in:
qctecmdr
2023-12-20 22:31:46 -08:00
committed by Gerrit - the friendly Code Review server
2 changed files with 10 additions and 7 deletions

View File

@@ -1218,6 +1218,13 @@ int rpmh_rsc_is_tcs_completed(struct rsc_drv *drv, int ch)
sts &= CH1_WAKE_TCS_STATUS;
retry--;
/*
* Wait till all the WAKE votes of the new channel are
* applied during channel switch.
* Maximum delay of 100 usec.
*/
if (!sts)
udelay(10);
} while (!sts && retry);
if (!retry) {

View File

@@ -445,6 +445,7 @@ int _rpmh_flush(struct rpmh_ctrlr *ctrlr, int ch)
*/
int rpmh_flush(struct rpmh_ctrlr *ctrlr, int ch)
{
unsigned long flags;
int ret;
if (rpmh_standalone)
@@ -464,14 +465,9 @@ int rpmh_flush(struct rpmh_ctrlr *ctrlr, int ch)
if (!(ctrlr->flags & SOLVER_PRESENT))
lockdep_assert_irqs_disabled();
/*
* If the lock is busy it means another transaction is on going,
* in such case it's better to abort than spin.
*/
if (!spin_trylock(&ctrlr->cache_lock))
return -EBUSY;
spin_lock_irqsave(&ctrlr->cache_lock, flags);
ret = _rpmh_flush(ctrlr, ch);
spin_unlock(&ctrlr->cache_lock);
spin_unlock_irqrestore(&ctrlr->cache_lock, flags);
return ret;
}