[<prev] [next>] [day] [month] [year] [list]
Message-ID: <VE1PR04MB64794BEB41E8A3DB9C7AFB10E3660@VE1PR04MB6479.eurprd04.prod.outlook.com>
Date: Mon, 28 Oct 2019 07:47:51 +0000
From: "S.j. Wang" <shengjiu.wang@....com>
To: Nicolin Chen <nicoleotsuka@...il.com>
CC: "timur@...nel.org" <timur@...nel.org>,
"Xiubo.Lee@...il.com" <Xiubo.Lee@...il.com>,
"festevam@...il.com" <festevam@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2] ASoC: fsl_esai: Add spin lock to protect reset, stop
and start
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@....com>
>
> Some small comments inline. Once they are addressed, please add:
>
> Acked-by: Nicolin Chen <nicoleotsuka@...il.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
Powered by blists - more mailing lists