Summary: | DAHLIN-00070: Fails to Compile on Fedora FC9 with Kernel 2.6.27 - related to new hrtimer | ||
Reporter: | Nigel J. Terry (nterry) | Labels: | |
Date Opened: | 2009-01-02 16:23:47.000-0600 | Date Closed: | 2009-01-21 12:24:43.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | General |
Versions: | 2.1.0.3 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ( 0) dahdi-linux-2.1.0.3-hrtimer.patch ( 1) hrtimer.h | |
Description: | 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 ****** ADDITIONAL INFORMATION ****** I've been running * for some time and regularly update. 2.0.0 compiles fine. Looking at the code it appears that changes were made to use the new kernel hrtimer interface, but I don't know enough to work out what is wrong. | ||
Comments: | By: Nigel J. Terry (nterry) 2009-01-02 16:50:11.000-0600 Attached file is the hrtimer.h file from the kernel directory for the build of Fedora I am running which is 2.6.27.9-73.fc9.x86_64 where hrtimer_get_expires and hrtimer_set_expires were previously defined By: Stuart Edge (asteredge) 2009-01-13 17:20:58.000-0600 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.orig 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) { By: Nigel J. Terry (nterry) 2009-01-13 18:20:14.000-0600 Thats fixes it. Now compiles, loads and works. Thanks By: Sean Bright (seanbright) 2009-01-13 19:52:17.000-0600 On all 2.6.27 kernels or just in fedora? I have a feeling they backported this to that version of their kernel. By: Stuart Edge (asteredge) 2009-01-14 03:05:45.000-0600 I have only tested on fedora 10. I thought they may have done a backport too. By: Alexander 'Leo' Bergolth (bergolth) 2009-01-14 06:41:52.000-0600 The problem is an alsa-patch in current fedora kernels that backports those hrtimer accessors. The attached patch detects if those functions are already defined in the kernels hrtimer.h and conditinally adds them if necessary. By: Digium Subversion (svnbot) 2009-01-20 15:23:19.000-0600 Repository: dahdi Revision: 5770 U linux/trunk/drivers/dahdi/Kbuild U linux/trunk/drivers/dahdi/dahdi_dummy.c ------------------------------------------------------------------------ r5770 | sruffell | 2009-01-20 15:23:19 -0600 (Tue, 20 Jan 2009) | 8 lines Some distributions have backported the hrtimer_get_expires and hrtimer_set_expires functions from 2.6.28. Therefore, dahdi-linux cannot use the linux version code to determine if these functions are present or not. This patch actively checks for those functions. Closes Issue: DAHLIN-70 Thanks to bergolth for the patch. ------------------------------------------------------------------------ http://svn.digium.com/view/dahdi?view=rev&revision=5770 By: Shaun Ruffell (sruffell) 2009-01-20 15:23:56.000-0600 I slightly reformatted the patch before committing. Thanks... By: Digium Subversion (svnbot) 2009-01-21 09:17:05.000-0600 Repository: dahdi Revision: 5778 U linux/trunk/drivers/dahdi/Kbuild U linux/trunk/drivers/dahdi/dahdi_dummy.c ------------------------------------------------------------------------ r5778 | tzafrir | 2009-01-21 09:17:05 -0600 (Wed, 21 Jan 2009) | 8 lines Fix version in dahdi_dummy workaround. Followup to DAHLIN-70 . Also note that this is specific to some Fedora versions. See e.g. http://cvs.fedoraproject.org/viewvc/rpms/kernel/F-10/kernel.spec?r1=1.1206.2.2&r2=1.1206.2.3 ------------------------------------------------------------------------ http://svn.digium.com/view/dahdi?view=rev&revision=5778 By: Digium Subversion (svnbot) 2009-01-21 12:24:43.000-0600 Repository: dahdi Revision: 5792 U linux/trunk/drivers/dahdi/dahdi_dummy.c ------------------------------------------------------------------------ r5792 | sruffell | 2009-01-21 12:24:43 -0600 (Wed, 21 Jan 2009) | 5 lines If we have the accessors, do not under any circumstance redefine them regardless of the kernel version. Another followup to DAHLIN-70 . ------------------------------------------------------------------------ http://svn.digium.com/view/dahdi?view=rev&revision=5792 |