2010-10-22 03:13:13

by Blaise Gassend

[permalink] [raw]
Subject: Compat wireless breaks on kernels prior to 2.6.34 with the RT PREEMPT patch

Hi,

Compat wireless seems to not work with the RT PREEMPT patch for
kernels prior to 2.6.34 because struct device does not contain sem. I
would love to submit a patch like the one below, but I do not know how
to detect that the RT PREEMPT patch has been applied. Does anybody
happen to know?

Thanks,
Blaise

--- compat-wireless-2010-10-09/include/linux/compat-2.6.34.h
2010-10-21 19:26:34.172694358 -0700
+++ compat-wireless-2010-10-09-original/include/linux/compat-2.6.34.h
2010-10-21 19:23:10.494696161 -0700
@@ -139,32 +139,20 @@
#endif
/* source: include/linux/netdevice.h */

static inline void device_lock(struct device *dev)
{
-#ifdef XXX
- mutex_lock(&dev->parent->mutex);
-#else
down(&dev->sem);
-#endif
}

static inline int device_trylock(struct device *dev)
{
-#ifdef XXX
- return mutex_trylock(&dev->mutex);
-#else
return down_trylock(&dev->sem);
-#endif
}

static inline void device_unlock(struct device *dev)
{
-#ifdef XXX
- mutex_unlock(&dev->mutex);
-#else
up(&dev->sem);
-#endif
}

#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)


2010-10-22 05:30:18

by Blaise Gassend

[permalink] [raw]
Subject: Re: Compat wireless breaks on kernels prior to 2.6.34 with the RT PREEMPT patch

Replacing #ifdef XXX with the following might work:
#if defined(CONFIG_NONE) || defined(CONFIG_PREEMPT_RT) ||
defined(CONFIG_PREEMPT_VOLUNTARY) || defined(CONFIG_PREEMPT_DESKTOP)

On Thu, Oct 21, 2010 at 8:13 PM, Blaise Gassend <[email protected]> wrote:
> Hi,
>
> Compat wireless seems to not work with the RT PREEMPT patch for
> kernels prior to 2.6.34 because struct device does not contain sem. I
> would love to submit a patch like the one below, but I do not know how
> to detect that the RT PREEMPT patch has been applied. Does anybody
> happen to know?
>
> Thanks,
> Blaise
>
> --- compat-wireless-2010-10-09/include/linux/compat-2.6.34.h
> 2010-10-21 19:26:34.172694358 -0700
> +++ compat-wireless-2010-10-09-original/include/linux/compat-2.6.34.h
> ?2010-10-21 19:23:10.494696161 -0700
> @@ -139,32 +139,20 @@
> ?#endif
> ?/* source: include/linux/netdevice.h */
>
> ?static inline void device_lock(struct device *dev)
> ?{
> -#ifdef XXX
> - ? ? ? ?mutex_lock(&dev->parent->mutex);
> -#else
> ? ? ? ?down(&dev->sem);
> -#endif
> ?}
>
> ?static inline int device_trylock(struct device *dev)
> ?{
> -#ifdef XXX
> - ? ? ? ?return mutex_trylock(&dev->mutex);
> -#else
> ? ? ? ?return down_trylock(&dev->sem);
> -#endif
> ?}
>
> ?static inline void device_unlock(struct device *dev)
> ?{
> -#ifdef XXX
> - ? ? ? ?mutex_unlock(&dev->mutex);
> -#else
> ? ? ? ?up(&dev->sem);
> -#endif
> ?}
>
> ?#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
>