2020-06-12 11:00:17

by Brent Lu

[permalink] [raw]
Subject: [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP

Port commit 6d011d5057ff ("ALSA: hda: Clear RIRB status before reading
WP") from legacy HDA driver to fix the get response timeout issue.
Current SOF driver does not suffer from this issue because sync write
is enabled in hda_init. The issue will come back if the sync write is
disabled for some reason.

Signed-off-by: Brent Lu <[email protected]>
---
sound/soc/sof/intel/hda-stream.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c
index 7f65dcc..1bda14c 100644
--- a/sound/soc/sof/intel/hda-stream.c
+++ b/sound/soc/sof/intel/hda-stream.c
@@ -653,11 +653,16 @@ irqreturn_t hda_dsp_stream_threaded_handler(int irq, void *context)
if (status & AZX_INT_CTRL_EN) {
rirb_status = snd_hdac_chip_readb(bus, RIRBSTS);
if (rirb_status & RIRB_INT_MASK) {
+ /*
+ * Clearing the interrupt status here ensures
+ * that no interrupt gets masked after the RIRB
+ * wp is read in snd_hdac_bus_update_rirb.
+ */
+ snd_hdac_chip_writeb(bus, RIRBSTS,
+ RIRB_INT_MASK);
active = true;
if (rirb_status & RIRB_INT_RESPONSE)
snd_hdac_bus_update_rirb(bus);
- snd_hdac_chip_writeb(bus, RIRBSTS,
- RIRB_INT_MASK);
}
}
#endif
--
2.7.4


2020-06-12 11:04:32

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP

On Fri, 12 Jun 2020 12:50:48 +0200,
Brent Lu wrote:
>
> Port commit 6d011d5057ff ("ALSA: hda: Clear RIRB status before reading
> WP") from legacy HDA driver to fix the get response timeout issue.
> Current SOF driver does not suffer from this issue because sync write
> is enabled in hda_init. The issue will come back if the sync write is
> disabled for some reason.
>
> Signed-off-by: Brent Lu <[email protected]>

Reviewed-by: Takashi Iwai <[email protected]>


Thanks!

Takashi

2020-06-12 12:27:03

by Kai Vehmanen

[permalink] [raw]
Subject: Re: [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP

Hey Brent,

On Fri, 12 Jun 2020, Takashi Iwai wrote:

> On Fri, 12 Jun 2020 12:50:48 +0200, Brent Lu wrote:
> >
> > Port commit 6d011d5057ff ("ALSA: hda: Clear RIRB status before reading
> > WP") from legacy HDA driver to fix the get response timeout issue.
> > Current SOF driver does not suffer from this issue because sync write
> > is enabled in hda_init. The issue will come back if the sync write is
> > disabled for some reason.
> >
> > Signed-off-by: Brent Lu <[email protected]>
>
> Reviewed-by: Takashi Iwai <[email protected]>

thanks, looks good now:

Reviewed-by: Kai Vehmanen <[email protected]>

2020-06-12 15:14:28

by Pierre-Louis Bossart

[permalink] [raw]
Subject: Re: [Sound-open-firmware] [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP



On 6/12/20 7:24 AM, Kai Vehmanen wrote:
> Hey Brent,
>
> On Fri, 12 Jun 2020, Takashi Iwai wrote:
>
>> On Fri, 12 Jun 2020 12:50:48 +0200, Brent Lu wrote:
>>>
>>> Port commit 6d011d5057ff ("ALSA: hda: Clear RIRB status before reading
>>> WP") from legacy HDA driver to fix the get response timeout issue.
>>> Current SOF driver does not suffer from this issue because sync write
>>> is enabled in hda_init. The issue will come back if the sync write is
>>> disabled for some reason.
>>>
>>> Signed-off-by: Brent Lu <[email protected]>
>>
>> Reviewed-by: Takashi Iwai <[email protected]>
>
> thanks, looks good now:
>
> Reviewed-by: Kai Vehmanen <[email protected]>

CI results initiated by Kai don't show any regression and change looks
good so:

Reviewed-by: Pierre-Louis Bossart <[email protected]>

Thanks Brent!

2020-06-15 15:08:16

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP

On Fri, 12 Jun 2020 18:50:48 +0800, Brent Lu wrote:
> Port commit 6d011d5057ff ("ALSA: hda: Clear RIRB status before reading
> WP") from legacy HDA driver to fix the get response timeout issue.
> Current SOF driver does not suffer from this issue because sync write
> is enabled in hda_init. The issue will come back if the sync write is
> disabled for some reason.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP
commit: 40e2c465894e5b79b49f55d9574dbcda4ac0f08f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark