]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ASoC: SOF: Intel: cnl-ipc: read all IPC registers first
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 3 Jun 2019 16:20:26 +0000 (11:20 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 3 Jun 2019 16:48:02 +0000 (17:48 +0100)
Align with hardware recommended sequences, and read all IPC registers
before doing any other actions. Playing with BUSY and DONE bits may
invalidate values.

The values read may not actually be necessary but at least this
provides a snapshot of the IPC registers with no consistency issues.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/cnl.c

index fd86269b503760aa989e1d994f699d8fc3ae249f..1fae75fc313f97b67f874a894d6250b3cb045bfe 100644 (file)
@@ -42,6 +42,8 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)
        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);
        hipctdr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCTDR);
+       hipctdd = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCTDD);
+       hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR);
 
        /* reenable IPC interrupt */
        snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIC,
@@ -50,8 +52,6 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)
        /* reply message from DSP */
        if (hipcida & CNL_DSP_REG_HIPCIDA_DONE &&
            hipcctl & CNL_DSP_REG_HIPCCTL_DONE) {
-               hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR,
-                                        CNL_DSP_REG_HIPCIDR);
                msg_ext = hipci & CNL_DSP_REG_HIPCIDR_MSG_MASK;
                msg = hipcida & CNL_DSP_REG_HIPCIDA_MSG_MASK;
 
@@ -84,8 +84,6 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)
 
        /* new message from DSP */
        if (hipctdr & CNL_DSP_REG_HIPCTDR_BUSY) {
-               hipctdd = snd_sof_dsp_read(sdev, HDA_DSP_BAR,
-                                          CNL_DSP_REG_HIPCTDD);
                msg = hipctdr & CNL_DSP_REG_HIPCTDR_MSG_MASK;
                msg_ext = hipctdd & CNL_DSP_REG_HIPCTDD_MSG_MASK;