From: Cheng-Yi Chiang <cychiang@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org, dianders@chromium.org,
Heiko Stuebner <heiko@sntech.de>,
zhengxing@rock-chips.com, Liam Girdwood <lgirdwood@gmail.com>,
jeffy.chen@rock-chips.com, Takashi Iwai <tiwai@suse.com>,
tzungbi@chromium.org, Jaroslav Kysela <perex@perex.cz>,
linux-rockchip@lists.infradead.org,
Mark Brown <broonie@kernel.org>,
eddie.cai@rock-chips.com, linux-arm-kernel@lists.infradead.org,
enric.balletbo@collabora.com, dgreid@chromium.org,
cain.cai@rock-chips.com, Cheng-Yi Chiang <cychiang@chromium.org>
Subject: [PATCH] ASoC: rockchip: rockchip_max98090: Set period size to 240
Date: Tue, 13 Aug 2019 15:44:30 +0800 [thread overview]
Message-ID: <20190813074430.191791-1-cychiang@chromium.org> (raw)
From stress testing of arecord, we found that period size
greater than ~900 will bring pl330 to DYING state and
can not recover within 100 iterations.
The result is that arecord will stuck and get I/O error,
and issue can not be recovered until reboot.
This issue does not happen when period size is small.
Set constraint of period size to 240 to prevent such issue.
With the constraint, there will be no issue after 2000 iterations.
We can revert this patch once the root cause is found
in rockchip's pl330 implementation.
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
---
sound/soc/rockchip/rockchip_max98090.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c
index 7b0c21fa6dca..0097df1fae66 100644
--- a/sound/soc/rockchip/rockchip_max98090.c
+++ b/sound/soc/rockchip/rockchip_max98090.c
@@ -137,8 +137,19 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream,
return ret;
}
+static int rk_aif1_startup(struct snd_pcm_substream *substream)
+{
+ /*
+ * Set period size to 240 because pl330 has issue
+ * dealing with larger period in stress testing.
+ */
+ return snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 240, 240);
+}
+
static const struct snd_soc_ops rk_aif1_ops = {
.hw_params = rk_aif1_hw_params,
+ .startup = rk_aif1_startup,
};
SND_SOC_DAILINK_DEFS(hifi,
--
2.23.0.rc1.153.gdeed80330f-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-08-13 7:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 7:44 Cheng-Yi Chiang [this message]
2019-08-15 17:14 ` Applied "ASoC: rockchip: rockchip_max98090: Set period size to 240" to the asoc tree Mark Brown
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=20190813074430.191791-1-cychiang@chromium.org \
--to=cychiang@chromium.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cain.cai@rock-chips.com \
--cc=dgreid@chromium.org \
--cc=dianders@chromium.org \
--cc=eddie.cai@rock-chips.com \
--cc=enric.balletbo@collabora.com \
--cc=heiko@sntech.de \
--cc=jeffy.chen@rock-chips.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=tzungbi@chromium.org \
--cc=zhengxing@rock-chips.com \
/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