Merge "soc: qcom: rpmh: Do not use spin_trylock()"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
39307ce93d
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user