mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP
@ 2020-06-12 10:50 Brent Lu
  2020-06-12 11:01 ` Takashi Iwai
  2020-06-15 15:05 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Brent Lu @ 2020-06-12 10:50 UTC (permalink / raw)
  To: alsa-devel
  Cc: Pierre-Louis Bossart, Liam Girdwood, Ranjani Sridharan,
	Kai Vehmanen, Daniel Baluta, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Cezary Rojewski, Zhu Yingjiang, Keyon Jie,
	Brent Lu, Bard Liao, sound-open-firmware, linux-kernel

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 <brent.lu@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-15 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 10:50 [PATCH v3] ASoC: SOF: Intel: hda: Clear RIRB status before reading WP Brent Lu
2020-06-12 11:01 ` Takashi Iwai
2020-06-12 12:24   ` Kai Vehmanen
2020-06-12 14:45     ` [Sound-open-firmware] " Pierre-Louis Bossart
2020-06-15 15:05 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome