Commit 6d60a39e authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown

ASoC: SOF: Intel: hda-ipc: simplify handling of IPC IRQ

When using a shared IRQ between IPC interrupt and stream IOC interrupt,
the interrupt handlers need to check the interrupt source before
scheduling their respective IRQ threads. In the case of IPC handler, it
should check if it is an IPC interrupt before waking up the IPC IRQ
thread.

The IPC IRQ thread, once scheduled, does not need to check the IRQ
source again. So, remove the superfluous check in the thread. Remove the
irq_status field from snd_sof_dev struct also as it is no longer needed.
Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ff758e9f
...@@ -39,10 +39,6 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context) ...@@ -39,10 +39,6 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)
u32 msg_ext; u32 msg_ext;
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_NONE;
/* here we handle IPC interrupts only */
if (!(sdev->irq_status & HDA_DSP_ADSPIS_IPC))
return ret;
hipcida = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDA); hipcida = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDA);
hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCCTL); hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCCTL);
hipctdr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCTDR); hipctdr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCTDR);
......
...@@ -145,10 +145,6 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context) ...@@ -145,10 +145,6 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context)
u32 msg; u32 msg;
u32 msg_ext; u32 msg_ext;
/* here we handle IPC interrupts only */
if (!(sdev->irq_status & HDA_DSP_ADSPIS_IPC))
return IRQ_NONE;
/* read IPC status */ /* read IPC status */
hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR,
HDA_DSP_REG_HIPCIE); HDA_DSP_REG_HIPCIE);
...@@ -234,19 +230,20 @@ irqreturn_t hda_dsp_ipc_irq_handler(int irq, void *context) ...@@ -234,19 +230,20 @@ irqreturn_t hda_dsp_ipc_irq_handler(int irq, void *context)
{ {
struct snd_sof_dev *sdev = context; struct snd_sof_dev *sdev = context;
int ret = IRQ_NONE; int ret = IRQ_NONE;
u32 irq_status;
spin_lock(&sdev->hw_lock); spin_lock(&sdev->hw_lock);
/* store status */ /* store status */
sdev->irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS);
HDA_DSP_REG_ADSPIS); dev_vdbg(sdev->dev, "irq handler: irq_status:0x%x\n", irq_status);
/* invalid message ? */ /* invalid message ? */
if (sdev->irq_status == 0xffffffff) if (irq_status == 0xffffffff)
goto out; goto out;
/* IPC message ? */ /* IPC message ? */
if (sdev->irq_status & HDA_DSP_ADSPIS_IPC) { if (irq_status & HDA_DSP_ADSPIS_IPC) {
/* disable IPC interrupt */ /* disable IPC interrupt */
snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR,
HDA_DSP_REG_ADSPIC, HDA_DSP_REG_ADSPIC,
......
...@@ -366,7 +366,6 @@ struct snd_sof_dev { ...@@ -366,7 +366,6 @@ struct snd_sof_dev {
struct snd_sof_mailbox host_box; /* Host initiated IPC */ struct snd_sof_mailbox host_box; /* Host initiated IPC */
struct snd_sof_mailbox stream_box; /* Stream position update */ struct snd_sof_mailbox stream_box; /* Stream position update */
struct snd_sof_ipc_msg *msg; struct snd_sof_ipc_msg *msg;
u64 irq_status;
int ipc_irq; int ipc_irq;
u32 next_comp_id; /* monotonic - reset during S3 */ u32 next_comp_id; /* monotonic - reset during S3 */
......
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