Commit af1086ba authored by Liam Girdwood's avatar Liam Girdwood Committed by Mark Brown

ASoC: Intel: sst: fix the IRQ locked issue

If driver received a message that it can't handle, it won't
clear the corresponding bit and unmask interrupt, this may
lock the IRQ and DSP can't send message anymore.

To fix the issue, we should Always update IMRX after IPC.

Here we always clear the DONE/BUSY bit and unmask the IRQ
source, even when IPC failures have occurred previously.
Signed-off-by: default avatarLiam Girdwood <liam.r.girdwood@linux.intel.com>
Modified-by: default avatarJie Yang <yang.jie@intel.com>
Signed-off-by: default avatarJie Yang <yang.jie@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ad83abe9
...@@ -778,7 +778,6 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) ...@@ -778,7 +778,6 @@ static irqreturn_t hsw_irq_thread(int irq, void *context)
struct sst_hsw *hsw = sst_dsp_get_thread_context(sst); struct sst_hsw *hsw = sst_dsp_get_thread_context(sst);
struct sst_generic_ipc *ipc = &hsw->ipc; struct sst_generic_ipc *ipc = &hsw->ipc;
u32 ipcx, ipcd; u32 ipcx, ipcd;
int handled;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sst->spinlock, flags); spin_lock_irqsave(&sst->spinlock, flags);
...@@ -790,9 +789,8 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) ...@@ -790,9 +789,8 @@ static irqreturn_t hsw_irq_thread(int irq, void *context)
if (ipcx & SST_IPCX_DONE) { if (ipcx & SST_IPCX_DONE) {
/* Handle Immediate reply from DSP Core */ /* Handle Immediate reply from DSP Core */
handled = hsw_process_reply(hsw, ipcx); hsw_process_reply(hsw, ipcx);
if (handled > 0) {
/* clear DONE bit - tell DSP we have completed */ /* clear DONE bit - tell DSP we have completed */
sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX, sst_dsp_shim_update_bits_unlocked(sst, SST_IPCX,
SST_IPCX_DONE, 0); SST_IPCX_DONE, 0);
...@@ -801,16 +799,14 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) ...@@ -801,16 +799,14 @@ static irqreturn_t hsw_irq_thread(int irq, void *context)
sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX, sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX,
SST_IMRX_DONE, 0); SST_IMRX_DONE, 0);
} }
}
/* new message from DSP */ /* new message from DSP */
if (ipcd & SST_IPCD_BUSY) { if (ipcd & SST_IPCD_BUSY) {
/* Handle Notification and Delayed reply from DSP Core */ /* Handle Notification and Delayed reply from DSP Core */
handled = hsw_process_notification(hsw); hsw_process_notification(hsw);
/* clear BUSY bit and set DONE bit - accept new messages */ /* clear BUSY bit and set DONE bit - accept new messages */
if (handled > 0) {
sst_dsp_shim_update_bits_unlocked(sst, SST_IPCD, sst_dsp_shim_update_bits_unlocked(sst, SST_IPCD,
SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE); SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);
...@@ -818,7 +814,6 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) ...@@ -818,7 +814,6 @@ static irqreturn_t hsw_irq_thread(int irq, void *context)
sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX, sst_dsp_shim_update_bits_unlocked(sst, SST_IMRX,
SST_IMRX_BUSY, 0); SST_IMRX_BUSY, 0);
} }
}
spin_unlock_irqrestore(&sst->spinlock, flags); spin_unlock_irqrestore(&sst->spinlock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment