Summary: | DAHLIN-00356: Compilation fails on 4.13 | ||
Reporter: | Jean-Denis Girard (jdg) | Labels: | |
Date Opened: | 2017-09-30 21:11:49 | Date Closed: | 2019-03-06 19:51:30.000-0600 |
Priority: | Blocker | Regression? | |
Status: | Closed/Complete | Components: | |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Kernel >= 4.13 | Attachments: | ( 0) dev_attrs_groups.patch ( 1) dev_attrs_groups-v2.patch ( 2) dev_attrs_groups-v3.patch |
Description: | dev_attrs was removed from struct bus_type on kernel 4.13, need to convert to dev_groups, see http://lkml.iu.edu/hypermail/linux/kernel/1706.0/04578.html.
I made a patch and sent a pull request on github. | ||
Comments: | By: LiuYan刘研 (lovetide) 2017-10-06 17:03:26.397-0500 The patch works for me with Debian linux-image-4.13.0-1-amd64 (4.13.4-1) and a compatible 4-port analog card (wctdm24xxp). {{# uname -svr}} {{Linux 4.13.0-1-amd64 #1 SMP Debian 4.13.4-1 (2017-10-01)}} {{# lsmod | grep -i --color dahdi}} {{*dahdi*_echocan_mg2 16384 4}} {{*dahdi*_voicebus 61440 1 wctdm24xxp}} {{*dahdi* 225280 11 *dahdi*_echocan_mg2,wctdm24xxp,*dahdi*_voicebus}} {{crc_ccitt 16384 2 wctdm24xxp,*dahdi*}} {{# dahdi_hardware}} {{pci:0000:03:02.0 wctdm24xxp+ d161:8005 Wildcard TDM410P}} Thanks! By: Shaun Ruffell (sruffell) 2017-10-07 02:33:40.188-0500 Thanks for the patch. Unfortunately it cannot go in directly as it is because it will break compilation on older kernels. I'll see about reworking it to not break the older kernels DAHDI still has to support and then push it through. By: Sean Darcy (seandarcy) 2017-10-11 10:25:44.619-0500 Works for me patching next.zip from github. Fedora 26. kernel 4.13.4 $ dahdi_hardware pci:0000:01:0a.0 wctdm+ e159:0001 Wildcard TDM400P REV I I understand why you need to modify the patch to work with earlier kernels, but could we have source on github incorporating this patch ? By: Jean-Denis Girard (jdg) 2017-10-13 17:36:13.894-0500 New version of patch that maintains compatibility with older kernels. Compilation tested with kernels 4.9.56, and 4.14-rc4. Also available on github. By: Tzafrir Cohen (tzafrir) 2017-10-18 12:01:28.542-0500 Thanks for your up-to-date patch. It took me a while to figure out it was against the code with the original patch applied. After applying it I also noticed that: 1. It had a few white-space issues. 2. It left out two span attributes (lbo, is_sync_master). Fixed those issues, and here is the same patch (vs. git master) By: Sean Darcy (seandarcy) 2017-10-24 11:56:40.570-0500 As long as there's going to be a dahdi release, maybe clean up some warnings ? gcc 7.2.1 on fedora. make[1]: Entering directory '/usr/src/kernels/4.13.5-200.fc26.x86_64' CC [M] /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-base.o /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-base.c: In function 'dahdi_ioctl_setconf': /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-base.c:5712:3: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(chan->conflast, 0, DAHDI_MAX_CHUNKSIZE); ^~~~~~ /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-base.c:5713:3: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(chan->conflast1, 0, DAHDI_MAX_CHUNKSIZE); ^~~~~~ /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-base.c:5714:3: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(chan->conflast2, 0, DAHDI_MAX_CHUNKSIZE); ^~~~~~ CC [M] /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.o In file included from /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/include/dahdi/kernel.h:42:0, from /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:26: ./include/linux/device.h:584:26: warning: 'dev_attr_is_sync_master' defined but not used [-Wunused-variable] struct device_attribute dev_attr_##_name = __ATTR_RO(_name) ^ /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:225:8: note: in expansion of macro 'DEVICE_ATTR_RO' static DEVICE_ATTR_RO(is_sync_master); ^~~~~~~~~~~~~~ ./include/linux/device.h:584:26: warning: 'dev_attr_lbo' defined but not used [-Wunused-variable] struct device_attribute dev_attr_##_name = __ATTR_RO(_name) ^ /home/asterisk/rpmbuild/BUILD/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:222:8: note: in expansion of macro 'DEVICE_ATTR_RO' static DEVICE_ATTR_RO(lbo); ^~~~~~~~~~~~~~ By: Tzafrir Cohen (tzafrir) 2017-10-25 02:21:46.580-0500 The last two (defined but not used) should be fixed in my -v3 patch. Have you tried it? By: Sean Darcy (seandarcy) 2017-10-26 12:00:25.483-0500 Right you are. Used the git master, and your v3 patch. defined but not used fixed. memset warnings remain. There are two other warnings. I tried to see if I could actually be helpful, but couldn't be certain enough of the underlying logic to propose a patch. CC [M] /home/asterisk/rpmbuild/BUILD/dahdi-linux-master/drivers/dahdi/voicebus/GpakApi.o /home/asterisk/rpmbuild/BUILD/dahdi-linux-master/drivers/dahdi/voicebus/GpakApi.c: In function 'gpakWriteSystemParms': /home/asterisk/rpmbuild/BUILD/dahdi-linux-master/drivers/dahdi/voicebus/GpakApi.c:1648:22: warning: 'MsgBuffer[1]' may be used uninitialized in this function [-Wmaybe-uninitialized] MsgBuffer[1] |= DTMF_UPDATE_MASK; and CC [M] /home/asterisk/rpmbuild/BUILD/dahdi-linux-master/drivers/dahdi/xpp/card_fxs.o /home/asterisk/rpmbuild/BUILD/dahdi-linux-master/drivers/dahdi/xpp/card_fxs.c: In function 'FXS_card_ioctl': /home/asterisk/rpmbuild/BUILD/dahdi-linux-master/drivers/dahdi/xpp/card_fxs.c:1344:17: warning: increment of a boolean expression [-Wbool-operation] if (!notified++) ^~ By: Tzafrir Cohen (tzafrir) 2017-11-20 11:07:48.488-0600 Those warnings are not regressions related to the patch. As no comments have been made so far, I'll apply the v3 patch. By: Kirsty Tyerman (ktyerman) 2017-11-30 20:40:20.624-0600 I am currently running Fedora 27 (kernel:4.13.15-300.fc27.x86_64) and am having issues compiling dahdi-sources-4.11. I have applied patch v3 and have passed the dev_attrs error. It is now failing to compile with the following error: In file included from ./include/linux/kobject.h:21:0, from ./include/linux/module.h:17, from /root/dahdi-linux-complete-2.11.1+2.11.1/linux/drivers/dahdi/xpp/xbus-sysfs.c:24: /root/dahdi-linux-complete-2.11.1+2.11.1/linux/drivers/dahdi/xpp/xbus-sysfs.c:801:23: error: 'hwid_show' undeclared here (not in a function); did you mean 'type_show'? static DEVICE_ATTR_RO(hwid); By: Tzafrir Cohen (tzafrir) 2018-01-01 06:36:52.343-0600 Pushed the fix to git master. By: Michael Phillips (michaelp@ccslink.com) 2018-06-26 09:28:02.416-0500 Trying to build dahdi but getting errors in xbus-sysfs.c: linux/drivers/dahdi/xpp/xbus-sysfs.c:801:23: error: hwid_show undeclared here (not in a function); did you mean type_show? static DEVICE_ATTR_RO(hwid); ^~~~ System is Linux 4.16.15-300.fc28.x86_64 By: Shaun Ruffell (sruffell) 2019-03-06 19:46:46.068-0600 It's been awhile since I logged in here. I'm cleaning up some of the issues that were assigned to me and can be closed. |