* [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active
@ 2011-06-10 13:17 Jarkko Nikula
2011-06-10 13:50 ` Mark Brown
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jarkko Nikula @ 2011-06-10 13:17 UTC (permalink / raw)
To: alsa-devel; +Cc: Peter Ujfalusi, Mark Brown, Liam Girdwood, stable
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_sysclk
if the McBSP is already active. This test should have been here just from
the beginning anyway.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: stable@kernel.org
---
v2:
- Returns -EBUSY from omap_mcbsp_dai_set_dai_sysclk if the input clock rate
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 = &mcbsp_data->regs;
int err = 0;
+ if (mcbsp_data->active)
+ if (freq == mcbsp_data->in_freq)
+ return 0;
+ else
+ return -EBUSY;
+
/* The McBSP signal muxing functions are only available on McBSP1 */
if (clk_id == OMAP_MCBSP_CLKR_SRC_CLKR ||
clk_id == OMAP_MCBSP_CLKR_SRC_CLKX ||
--
1.7.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active
2011-06-10 13:17 [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active Jarkko Nikula
@ 2011-06-10 13:50 ` Mark Brown
2011-06-10 14:01 ` Péter Ujfalusi
2011-09-23 7:51 ` Péter Ujfalusi
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2011-06-10 13:50 UTC (permalink / raw)
To: Jarkko Nikula; +Cc: Peter Ujfalusi, alsa-devel, Liam Girdwood, stable
On Fri, Jun 10, 2011 at 04:17:25PM +0300, 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.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active
2011-06-10 13:17 [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active Jarkko Nikula
2011-06-10 13:50 ` Mark Brown
@ 2011-06-10 14:01 ` Péter Ujfalusi
2011-09-23 7:51 ` Péter Ujfalusi
2 siblings, 0 replies; 6+ messages in thread
From: Péter Ujfalusi @ 2011-06-10 14:01 UTC (permalink / raw)
To: Jarkko Nikula
Cc: alsa-devel@alsa-project.org, Mark Brown, Girdwood, Liam,
stable@kernel.org
> 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.
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active
2011-06-10 13:17 [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active Jarkko Nikula
2011-06-10 13:50 ` Mark Brown
2011-06-10 14:01 ` Péter Ujfalusi
@ 2011-09-23 7:51 ` Péter Ujfalusi
2011-09-23 7:58 ` Jarkko Nikula
2 siblings, 1 reply; 6+ messages in thread
From: Péter Ujfalusi @ 2011-09-23 7:51 UTC (permalink / raw)
To: Jarkko Nikula
Cc: alsa-devel@alsa-project.org, Mark Brown, Girdwood, Liam,
stable@kernel.org
Hi Mark, Liam,
Could you pick this patch?
For some reason it was missed, it is not present in upstream.
Thank you,
Péter
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_sysclk
> if the McBSP is already active. This test should have been here just from
> the beginning anyway.
>
> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
> Cc: stable@kernel.org
> ---
> v2:
> - Returns -EBUSY from omap_mcbsp_dai_set_dai_sysclk if the input clock rate
> 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 = &mcbsp_data->regs;
> int err = 0;
>
> + if (mcbsp_data->active)
> + if (freq == mcbsp_data->in_freq)
> + return 0;
> + else
> + return -EBUSY;
> +
> /* The McBSP signal muxing functions are only available on McBSP1 */
> if (clk_id == OMAP_MCBSP_CLKR_SRC_CLKR ||
> clk_id == OMAP_MCBSP_CLKR_SRC_CLKX ||
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active
2011-09-23 7:51 ` Péter Ujfalusi
@ 2011-09-23 7:58 ` Jarkko Nikula
2011-09-23 8:02 ` Péter Ujfalusi
0 siblings, 1 reply; 6+ messages in thread
From: Jarkko Nikula @ 2011-09-23 7:58 UTC (permalink / raw)
To: Péter Ujfalusi
Cc: alsa-devel@alsa-project.org, Mark Brown, Girdwood, Liam,
stable@kernel.org
On 09/23/2011 10:51 AM, Péter Ujfalusi wrote:
> Hi Mark, Liam,
>
> Could you pick this patch?
> For some reason it was missed, it is not present in upstream.
...
>> Signed-off-by: Jarkko Nikula<jhnikula@gmail.com>
Thanks Peter, that's true. I also have forgotten this one. I'll resend
this with my current address. IRCC this was acked by you Peter so I can
add it?
--
Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active
2011-09-23 7:58 ` Jarkko Nikula
@ 2011-09-23 8:02 ` Péter Ujfalusi
0 siblings, 0 replies; 6+ messages in thread
From: Péter Ujfalusi @ 2011-09-23 8:02 UTC (permalink / raw)
To: Jarkko Nikula
Cc: alsa-devel@alsa-project.org, Mark Brown, Girdwood, Liam,
stable@kernel.org
On Friday 23 September 2011 10:58:50 Jarkko Nikula wrote:
> Thanks Peter, that's true. I also have forgotten this one. I'll resend
> this with my current address. IRCC this was acked by you Peter so I can
> add it?
Yes, please add my ack.
--
Péter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-09-23 8:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 13:17 [PATCHv2] ASoC: omap-mcbsp: Do not attempt to change DAI sysclk if stream is active Jarkko Nikula
2011-06-10 13:50 ` Mark Brown
2011-06-10 14:01 ` Péter Ujfalusi
2011-09-23 7:51 ` Péter Ujfalusi
2011-09-23 7:58 ` Jarkko Nikula
2011-09-23 8:02 ` Péter Ujfalusi
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).