aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-03-16 13:05:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-03-16 13:05:49 +0000
commitad457afeef7a522b995006affc84981c034466b6 (patch)
treebfe3b3988c2b69729b243a174bfb9b6dff72e220 /package/kernel
parentacff4b111fec56e70e0f30603094b80d10e8e3c5 (diff)
downloadupstream-ad457afeef7a522b995006affc84981c034466b6.tar.gz
upstream-ad457afeef7a522b995006affc84981c034466b6.tar.bz2
upstream-ad457afeef7a522b995006affc84981c034466b6.zip
ltq-adsl-mei: 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@44845 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel')
-rw-r--r--package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h
index c58732498a..1098b2b793 100644
--- a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h
+++ b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h
@@ -107,9 +107,31 @@ typedef enum {
#define MEI_INIT_WAKELIST(name,queue) \
init_waitqueue_head(&queue)
+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;
+}
+
/* wait for an event, timeout is measured in ms */
#define MEI_WAIT_EVENT_TIMEOUT(ev,timeout)\
- wait_event_interruptible_timeout(ev,0 == 1, timeout * HZ / 1000)
+ ugly_hack_sleep_on_timeout(&ev, timeout * HZ / 1000)
#define MEI_WAKEUP_EVENT(ev)\
wake_up_interruptible(&ev)
#endif /* IFX_MEI_BSP */