[PATCH] audio-tickless-timeout.patch

Werner Almesberger werner at openmoko.org
Thu Apr 3 21:17:14 CEST 2008

When we resume, we can end up in
with the timer tick still disabled, and the LR signal never happening.
Thus, we loop forever.

The patch below changes the timeout mechanism to use udelay, which
doesn't need timer ticks.

Note that this code is in a module, so to get the fix, you have to
build the modules, and update them.

The kernel now resumes but does the ugly GSM modem ticking. I'll have
to find a good place to turn that one off ...

- Werner

---------------------------------- cut here -----------------------------------

- sound/soc/s3c24xx/s3c24xx-i2s.c (s3c24xx_snd_lrsync): in resume, we may
  call s3c24xx_snd_lrsync with timer ticks disabled, thus jiffies never
  change. Use udelay to avoid this problem.

Index: linux-2.6.24/sound/soc/s3c24xx/s3c24xx-i2s.c
--- linux-2.6.24.orig/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ linux-2.6.24/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -180,7 +180,7 @@
 static int s3c24xx_snd_lrsync(void)
 	u32 iiscon;
-	unsigned long timeout = jiffies + msecs_to_jiffies(5);
+	int timeout = 50; /* 5ms */
 	DBG("Entered %s\n", __FUNCTION__);
@@ -189,8 +189,9 @@
 		if (iiscon & S3C2410_IISCON_LRINDEX)
-		if (timeout < jiffies)
+		if (!--timeout)
 			return -ETIMEDOUT;
+		udelay(100);
 	return 0;

More information about the openmoko-kernel mailing list