From: Sriram Periyasamy <sriramx.periyasamy@intel.com>
To: ALSA ML <alsa-devel@alsa-project.org>, Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Sriram Periyasamy <sriramx.periyasamy@intel.com>,
Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>,
Patches Audio <patches.audio@intel.com>
Subject: [PATCH 2/4] ALSA: hda: Make sure DMA is started by reading back the RUN bit
Date: Tue, 15 May 2018 12:10:54 +0530 [thread overview]
Message-ID: <1526366456-20470-3-git-send-email-sriramx.periyasamy@intel.com> (raw)
In-Reply-To: <1526366456-20470-1-git-send-email-sriramx.periyasamy@intel.com>
From: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
As per HW recommendation, after setting the RUN bit,
software must read a 1 from the RUN bit, before modifying
related control registers/re-starting the DMA engine.
Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
---
sound/hda/hdac_stream.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 2000ea6f48fa..33c8ced528f6 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -48,6 +48,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_init);
void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
{
struct hdac_bus *bus = azx_dev->bus;
+ int timeout = 300;
+ unsigned char val;
trace_snd_hdac_stream_start(bus, azx_dev);
@@ -60,6 +62,20 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
/* set DMA start and interrupt mask */
snd_hdac_stream_updateb(azx_dev, SD_CTL,
0, SD_CTL_DMA_START | SD_INT_MASK);
+
+ do {
+ udelay(3);
+ val = snd_hdac_stream_readb(azx_dev, SD_CTL) & SD_CTL_DMA_START;
+ if (val)
+ break;
+ } while (--timeout);
+
+ if (!timeout) {
+ azx_dev->running = false;
+ dev_err(azx_dev->bus->dev, "unable to start the stream\n");
+ return;
+ }
+
azx_dev->running = true;
}
EXPORT_SYMBOL_GPL(snd_hdac_stream_start);
--
2.7.4
next prev parent reply other threads:[~2018-05-15 6:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-15 6:40 [PATCH 0/4] ALSA: hda: Bug fixes Sriram Periyasamy
2018-05-15 6:40 ` [PATCH 1/4] ALSA: hda: Make sure DMA is stopped by reading back the RUN bit Sriram Periyasamy
2018-05-15 7:34 ` Takashi Iwai
2018-05-15 6:40 ` Sriram Periyasamy [this message]
2018-05-15 7:36 ` [PATCH 2/4] ALSA: hda: Make sure DMA is started " Takashi Iwai
2018-05-15 6:40 ` [PATCH 3/4] ALSA: hda: Log HDA Hardware related errors Sriram Periyasamy
2018-05-15 7:43 ` Takashi Iwai
2018-05-15 6:40 ` [PATCH 4/4] ALSA: hda: check if stream is stopped in snd_hdac_stream_clear Sriram Periyasamy
2018-05-15 7:41 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1526366456-20470-3-git-send-email-sriramx.periyasamy@intel.com \
--to=sriramx.periyasamy@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=pardha.saradhi.kesapragada@intel.com \
--cc=patches.audio@intel.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).