diff options
author | Werner Almesberger <werner@openmoko.org> | 2008-04-14 08:26:44 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-05-19 11:55:10 -0400 |
commit | 33e5b22285f63ede858c00456f3ffbc2ea79d6cf (patch) | |
tree | 67ec525d50071e56cbaffdef3a0ea7dfe0b2ef57 /sound/soc/s3c24xx/s3c24xx-i2s.c | |
parent | a65f0568f6cc8433877fb71dd7d36b551854b0bc (diff) |
[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: Werner Almesberger <werner@openmoko.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/s3c24xx/s3c24xx-i2s.c')
-rw-r--r-- | sound/soc/s3c24xx/s3c24xx-i2s.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c index ddf87246c77b..4c52f7946d9e 100644 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c | |||
@@ -175,7 +175,7 @@ static void s3c24xx_snd_rxctrl(int on) | |||
175 | static int s3c24xx_snd_lrsync(void) | 175 | static int s3c24xx_snd_lrsync(void) |
176 | { | 176 | { |
177 | u32 iiscon; | 177 | u32 iiscon; |
178 | unsigned long timeout = jiffies + msecs_to_jiffies(5); | 178 | int timeout = 50; /* 5ms */ |
179 | 179 | ||
180 | DBG("Entered %s\n", __func__); | 180 | DBG("Entered %s\n", __func__); |
181 | 181 | ||
@@ -184,8 +184,9 @@ static int s3c24xx_snd_lrsync(void) | |||
184 | if (iiscon & S3C2410_IISCON_LRINDEX) | 184 | if (iiscon & S3C2410_IISCON_LRINDEX) |
185 | break; | 185 | break; |
186 | 186 | ||
187 | if (time_after(jiffies, timeout)) | 187 | if (!timeout--) |
188 | return -ETIMEDOUT; | 188 | return -ETIMEDOUT; |
189 | udelay(100); | ||
189 | } | 190 | } |
190 | 191 | ||
191 | return 0; | 192 | return 0; |