dsp: codecs: Add spin_lock_irqsave instead of spin_lock

spin_lock is acquired in process context and trying do the
operation in process context,while the interrupt came and
the same lock is trying to take in interrupt context which
leads to deadlock.To avoid this we are using spin_lock_irqsave
instead of spin_lock.

Change-Id: I9c4a3ac65d92b0612d7c4845212647c51a72065b
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
This commit is contained in:
Prasad Kumpatla
2020-05-04 13:07:09 +05:30
committed by Gerrit - the friendly Code Review server
parent e7efdae360
commit b29145e957
4 changed files with 12 additions and 8 deletions

View File

@@ -936,6 +936,7 @@ ssize_t audio_in_write(struct file *file,
int audio_in_release(struct inode *inode, struct file *file)
{
unsigned long flags = 0;
struct q6audio_in *audio = file->private_data;
pr_info("%s: session id %d\n", __func__, audio->ac->session);
@@ -943,11 +944,11 @@ int audio_in_release(struct inode *inode, struct file *file)
audio_in_disable(audio);
q6asm_audio_client_free(audio->ac);
mutex_unlock(&audio->lock);
spin_lock(&enc_dec_lock);
spin_lock_irqsave(&enc_dec_lock, flags);
kfree(audio->enc_cfg);
kfree(audio->codec_cfg);
kfree(audio);
file->private_data = NULL;
spin_unlock(&enc_dec_lock);
spin_unlock_irqrestore(&enc_dec_lock, flags);
return 0;
}