[Home]

Summary:DAHLIN-00354: DAHDI-Linux does not compile against kernel version 4.11
Reporter:Shaun Ruffell (sruffell)Labels:
Date Opened:2017-06-01 12:29:20Date Closed:2019-03-06 19:49:43.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:
Versions:Frequency of
Occurrence
Related
Issues:
is duplicated byDAHLIN-00355 dahdi modules fail to compile on kernel 4.11.3
Environment:Attachments:( 0) 0001-signal_pending-is-now-in-linux-sched-signal.h-includ.patch
( 1) 0002-atomic_read-refcount_read.patch
Description:Reported to the asterisk-dev mailing list by [~seandarcy] here:

http://lists.digium.com/pipermail/asterisk-dev/2017-June/076354.html

Changes in the interface in Linux 4.11 breaks the DAHDI build.
Comments:By: Shaun Ruffell (sruffell) 2017-06-01 12:30:44.123-0500

Attaching two patches that will fix this.  Will hold off on committing until they can be run through more testing.

By: Shaun Ruffell (sruffell) 2017-06-01 12:43:20.729-0500

These patches are also sitting out on https://github.com/sruffell/dahdi-linux/tree/changes-for-4.11 if it's easier to pull / test from github.

By: Sean Darcy (seandarcy) 2017-06-01 13:53:37.287-0500

Built and installed it. Fedora 25. Made some calls.

Works For Me.

Thanks for the fast response.

By: Sean Darcy (seandarcy) 2017-06-04 14:58:11.853-0500

The build with gcc-6.3.1 generates an indentation warning:

CC [M]  /home/asterisk/rpmbuild/BUILD/dahdi-linux-changes-for-4.11/drivers/dahdi/voicebus/GpakApi.o
/home/asterisk/rpmbuild/BUILD/dahdi-linux-changes-for-4.11/drivers/dahdi/voicebus/GpakApi.c: In function 'gpakReadDSPMemoryMap':
/home/asterisk/rpmbuild/BUILD/dahdi-linux-changes-for-4.11/drivers/dahdi/voicebus/GpakApi.c:1560:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    if (DspStatus != 0)
    ^~
/home/asterisk/rpmbuild/BUILD/dahdi-linux-changes-for-4.11/drivers/dahdi/voicebus/GpakApi.c:1563:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
 for (i = 0; i < MemoryLength_Word16; i++)

It's cosmetic, but maybe a good time to clean it up ?


By: Shaun Ruffell (sruffell) 2017-06-04 16:29:22.370-0500

Thanks, I did go ahead and push this change to master.  Should be able to run the full test suite on the drivers next week to release a new version of DAHDI.

By: LiuYan刘研 (lovetide) 2017-07-10 05:33:07.418-0500

These patches works for debian unstable too. Thanks

\# uname -svr
{{Linux 4.11.0-1-amd64 #1 SMP Debian 4.11.6-1 (2017-06-19)}}

\# lsmod | grep -i 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}}


By: Anthony Messina (amessina) 2017-08-19 11:47:56.050-0500

Is something holding back getting the initial patches in and pushing out a new version?

By: Shaun Ruffell (sruffell) 2017-08-22 09:16:10.218-0500

[~amessina] We should be able to get something in soon-ish.  It was being held up initially by the need to  reset up some of the DAHDI regression tests internally, but I think that work is mostly done now.  Although I did notice recently v4.13 also has some conflicting changes in the change log. So I would like for that case to be covered in the next DAHDI release as well.

By: Mardonio Sanchez (mar2xs) 2017-08-25 15:42:27.384-0500

Anthony Messina Could you please let me know how to apply the patches?
I will very much appreciate!


By: Shaun Ruffell (sruffell) 2017-08-25 15:52:48.385-0500

[~mar2xs], there is a "next" branch on github that contains all the candidate patches currently.  If you want, you can just grab that as a tarball here: https://github.com/asterisk/dahdi-linux/archive/next.zip

So for example:
{code}
curl -L -O 'https://github.com/asterisk/dahdi-linux/archive/next.zip'
unzip next.zip
cd dahdi-linux-next/
make -j
{code}

By: Anthony Messina (amessina) 2017-08-25 20:11:45.797-0500

[~mar2xs], I'd follow [~sruffell]'s recommendation above.

By: Sean Darcy (seandarcy) 2017-10-10 17:23:49.452-0500

On Fedora 26, kernel-4.13.4, using the github next.zip:

make[1]: Leaving directory '/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/firmware'
make -C /lib/modules/4.13.4-200.fc26.x86_64/build SUBDIRS=/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi DAHDI_INCLUDE=/home/asterisk/build/dahdi/github/dahdi-linux-next/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m
make[1]: Entering directory '/usr/src/kernels/4.13.4-200.fc26.x86_64'
 CC [M]  /home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-base.o
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-base.c: In function ‘dahdi_ioctl_setconf’:
/home/asterisk/build/dahdi/github/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/build/dahdi/github/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/build/dahdi/github/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/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.o
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:273:3: error: ‘struct bus_type’ has no member named ‘dev_attrs’
 .dev_attrs = span_dev_attrs,
  ^~~~~~~~~
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:273:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
 .dev_attrs = span_dev_attrs,
              ^~~~~~~~~~~~~~
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:273:15: note: (near initialization for ‘spans_bus_type.probe’)
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:711:3: error: ‘struct bus_type’ has no member named ‘dev_attrs’
 .dev_attrs = dahdi_device_attrs,
  ^~~~~~~~~
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:711:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
 .dev_attrs = dahdi_device_attrs,
              ^~~~~~~~~~~~~~~~~~
/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.c:711:15: note: (near initialization for ‘dahdi_device_bus.probe’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:303: /home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi/dahdi-sysfs.o] Error 1
make[1]: *** [Makefile:1516: _module_/home/asterisk/build/dahdi/github/dahdi-linux-next/drivers/dahdi] Error 2

By: Shaun Ruffell (sruffell) 2017-10-10 17:43:19.620-0500

[~seandarcy], I think your comment is not related to kernel 4.11, but related to kernel 4.13 which is reported in DAHLIN-356.

By: Sean Darcy (seandarcy) 2017-10-10 20:16:18.043-0500

Right you are. I'll follow that bug now. And try the patch.

By: Shaun Ruffell (sruffell) 2019-03-06 19:49:43.814-0600

This should be resolved in 3.0.0.