aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/s3c24xx/patches-2.6.24/1117-audio-tickless-timeout.patch.patch
blob: 1c74f1bfed5ea0d36a45c3d8f334ea35075960c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 5d6f04132cb5bd8fa8f1c9c9c3dc337aeae18f4c Mon Sep 17 00:00:00 2001
From: Werner Almesberger <werner@openmoko.org>
Date: Sun, 13 Apr 2008 07:25:55 +0100
Subject: [PATCH] audio-tickless-timeout.patch

When we resume, we can end up in
sound/soc/s3c24xx/s3c24xx-i2s.c:s3c24xx_snd_lrsync
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.
---
 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 4d74cc0..43fd25a 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -180,7 +180,7 @@ static void s3c24xx_snd_rxctrl(int on)
 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 @@ static int s3c24xx_snd_lrsync(void)
 		if (iiscon & S3C2410_IISCON_LRINDEX)
 			break;
 
-		if (timeout < jiffies)
+		if (!--timeout)
 			return -ETIMEDOUT;
+		udelay(100);
 	}
 
 	return 0;
-- 
1.5.6.5