From: Mark Brown <broonie@kernel.org>
To: Jiada Wang <jiada_wang@mentor.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Mark Brown <broonie@kernel.org>,
lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
tiwai@suse.com, kuninori.morimoto.gx@renesas.com,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
alsa-devel@alsa-project.org
Subject: Applied "ASoC: rsnd: ssi: remove unnesessary period_pos" to the asoc tree
Date: Fri, 08 Dec 2017 18:55:01 +0000 [thread overview]
Message-ID: <E1eNNnZ-0004Al-0a@debutante> (raw)
In-Reply-To: <1512634956-17760-3-git-send-email-jiada_wang@mentor.com>
The patch
ASoC: rsnd: ssi: remove unnesessary period_pos
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
>From 2e2d53da81af6b2222c6b4e025a5d01b37b4449b Mon Sep 17 00:00:00 2001
From: Jiada Wang <jiada_wang@mentor.com>
Date: Thu, 7 Dec 2017 22:15:39 -0800
Subject: [PATCH] ASoC: rsnd: ssi: remove unnesessary period_pos
period_pos can always be calculated by byte_pos and
byte_per_period, there is no reason to maintain this
variable in rsnd_dai_stream.
This patch removes period_pos from rsnd_ssi and calculates
next_period_byte with consideration of actual byte_pos value.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/sh/rcar/ssi.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index cbf3bf312d23..f21202429000 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -80,7 +80,6 @@ struct rsnd_ssi {
unsigned int usrcnt;
int byte_pos;
- int period_pos;
int byte_per_period;
int next_period_byte;
};
@@ -421,7 +420,6 @@ static void rsnd_ssi_pointer_init(struct rsnd_mod *mod,
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
ssi->byte_pos = 0;
- ssi->period_pos = 0;
ssi->byte_per_period = runtime->period_size *
runtime->channels *
samples_to_bytes(runtime, 1);
@@ -453,13 +451,12 @@ static bool rsnd_ssi_pointer_update(struct rsnd_mod *mod,
if (byte_pos >= ssi->next_period_byte) {
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+ int period_pos = byte_pos / ssi->byte_per_period;
- ssi->period_pos++;
- ssi->next_period_byte += ssi->byte_per_period;
+ ssi->next_period_byte = (period_pos + 1) * ssi->byte_per_period;
- if (ssi->period_pos >= runtime->periods) {
+ if (period_pos >= runtime->periods) {
byte_pos = 0;
- ssi->period_pos = 0;
ssi->next_period_byte = ssi->byte_per_period;
}
--
2.15.1
prev parent reply other threads:[~2017-12-08 18:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 8:22 [PATCH v1 0/2] fix race condition in rsnd_ssi_pointer_update jiada_wang
2017-12-07 8:22 ` [PATCH v1 1/2] ASoC: rsnd: ssi: " jiada_wang
2017-12-07 9:45 ` Kuninori Morimoto
2017-12-08 5:35 ` Jiada Wang
2017-12-08 6:00 ` Kuninori Morimoto
2017-12-08 18:52 ` Applied "ASoC: rsnd: ssi: fix race condition in rsnd_ssi_pointer_update" to the asoc tree Mark Brown
2017-12-09 5:22 ` Takashi Sakamoto
2017-12-11 11:38 ` Mark Brown
2018-01-09 5:42 ` Jiada Wang
2018-01-09 6:53 ` Takashi Sakamoto
2018-01-09 8:59 ` Jiada Wang
2017-12-07 8:22 ` [PATCH v2 2/2] ASoC: rsnd: ssi: remove unnesessary period_pos jiada_wang
2017-12-07 9:58 ` Kuninori Morimoto
2017-12-08 5:43 ` Jiada Wang
2017-12-08 6:07 ` Kuninori Morimoto
2017-12-08 18:55 ` Mark Brown [this message]
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=E1eNNnZ-0004Al-0a@debutante \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=jiada_wang@mentor.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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