2012-01-21 13:44:44

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH] compat: add __cancel_delayed_work()

__cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
not available in old kernel versions. This was just copied from the
kernel.

This should also go into compat-wireless-stable-3.3.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-2.6.31.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.31.h b/include/linux/compat-2.6.31.h
index 25db973..a1244cb 100644
--- a/include/linux/compat-2.6.31.h
+++ b/include/linux/compat-2.6.31.h
@@ -215,6 +215,20 @@ extern long long atomic64_add_return(long long a, atomic64_t *v);

#endif

+/*
+ * Like above, but uses del_timer() instead of del_timer_sync(). This means,
+ * if it returns 0 the timer function may be running and the queueing is in
+ * progress.
+ */
+static inline bool __cancel_delayed_work(struct delayed_work *work)
+{
+ bool ret;
+
+ ret = del_timer(&work->timer);
+ if (ret)
+ work_clear_pending(&work->work);
+ return ret;
+}

#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */

--
1.7.5.4



2012-01-23 18:26:25

by Andreas Hartmann

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

Hauke Mehrtens schrieb:
> On 01/23/2012 06:57 PM, Luis R. Rodriguez wrote:
>> On Mon, Jan 23, 2012 at 9:55 AM, Andreas Hartmann
>> <[email protected]> wrote:
>>> Luis R. Rodriguez schrieb:
>>>> On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
>>>>> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
>>>>> not available in old kernel versions. This was just copied from the
>>>>> kernel.
>>>>>
>>>>> This should also go into compat-wireless-stable-3.3.
>>>>>
>>>>> Signed-off-by: Hauke Mehrtens <[email protected]>
>>>>
>>>> Thanks! Applied all onto compat-wireless.git and compat.git, in
>>>> addition to the linux-3.3.y branch for compat.git as you indicated for
>>>> this patch. Will roll out a new tarball right away.
>>>
>>> BTW: I've to apply always the following patch to some older
>>> compat-wireless packages (3.2 e.g) to get it compiled with kernel 3.1:
>>>
>>> --- drivers/misc/eeprom/Makefile.orig 2012-01-10 02:10:51.000000000 +0100
>>> +++ drivers/misc/eeprom/Makefile 2012-01-10 05:14:40.082494612 +0100
>>> @@ -1,3 +1,3 @@
>>> obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
>>> -obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
>>> +# obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
>>> obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o
>>>
>>> Is this eventually needed in 3.3, too?
>>
>> Why do you need this? Can you show your compile errors?
>>
>> Luis
>
> This is fixed in HEAD in this commit:
>
> commit 0db9fae8c40674f65cf50c78e6587b9c9d9e2735
> Author: Hauke Mehrtens <[email protected]>
> Date: Sat Dec 3 15:46:21 2011 +0100
>
> compat-wireless: remove some modules from Makefile
>
> It should be backported to linux-3.1.y and linux-3.2.y. We just ship
> eeprom_93cx6.c and nothing else in this directory.


Thank you,
Andreas

2012-01-23 18:27:02

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

On Mon, Jan 23, 2012 at 10:01 AM, Hauke Mehrtens <[email protected]> wrote:
> On 01/23/2012 06:57 PM, Luis R. Rodriguez wrote:
>> On Mon, Jan 23, 2012 at 9:55 AM, Andreas Hartmann
>> <[email protected]> wrote:
>>> Luis R. Rodriguez schrieb:
>>>> On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
>>>>> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
>>>>> not available in old kernel versions. This was just copied from the
>>>>> kernel.
>>>>>
>>>>> This should also go into compat-wireless-stable-3.3.
>>>>>
>>>>> Signed-off-by: Hauke Mehrtens <[email protected]>
>>>>
>>>> Thanks! Applied all onto compat-wireless.git and compat.git, in
>>>> addition to the linux-3.3.y branch for compat.git as you indicated for
>>>> this patch. Will roll out a new tarball right away.
>>>
>>> BTW: I've to apply always the following patch to some older
>>> compat-wireless packages (3.2 e.g) to get it compiled with kernel 3.1:
>>>
>>> --- drivers/misc/eeprom/Makefile.orig   2012-01-10 02:10:51.000000000 +0100
>>> +++ drivers/misc/eeprom/Makefile        2012-01-10 05:14:40.082494612 +0100
>>> @@ -1,3 +1,3 @@
>>>  obj-$(CONFIG_EEPROM_93CX6)     += eeprom_93cx6.o
>>> -obj-$(CONFIG_EEPROM_93XX46)    += eeprom_93xx46.o
>>> +# obj-$(CONFIG_EEPROM_93XX46)  += eeprom_93xx46.o
>>>  obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o
>>>
>>> Is this eventually needed in 3.3, too?
>>
>> Why do you need this? Can you show your compile errors?
>>
>>   Luis
>
> This is fixed in HEAD in this commit:
>
> commit 0db9fae8c40674f65cf50c78e6587b9c9d9e2735
> Author: Hauke Mehrtens <[email protected]>
> Date:   Sat Dec 3 15:46:21 2011 +0100
>
>    compat-wireless: remove some modules from Makefile
>
> It should be backported to linux-3.1.y and linux-3.2.y. We just ship
> eeprom_93cx6.c and nothing else in this directory.

Thanks, I've applied this onto those branches and upon a new release
those will get the fixes.

Luis

2012-01-23 17:31:35

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
> not available in old kernel versions. This was just copied from the
> kernel.
>
> This should also go into compat-wireless-stable-3.3.
>
> Signed-off-by: Hauke Mehrtens <[email protected]>

Thanks! Applied all onto compat-wireless.git and compat.git, in
addition to the linux-3.3.y branch for compat.git as you indicated for
this patch. Will roll out a new tarball right away.

Luis

2012-01-23 18:01:26

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

On 01/23/2012 06:57 PM, Luis R. Rodriguez wrote:
> On Mon, Jan 23, 2012 at 9:55 AM, Andreas Hartmann
> <[email protected]> wrote:
>> Luis R. Rodriguez schrieb:
>>> On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
>>>> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
>>>> not available in old kernel versions. This was just copied from the
>>>> kernel.
>>>>
>>>> This should also go into compat-wireless-stable-3.3.
>>>>
>>>> Signed-off-by: Hauke Mehrtens <[email protected]>
>>>
>>> Thanks! Applied all onto compat-wireless.git and compat.git, in
>>> addition to the linux-3.3.y branch for compat.git as you indicated for
>>> this patch. Will roll out a new tarball right away.
>>
>> BTW: I've to apply always the following patch to some older
>> compat-wireless packages (3.2 e.g) to get it compiled with kernel 3.1:
>>
>> --- drivers/misc/eeprom/Makefile.orig 2012-01-10 02:10:51.000000000 +0100
>> +++ drivers/misc/eeprom/Makefile 2012-01-10 05:14:40.082494612 +0100
>> @@ -1,3 +1,3 @@
>> obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
>> -obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
>> +# obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
>> obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o
>>
>> Is this eventually needed in 3.3, too?
>
> Why do you need this? Can you show your compile errors?
>
> Luis

This is fixed in HEAD in this commit:

commit 0db9fae8c40674f65cf50c78e6587b9c9d9e2735
Author: Hauke Mehrtens <[email protected]>
Date: Sat Dec 3 15:46:21 2011 +0100

compat-wireless: remove some modules from Makefile

It should be backported to linux-3.1.y and linux-3.2.y. We just ship
eeprom_93cx6.c and nothing else in this directory.

Hauke

2012-01-23 17:58:29

by Andreas Hartmann

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

Luis R. Rodriguez schrieb:
> On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
>> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
>> not available in old kernel versions. This was just copied from the
>> kernel.
>>
>> This should also go into compat-wireless-stable-3.3.
>>
>> Signed-off-by: Hauke Mehrtens <[email protected]>
>
> Thanks! Applied all onto compat-wireless.git and compat.git, in
> addition to the linux-3.3.y branch for compat.git as you indicated for
> this patch. Will roll out a new tarball right away.

BTW: I've to apply always the following patch to some older
compat-wireless packages (3.2 e.g) to get it compiled with kernel 3.1:

--- drivers/misc/eeprom/Makefile.orig 2012-01-10 02:10:51.000000000 +0100
+++ drivers/misc/eeprom/Makefile 2012-01-10 05:14:40.082494612 +0100
@@ -1,3 +1,3 @@
obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
-obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
+# obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o

Is this eventually needed in 3.3, too?


Thanks,
Andreas

2012-01-23 17:57:43

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

On Mon, Jan 23, 2012 at 9:55 AM, Andreas Hartmann
<[email protected]> wrote:
> Luis R. Rodriguez schrieb:
>> On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
>>> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
>>> not available in old kernel versions. This was just copied from the
>>> kernel.
>>>
>>> This should also go into compat-wireless-stable-3.3.
>>>
>>> Signed-off-by: Hauke Mehrtens <[email protected]>
>>
>> Thanks! Applied all onto compat-wireless.git and compat.git, in
>> addition to the linux-3.3.y branch for compat.git as you indicated for
>> this patch. Will roll out a new tarball right away.
>
> BTW: I've to apply always the following patch to some older
> compat-wireless packages (3.2 e.g) to get it compiled with kernel 3.1:
>
> --- drivers/misc/eeprom/Makefile.orig   2012-01-10 02:10:51.000000000 +0100
> +++ drivers/misc/eeprom/Makefile        2012-01-10 05:14:40.082494612 +0100
> @@ -1,3 +1,3 @@
>  obj-$(CONFIG_EEPROM_93CX6)     += eeprom_93cx6.o
> -obj-$(CONFIG_EEPROM_93XX46)    += eeprom_93xx46.o
> +# obj-$(CONFIG_EEPROM_93XX46)  += eeprom_93xx46.o
>  obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o
>
> Is this eventually needed in 3.3, too?

Why do you need this? Can you show your compile errors?

Luis

2012-02-01 19:14:42

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH] compat: add __cancel_delayed_work()

On 01/23/2012 06:31 PM, Luis R. Rodriguez wrote:
> On Sat, Jan 21, 2012 at 5:44 AM, Hauke Mehrtens <[email protected]> wrote:
>> __cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
>> not available in old kernel versions. This was just copied from the
>> kernel.
>>
>> This should also go into compat-wireless-stable-3.3.
>>
>> Signed-off-by: Hauke Mehrtens <[email protected]>
>
> Thanks! Applied all onto compat-wireless.git and compat.git, in
> addition to the linux-3.3.y branch for compat.git as you indicated for
> this patch. Will roll out a new tarball right away.
>
> Luis

This patch is not in the master branch of compat, it is just in the
linux-3.3.y branch. Could you please add this to master.
It is commit ed1b6816e893ee7a158ecd30687970faf4facc21 in linux-3.3.y.

Hauke