mirror of https://github.com/thesofproject/sof.git
dmic: change spin_lock to spin_try_lock in dmic_work()
In order to avoid dead locks in dmic_work I've replaced spin_lock() with spin_try_lock(). In case when spin_try_lock() fails we reschedule dmic work. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit is contained in:
parent
b03e15a765
commit
6a0cf6740f
|
@ -159,9 +159,16 @@ static enum task_state dmic_work(void *data)
|
|||
int32_t gval;
|
||||
uint32_t val;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
tracev_dmic("dmic_work()");
|
||||
spin_lock(dai->lock);
|
||||
|
||||
spin_try_lock(dai->lock, ret);
|
||||
if (!ret) {
|
||||
tracev_dmic("dmic_work(): spin_try_lock(dai->lock, ret)"
|
||||
"failed: RESCHEDULE");
|
||||
return SOF_TASK_STATE_RESCHEDULE;
|
||||
}
|
||||
|
||||
/* Increment gain with logarithmic step.
|
||||
* Gain is Q2.30 and gain modifier is Q12.20.
|
||||
|
|
Loading…
Reference in New Issue