Commit 33e5b222 authored by Werner Almesberger's avatar Werner Almesberger Committed by Jaroslav Kysela

[ALSA] soc - Fix s3c24xx-i2s LR sync while timer ticks are disabled

When timer ticks are disabled when calling
sound/soc/s3c24xx/s3c24xx-i2s.c:s3c24xx_snd_lrsync
and the LR signal never happens, we loop forever.
This has been observed in the following call chain:
snd_pcm_common_ioctl1 -> snd_pcm_action_lock_irq ->
snd_pcm_action_single
 -> snd_pcm_do_resume -> soc_pcm_trigger -> s3c24xx_i2s_trigger

The patch below changes the timeout mechanism to use udelay, which
doesn't need timer ticks.
Signed-off-by: default avatarWerner Almesberger <werner@openmoko.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent a65f0568
...@@ -175,7 +175,7 @@ static void s3c24xx_snd_rxctrl(int on) ...@@ -175,7 +175,7 @@ static void s3c24xx_snd_rxctrl(int on)
static int s3c24xx_snd_lrsync(void) static int s3c24xx_snd_lrsync(void)
{ {
u32 iiscon; u32 iiscon;
unsigned long timeout = jiffies + msecs_to_jiffies(5); int timeout = 50; /* 5ms */
DBG("Entered %s\n", __func__); DBG("Entered %s\n", __func__);
...@@ -184,8 +184,9 @@ static int s3c24xx_snd_lrsync(void) ...@@ -184,8 +184,9 @@ static int s3c24xx_snd_lrsync(void)
if (iiscon & S3C2410_IISCON_LRINDEX) if (iiscon & S3C2410_IISCON_LRINDEX)
break; break;
if (time_after(jiffies, timeout)) if (!timeout--)
return -ETIMEDOUT; return -ETIMEDOUT;
udelay(100);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment