[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

please unblock tp-smapi/0.40-9



Dear RT,

I've uploaded tp-smapi/0.40-9 to unstable and would like to have it in
Squeeze too. The whole diff is attached to this mail. Basically it's
just a new patch to fix #602367 - compilation against 2.6.37+:

diff --git a/thinkpad_ec.c b/thinkpad_ec.c
--- a/thinkpad_ec.c
+++ b/thinkpad_ec.c
@@ -88,7 +88,11 @@ static u64 prefetch_jiffies;
 #define TPC_PREFETCH_JUNK   (INITIAL_JIFFIES+1)   /*   Ignore prefetch */

 /* Locking: */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 static DECLARE_MUTEX(thinkpad_ec_mutex);
+#else
+static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
+#endif

 /* Kludge in case the ACPI DSDT reserves the ports we need. */
 static int force_io;    /* Willing to do IO to ports we couldn't
reserve? */
diff --git a/tp_smapi.c b/tp_smapi.c
--- a/tp_smapi.c
+++ b/tp_smapi.c
@@ -109,7 +109,11 @@ static struct { u8 rc; char *msg; int re
 #define SMAPI_PORT2 0x4F           /* fixed port, meaning unclear */
 static unsigned short smapi_port;  /* APM control port, normally 0xB2 */

+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 static DECLARE_MUTEX(smapi_mutex);
+#else
+static DEFINE_SEMAPHORE(smapi_mutex);
+#endif

 /**
  * find_smapi_port - read SMAPI port from NVRAM

Yes I know, 2.6.37 won't be in Squeeze, but I bet there are enough ppl
wanting to have the latest and greatest kernels on their laptops while
still running stable (maybe with backports).

Thanks in advice and kudos for your great work
Evgeni
diff --git a/debian/changelog b/debian/changelog
index c051eaf..6fadfc4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tp-smapi (0.40-9) unstable; urgency=low
+
+  * debian/patches/03_2.6.37-compatibility.patch:
+    + Use DEFINE_SEMAPHORE instead of DECLARE_MUTEX in 2.6.37 and above.
+      Closes: #602367
+      Thanks: Tanaka Watanabe <hellhound.kerberos@gmail.com>
+
+ -- Evgeni Golov <evgeni@debian.org>  Sun, 12 Dec 2010 13:44:06 +0100
+
 tp-smapi (0.40-8) unstable; urgency=low
 
   * debian/patches/02_X200-T500-support.patch:
diff --git a/debian/patches/03_2.6.37-compatibility.patch b/debian/patches/03_2.6.37-compatibility.patch
new file mode 100644
index 0000000..7af384f
--- /dev/null
+++ b/debian/patches/03_2.6.37-compatibility.patch
@@ -0,0 +1,41 @@
+From: Tanaka Watanabe <hellhound.kerberos@gmail.com>
+Date: Thu, 4 Nov 2010 18:06:39 +0900
+Subject: use DEFINE_SEMAPHORE in 2.6.37+
+License: GPL-2+
+Bug-Debian: http://bugs.debian.org/602367
+
+Building tp_smapi against 2.6.37 fails because 'DECLARE_MUTEX'
+has been removed in 4882720b267b7b1d1b0ce08334b205f0329d4615
+in torvalds/linux-2.6.git. Use DEFINE_SEMAPHORE instead.
+
+diff --git a/thinkpad_ec.c b/thinkpad_ec.c
+--- a/thinkpad_ec.c
++++ b/thinkpad_ec.c
+@@ -88,7 +88,11 @@ static u64 prefetch_jiffies;
+ #define TPC_PREFETCH_JUNK   (INITIAL_JIFFIES+1)   /*   Ignore prefetch */
+
+ /* Locking: */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ static DECLARE_MUTEX(thinkpad_ec_mutex);
++#else
++static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
++#endif
+
+ /* Kludge in case the ACPI DSDT reserves the ports we need. */
+ static int force_io;    /* Willing to do IO to ports we couldn't reserve? */
+diff --git a/tp_smapi.c b/tp_smapi.c
+--- a/tp_smapi.c
++++ b/tp_smapi.c
+@@ -109,7 +109,11 @@ static struct { u8 rc; char *msg; int re
+ #define SMAPI_PORT2 0x4F           /* fixed port, meaning unclear */
+ static unsigned short smapi_port;  /* APM control port, normally 0xB2 */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ static DECLARE_MUTEX(smapi_mutex);
++#else
++static DEFINE_SEMAPHORE(smapi_mutex);
++#endif
+
+ /**
+  * find_smapi_port - read SMAPI port from NVRAM
+
diff --git a/debian/patches/series b/debian/patches/series
index c2bdb3d..e70aaa8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 01_include-thinkpad_ec.h-directly.patch
 02_hdaps-orientation-update.patch
+03_2.6.37-compatibility.patch
 99_Makefile-for-Debian.patch

Reply to: