changed Makefile and profiles, added patches for kernel 2.6.24 (stable-branch of...
[openwrt/openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1234-sdio-use-interruptible-sleep-in-kthread-main-loops.patch
1 From 287b292cf95edbd82dc63085ae5f0167a6e8141f Mon Sep 17 00:00:00 2001
2 From: Jason Uhlenkott <jasonuhl@jasonuhl.org>
3 Date: Tue, 15 Jul 2008 11:37:45 +0100
4 Subject: [PATCH] sdio: use interruptible sleep in kthread main loops
5
6 My FreeRunner's load average was leveling off at 2.00 as a result of
7 these two kernel threads:
8
9 SDIO Helper D c02b4500 0 255 2
10 [<c02b4298>] (schedule+0x0/0x2d4) from [<c02b4040>] (__down+0x100/0x158)
11 [<c02b3f40>] (__down+0x0/0x158) from [<c02b3e2c>] (__down_failed+0xc/0x20)
12 r7:00000000 r6:c01fbd64 r5:c7cb7134 r4:c7d58000
13 [<c01fa6fc>] (CardDetectHelperFunction+0x0/0x1ac) from [<c01fbd80>] (HelperLaunch+0x1c/0x28)
14 r5:c7cb7134 r4:c7cb7134
15 [<c01fbd64>] (HelperLaunch+0x0/0x28) from [<c005bbd0>] (kthread+0x60/0x94)
16 r4:c7d58000
17 [<c005bb70>] (kthread+0x0/0x94) from [<c0048f7c>] (do_exit+0x0/0x744)
18 r6:00000000 r5:00000000 r4:00000000
19
20 SDIO Helper D c02b4500 0 259 2
21 [<c02b4298>] (schedule+0x0/0x2d4) from [<c02b4040>] (__down+0x100/0x158)
22 [<c02b3f40>] (__down+0x0/0x158) from [<c02b3e2c>] (__down_failed+0xc/0x20)
23 r7:c0382bb4 r6:c0382b34 r5:c7d5a000 r4:00000001
24 [<c01f9104>] (SDIOIrqHelperFunction+0x0/0x29c) from [<c01fbd80>] (HelperLaunch+0x1c/0x28)
25 r8:00000000 r7:00000000 r6:c01fbd64 r5:c0382bb4 r4:c0382bb4
26 [<c01fbd64>] (HelperLaunch+0x0/0x28) from [<c005bbd0>] (kthread+0x60/0x94)
27 r4:c7d5a000
28 [<c005bb70>] (kthread+0x0/0x94) from [<c0048f7c>] (do_exit+0x0/0x744)
29 r6:00000000 r5:00000000 r4:00000000
30
31 This fixes them to use interruptible sleep primitives while waiting in
32 their main loops, as is conventional for kernel threads. They can't
33 actually be interrupted since kernel threads ignore all signals, but
34 by sleeping this way they get classified as long term waiters, and
35 don't get counted as running for purposes of load average calculation.
36
37 This is intended as a minimal fix. In the longer term, it'd probably
38 make sense to replace the semaphores with completions or something,
39 and to do away with some of these StudlyCapped wrapper functions.
40
41 Signed-off-by: Jason Uhlenkott <jasonuhl@jasonuhl.org>
42 --
43
44 This is untested, but what could possibly go wrong? ;)
45 ---
46 include/linux/sdio/ctsystem_linux.h | 2 +-
47 1 files changed, 1 insertions(+), 1 deletions(-)
48
49 diff --git a/include/linux/sdio/ctsystem_linux.h b/include/linux/sdio/ctsystem_linux.h
50 index 0de89a6..c9e44f2 100644
51 --- a/include/linux/sdio/ctsystem_linux.h
52 +++ b/include/linux/sdio/ctsystem_linux.h
53 @@ -968,7 +968,7 @@ typedef struct _OSKERNEL_HELPER {
54 }
55
56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
57 -#define SD_WAIT_FOR_WAKEUP(p) SignalWait(&(p)->WakeSignal);
58 +#define SD_WAIT_FOR_WAKEUP(p) SignalWaitInterruptible(&(p)->WakeSignal);
59
60 #define CT_LE16_TO_CPU_ENDIAN(x) __le16_to_cpu(x)
61 #define CT_LE32_TO_CPU_ENDIAN(x) __le32_to_cpu(x)
62 --
63 1.5.6.5
64