Dahdi-linux-2.1.0.3 fails to compile with FC9 kernel 2.6.27

I’m trying to upgrade from dahdi-linux-2.0.0 to dahdi-linux-2.1.0.3. I get compile errors which seem to relater to the new hrtimer interface. I’m running FC9 with kernel 2.6.27.9. See the output below:

[root@homepc dahdi-linux-2.1.0.3]# uname -r
2.6.27.9-73.fc9.x86_64
[root@homepc dahdi-linux-2.1.0.3]# make
make -C /lib/modules/2.6.27.9-73.fc9.x86_64/build ARCH=x86_64 SUBDIRS=/usr/src/Asterisk/dahdi-linux-2.1.0.3/drivers/dahdi DAHDI_INCLUDE=/usr/src/Asterisk/dahdi-linux-2.1.0.3/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m
make[1]: Entering directory /usr/src/kernels/2.6.27.9-73.fc9.x86_64' CC [M] /usr/src/Asterisk/dahdi-linux-2.1.0.3/drivers/dahdi/dahdi_dummy.o /usr/src/Asterisk/dahdi-linux-2.1.0.3/drivers/dahdi/dahdi_dummy.c:94: error: redefinition of ‘hrtimer_get_expires’ include/linux/hrtimer.h:250: error: previous definition of ‘hrtimer_get_expires’ was here /usr/src/Asterisk/dahdi-linux-2.1.0.3/drivers/dahdi/dahdi_dummy.c:99: error: redefinition of ‘hrtimer_set_expires’ include/linux/hrtimer.h:231: error: previous definition of ‘hrtimer_set_expires’ was here make[2]: *** [/usr/src/Asterisk/dahdi-linux-2.1.0.3/drivers/dahdi/dahdi_dummy.o] Error 1 make[1]: *** [_module_/usr/src/Asterisk/dahdi-linux-2.1.0.3/drivers/dahdi] Error 2 make[1]: Leaving directory/usr/src/kernels/2.6.27.9-73.fc9.x86_64’
make: *** [modules] Error 2
[root@homepc dahdi-linux-2.1.0.3]#

I don’t know enough about this to fix it, but I can test it if required

Thanks

I have registered this in the Development Bug System

Will not compile on 2.6.27.9-159.fc10.x86_64
Will not compile on 2.6.27.9-159.fc10.i686

Compiles OK on 2.6.27.7-134.fc10.i686

Apparently the high resolution timer (hrtimer) in introduced in this kernel version 2.6.27.9-159.fc10

So if you change line 92 in
dahdi-linux-complete-2.1.0.3+2.1.0.2/linux/drivers/dahdi/dahdi_dummy.c
to KERNEL_VERSION(2,6,27)
it will compile.

Here the diff:

— dahdi_dummy.c.default 2009-01-12 18:23:11.000000000 +1100
+++ dahdi_dummy.c 2009-01-12 18:23:38.000000000 +1100
@@ -89,7 +89,7 @@
#define USB2420
#endif

-#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) )
+#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) )
/* compatibility with new hrtimer interface */
static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
{

I ran into this issue today. Thanks for posting the fix.

-Mats