From: "S.j. Wang" <shengjiu.wang@nxp.com>
To: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"timur@kernel.org" <timur@kernel.org>,
"Xiubo.Lee@gmail.com" <Xiubo.Lee@gmail.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"tiwai@suse.com" <tiwai@suse.com>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"perex@perex.cz" <perex@perex.cz>,
"broonie@kernel.org" <broonie@kernel.org>,
"festevam@gmail.com" <festevam@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] ASoC: fsl_esai: Add spin lock to protect reset, stop and start
Date: Mon, 28 Oct 2019 07:47:51 +0000 [thread overview]
Message-ID: <VE1PR04MB64794BEB41E8A3DB9C7AFB10E3660@VE1PR04MB6479.eurprd04.prod.outlook.com> (raw)
Hi
>
> On Fri, Oct 25, 2019 at 03:13:53PM +0800, Shengjiu Wang wrote:
> > xrun may happen at the end of stream, the
> > trigger->fsl_esai_trigger_stop maybe called in the middle of
> > fsl_esai_hw_reset, this may cause esai in wrong state after stop, and
> > there may be endless xrun interrupt.
> >
> > This issue may also happen with trigger->fsl_esai_trigger_start.
> >
> > So Add spin lock to lock those functions.
> >
> > Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after
> > xrun")
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
>
> Some small comments inline. Once they are addressed, please add:
>
> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
>
> Thanks
>
> > ---
> > Change in v2
> > -add lock for fsl_esai_trigger_start.
> >
> > sound/soc/fsl/fsl_esai.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index
> > 37b14c48b537..9b28e2af26e4 100644
> > --- a/sound/soc/fsl/fsl_esai.c
> > +++ b/sound/soc/fsl/fsl_esai.c
> > @@ -33,6 +33,7 @@
> > * @fsysclk: system clock source to derive HCK, SCK and FS
> > * @spbaclk: SPBA clock (optional, depending on SoC design)
> > * @task: tasklet to handle the reset operation
> > + * @lock: spin lock to handle reset and stop behavior
>
> Should be "between hw_reset() and trigger()" now.
>
> > * @fifo_depth: depth of tx/rx FIFO
> > * @slot_width: width of each DAI slot
> > * @slots: number of slots
> > @@ -56,6 +57,7 @@ struct fsl_esai {
> > struct clk *fsysclk;
> > struct clk *spbaclk;
> > struct tasklet_struct task;
> > + spinlock_t lock; /* Protect reset and stop */
>
> We can drop the comments here since you add it to the top.
Here is required by the checkpatch.pl, so still is needed.
Best regards
Wang shengjiu
next reply other threads:[~2019-10-28 7:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 7:47 S.j. Wang [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-10-25 7:13 [PATCH V2] ASoC: fsl_esai: Add spin lock to protect reset, stop and start Shengjiu Wang
2019-10-25 21:10 ` Nicolin Chen
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=VE1PR04MB64794BEB41E8A3DB9C7AFB10E3660@VE1PR04MB6479.eurprd04.prod.outlook.com \
--to=shengjiu.wang@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=timur@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).