Merge "dsp-kernel: Handle race-condition in dsp signal"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
e797e0d37f
@@ -7050,6 +7050,11 @@ int fastrpc_dspsignal_wait(struct fastrpc_file *fl,
|
|||||||
if (s->state != DSPSIGNAL_STATE_PENDING) {
|
if (s->state != DSPSIGNAL_STATE_PENDING) {
|
||||||
if ((s->state == DSPSIGNAL_STATE_CANCELED) || (s->state == DSPSIGNAL_STATE_UNUSED))
|
if ((s->state == DSPSIGNAL_STATE_CANCELED) || (s->state == DSPSIGNAL_STATE_UNUSED))
|
||||||
err = -EINTR;
|
err = -EINTR;
|
||||||
|
if (s->state == DSPSIGNAL_STATE_SIGNALED) {
|
||||||
|
/* Signal already received from DSP. Reset signal state and return */
|
||||||
|
s->state = DSPSIGNAL_STATE_PENDING;
|
||||||
|
reinit_completion(&s->comp);
|
||||||
|
}
|
||||||
spin_unlock_irqrestore(&fl->dspsignals_lock, irq_flags);
|
spin_unlock_irqrestore(&fl->dspsignals_lock, irq_flags);
|
||||||
DSPSIGNAL_VERBOSE("Signal %u in state %u, complete wait immediately",
|
DSPSIGNAL_VERBOSE("Signal %u in state %u, complete wait immediately",
|
||||||
signal_id, s->state);
|
signal_id, s->state);
|
||||||
|
Reference in New Issue
Block a user