Package: fglrx-modules-dkms
Version: 1:11-3-1
Severity: wishlist
Tags: patch


Hello:

 <linux/spinlock_types.h> had the following comment until 2.6.38:

 /*
  * SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence
  * deprecated.
  * Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as
  * appropriate.
  */
 #define SPIN_LOCK_UNLOCKED     __SPIN_LOCK_UNLOCKED(old_style_spin_init)

This definition got removed in 2.6.39. A possible solution is included
in the attached DEP-3 compliant patch.
The patch restores the missing define locally until it gets fixed
upstream by AMD.

I tested this patch with 2.6.38, 2.6.38.1 , 2.6.38.2 and 2.6.39-rc1
with fglrx 11.2-2 and 11.3-1  and all seems to work.

I removed the smp_lock.h part of the patch that I had made for 11-2
since it got included as the 06 patch in 11-3 and I was waiting for
the merge window for 2.6.39 to close. The smp_lock.h issue technically
only affected 2.6.39-rc0 and up since that commit got merged during
the 2.6.39 merge window that ended today.

Hope this helps,
Miguel
Description: Add Linux 2.6.39 support
 <linux/spinlock_types.h> had the following comment until 2.6.38:
 .
 /*
  * SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence
  * deprecated.
  * Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as
  * appropriate.
  */
 #define SPIN_LOCK_UNLOCKED	__SPIN_LOCK_UNLOCKED(old_style_spin_init)
 . 
 This definition got removed in 2.6.39. Restore it locally until it gets fixed
 upstream.
Author: Miguel Colon <[email protected]>
Forwarded: no
Last-Update: 2011-03-30

--- fglrx-driver-11-3.orig/common/lib/modules/fglrx/build_mod/firegl_public.c
+++ fglrx-driver-11-3/common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -1071,7 +1071,12 @@ static int __init firegl_init_module(voi
     dev->pubdev.signature = FGL_DEVICE_SIGNATURE;
 
     for (i = 0; i < __KE_MAX_SPINLOCKS; i++)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
         dev->spinlock[i] = SPIN_LOCK_UNLOCKED;
+#else
+        dev->spinlock[i] = __SPIN_LOCK_UNLOCKED(old_style_spin_init);
+#endif
+
 
     for (i=0; i < __KE_MAX_SEMAPHORES; i++)
         sema_init(&dev->struct_sem[i], 1);

Reply via email to