compat: Backport __wake_up_all_locked()
PATCH 1/1 compat: Backport __wake_up_all_locked()
This backports:
commit 63b2001169e75cd71e917ec953fdab572e3f944a
Author: Thomas Gleixner <[email protected]> Date: Thu Dec 1 00:04:00 2011 +0100
sched/wait: Add __wake_up_all_locked() API
$ git describe --contains 63b2001169e75cd71e917ec953fdab572e3f944a v3.4-rc1~3^2~24
This is used by the 3.6-rcX radeon DRM driver (radeon_sa.c) and will probably be used by other drivers in the near future.
__wake_up_all_locked() is a preprocessor macro around __wake_up_locked() which gained a 3rd parameter in 3.4.
That's why I backported the new __wake_up_locked() as compat_wake_up_locked() to avoid name conflicts.
This new function uses the internal __wake_up_common() function which needed a backport too. I backported it as compat_wake_up_common() as __wake_up_common() was made available in kernels between 2.6.28 <= x <= 2.6.30 through wait.h and dropped after 2.6.30. Renaming fixes build problems of compat for those kernels.
Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063512-generic [OK]
Trying kernel 2.6.34-02063410-generic [OK]
Trying kernel 2.6.33-02063305-generic [OK]
Trying kernel 2.6.32-02063255-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]
--- compat/compat-3.4.c | 29 +++++++++++++++++++++++++++++ include/linux/compat-3.4.h | 13 +++++++++++++ 2 files changed, 42 insertions(+)
compat/compat-3.4.c +29 -0
@@ -10,6 +10,35 @@#include <linux/fs.h> #include <linux/module.h> +#include <linux/wait.h> + +/* __wake_up_common was declared as part of the wait.h until +* 2.6.31 in which they made it private to the scheduler. Prefix it with +* compat to avoid double declaration issues. +*/ +static void compat_wake_up_common (wait_queue_head_t *q,unsigned int mode, +int nr_exclusive,int wake_flags,void *key) +{ +wait_queue_t *curr, *next; + +list_for_each_entry_safe (curr, next, &q->task_list, task_list) { +unsigned flags = curr->flags; + +if (curr->func (curr, mode, wake_flags, key) && + (flags &WQ_FLAG_EXCLUSIVE ) && !--nr_exclusive) +break ; + } +} + +/* The last 'nr' parameter was added to the __wake_up_locked() function +* in 3.4 kernel. Define a new one prefixed with compat_ for the new API. +*/ +void compat_wake_up_locked (wait_queue_head_t *q,unsigned int mode,int nr) +{ +compat_wake_up_common (q, mode, nr,0 ,NULL ); +} +EXPORT_SYMBOL_GPL (compat_wake_up_locked); +#if (LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,34 ))#include <linux/i2c.h>
include/linux/compat-3.4.h +13 -0
@@ -5,6 +5,19 @@#if (LINUX_VERSION_CODE <KERNEL_VERSION (3 ,4 ,0 )) + +/* This backports: +* +* commit 63b2001169e75cd71e917ec953fdab572e3f944a +* Author: Thomas Gleixner <[email protected]> +* Date: Thu Dec 1 00:04:00 2011 +0100 + +* sched/wait: Add __wake_up_all_locked() API +*/ +#include <linux/wait.h> +extern void compat_wake_up_locked (wait_queue_head_t *q,unsigned int mode,int nr); +#define wake_up_all_locked (x) compat_wake_up_locked((x), TASK_NORMAL, 0) +/* This backports: * * commit a8203725dfded5c1f79dca3368a4a273e24b59bb
Signature · 1 line
1.7.11.2
Quoted 50 lines · Ozan Çağlayan
This backports:
commit
63b2001169e75cd71e917ec953fdab572e3f944aAuthor: Thomas Gleixner <[email protected]> Date: Thu Dec 1 00:04:00 2011 +0100sched/wait: Add
__wake_up_all_locked()API$ git describe --contains 63b2001169e75cd71e917ec953fdab572e3f944a v3.4-rc1~3^2~24This is used by the 3.6-rcX radeon DRM driver (
radeon_sa.c) and will probably be used by other drivers in the near future.
__wake_up_all_locked()is a preprocessor macro around__wake_up_locked()which gained a 3rd parameter in 3.4.That's why I backported the new
__wake_up_locked()ascompat_wake_up_locked()to avoid name conflicts.This new function uses the internal
__wake_up_common()function which needed a backport too. I backported it ascompat_wake_up_common()as__wake_up_common()was made available in kernels between 2.6.28 <= x <= 2.6.30 throughwait.hand dropped after 2.6.30. Renaming fixes build problems of compat for those kernels.Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063512-generic [OK]
Trying kernel 2.6.34-02063410-generic [OK]
Trying kernel 2.6.33-02063305-generic [OK]
Trying kernel 2.6.32-02063255-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]
Quoted 1 line
Signed-off-by Ozan Çağlayan <[email protected]>
Applied and pushed, thanks!
Luis