diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-03-16 13:05:42 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-03-16 13:05:42 +0000 |
commit | acff4b111fec56e70e0f30603094b80d10e8e3c5 (patch) | |
tree | e3f41ecbd28682f8afd0da3d373d69e501cf90c1 /package/kernel/lantiq/ltq-adsl/patches | |
parent | d951b2beb11b3c74babeea15b628d583e10e6fff (diff) | |
download | master-187ad058-acff4b111fec56e70e0f30603094b80d10e8e3c5.tar.gz master-187ad058-acff4b111fec56e70e0f30603094b80d10e8e3c5.tar.bz2 master-187ad058-acff4b111fec56e70e0f30603094b80d10e8e3c5.zip |
ltq-adsl: fix bugs in linux 3.18 compatiblity change
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44844 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/lantiq/ltq-adsl/patches')
-rw-r--r-- | package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch b/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch index a0a9acdb73..80f085492c 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/140-linux_3.18.patch @@ -1,13 +1,40 @@ -Index: drv_dsl_cpe_api-3.24.4.4/src/include/drv_dsl_cpe_os_linux.h -=================================================================== ---- drv_dsl_cpe_api-3.24.4.4.orig/src/include/drv_dsl_cpe_os_linux.h 2015-02-08 09:59:02.424259834 +0100 -+++ drv_dsl_cpe_api-3.24.4.4/src/include/drv_dsl_cpe_os_linux.h 2015-02-08 10:02:19.580740173 +0100 -@@ -218,7 +218,7 @@ +--- a/src/include/drv_dsl_cpe_os_linux.h ++++ b/src/include/drv_dsl_cpe_os_linux.h +@@ -214,12 +214,35 @@ static inline int dsl_mutex_lock(struct + #define DSL_DRV_MUTEX_LOCK(id) down_interruptible(&(id)) + #define DSL_DRV_MUTEX_UNLOCK(id) up(&(id)) + #endif ++ ++static inline long ++ugly_hack_sleep_on_timeout(wait_queue_head_t *q, long timeout) ++{ ++ unsigned long flags; ++ wait_queue_t wait; ++ ++ init_waitqueue_entry(&wait, current); ++ ++ __set_current_state(TASK_INTERRUPTIBLE); ++ spin_lock_irqsave(&q->lock, flags); ++ __add_wait_queue(q, &wait); ++ spin_unlock(&q->lock); ++ ++ timeout = schedule_timeout(timeout); ++ ++ spin_lock_irq(&q->lock); ++ __remove_wait_queue(q, &wait); ++ spin_unlock_irqrestore(&q->lock, flags); ++ ++ return timeout; ++} ++ + #define DSL_DRV_INIT_WAKELIST(name,queue) init_waitqueue_head(&(queue)) #define DSL_DRV_WAKEUP_WAKELIST(queue) wake_up_interruptible(&(queue)) #define DSL_DRV_INIT_EVENT(name,ev) init_waitqueue_head(&(ev)) /* wait for an event, timeout is measured in ms */ -#define DSL_DRV_WAIT_EVENT_TIMEOUT(ev,t) interruptible_sleep_on_timeout(&(ev), (t) * HZ / 1000) -+#define DSL_DRV_WAIT_EVENT_TIMEOUT(ev,t) wait_event_interruptible_timeout((ev), 0 == 1, (t) * HZ / 1000) - #define DSL_DRV_WAIT_EVENT(ev) interruptible_sleep_on(&(ev)) +-#define DSL_DRV_WAIT_EVENT(ev) interruptible_sleep_on(&(ev)) ++#define DSL_DRV_WAIT_EVENT_TIMEOUT(ev,t) ugly_hack_sleep_on_timeout(&(ev), (t) * HZ / 1000) ++#define DSL_DRV_WAIT_EVENT(ev) ugly_hack_sleep_on_timeout(&(ev), MAX_SCHEDULE_TIMEOUT) #define DSL_DRV_WAKEUP_EVENT(ev) wake_up_interruptible(&(ev)) #define DSL_DRV_TimeMSecGet() DSL_DRV_ElapsedTimeMSecGet(0) + #define DSL_WAIT(ms) msleep(ms) |