From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?P=E9ter?= Ujfalusi Subject: Re: [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active Date: Fri, 23 Sep 2011 10:51:46 +0300 Message-ID: <2702783.vtvFLcHCRj@barack> References: <1307711845-1636-1-git-send-email-jhnikula@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from na3sys009aog108.obsmtp.com (na3sys009aog108.obsmtp.com [74.125.149.199]) by alsa0.perex.cz (Postfix) with ESMTP id 430CB2417D for ; Fri, 23 Sep 2011 09:51:58 +0200 (CEST) Received: by mail-bw0-f48.google.com with SMTP id zu5so4930278bkb.21 for ; Fri, 23 Sep 2011 00:51:47 -0700 (PDT) In-Reply-To: <1307711845-1636-1-git-send-email-jhnikula@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Jarkko Nikula Cc: "alsa-devel@alsa-project.org" , Mark Brown , "Girdwood, Liam" , "stable@kernel.org" List-Id: alsa-devel@alsa-project.org Hi Mark, Liam, Could you pick this patch? For some reason it was missed, it is not present in upstream. Thank you, P=E9ter On Friday 10 June 2011 15:17:25 Jarkko Nikula wrote: > Attempt to change McBSP CLKS source while another stream is active is not > safe after commit d135865 ("OMAP: McBSP: implement functional clock > switching via clock framework") in 2.6.37. > = > CLKS parent clock switching using clock framework have to idle the McBSP > before switching and then activate it again. This short break can cause a > DMA transaction error to already running stream which halts and recovers > only by closing and restarting the stream. > = > This goes more fatal after commit e2fa61d ("OMAP3: l3: Introduce > l3-interconnect error handling driver") in 2.6.39 where l3 driver detects= a > severe timeout error and does BUG_ON(). > = > Fix this by not changing any configuration in omap_mcbsp_dai_set_dai_sysc= lk > if the McBSP is already active. This test should have been here just from > the beginning anyway. > = > Signed-off-by: Jarkko Nikula > Cc: stable@kernel.org > --- > v2: > - Returns -EBUSY from omap_mcbsp_dai_set_dai_sysclk if the input clock ra= te > doesn't match with another stream's configuration and 0 otherwise. > = > For 2.6.37 and onward. > = > This issue is valid to those machine drivers that use the McBSP as a DAI > link master and are configuring the CLKS source (like > sound/soc/omap/omap3pandora.c in mainline). > --- > sound/soc/omap/omap-mcbsp.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > = > diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c > index 07b7723..4b82290 100644 > --- a/sound/soc/omap/omap-mcbsp.c > +++ b/sound/soc/omap/omap-mcbsp.c > @@ -516,6 +516,12 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct > snd_soc_dai *cpu_dai, struct omap_mcbsp_reg_cfg *regs =3D &mcbsp_data->re= gs; > int err =3D 0; > = > + if (mcbsp_data->active) > + if (freq =3D=3D mcbsp_data->in_freq) > + return 0; > + else > + return -EBUSY; > + > /* The McBSP signal muxing functions are only available on McBSP1 */ > if (clk_id =3D=3D OMAP_MCBSP_CLKR_SRC_CLKR || > clk_id =3D=3D OMAP_MCBSP_CLKR_SRC_CLKX ||