package/dahdi-linux: bump version
PATCH v2 1/1 package/dahdi-linux: bump version
While trying to fix build errors with version 3.3.0 and newer kernels some of the upstream patches could not be applied neither to the version currently provided by buildroot nor 3.4.0 without backporting.
This is especially a problem with https://github.com/asterisk/dahdi-linux/pull/77
which contains fixes for drivers/dahdi/opvxa1200/ which was added after version 3.3.0 was tagged.
The bump to 3.4.0, which includes the new opvxa1200 driver, is also problematic because the hash files
http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-3.4.0.sha256
https://github.com/asterisk/dahdi-linux/releases/download/v3.4.0/dahdi-linux-3.4.0.tar.gz.sha256
contain a hash
35e6bd0c98dc86af9faaaf42054fa6905811ab36764c5e2671d63c846bc7f923 dahdi-linux-3.4.0.tar.gz
which is wrong:
$ wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-3.4.0.tar.gz $ sha256sum dahdi-linux-3.4.0.tar.gz fccd6f147b58cbc8f9afb2235bd2eb2140b99d06eec572cf9860ef8d4bf370d1 dahdi-linux-3.4.0.tar.gz
$ wget https://github.com/asterisk/dahdi-linux/releases/download/v3.4.0/dahdi-linux-3.4.0.tar.gz $ sha256sum dahdi-linux-3.4.0.tar.gz b1344d61b86f68ae3fb774b76657216c6bf3cca89e04bfc6c93dbefccc88c654 dahdi-linux-3.4.0.tar.gz
Both source tarballs were changed after the hash file was produced...
To get a valid source code for version 3.4.0 we would need to download it via the github helper anyway so instead we download the current master branch so all newly needed upstream patches apply cleanly and we can remove our current patch set.
For details about the current state of the dahdi-linux github repo see
https://github.com/asterisk/dahdi-linux/pull/77#issuecomment-3150876132
Changelog:
- removed all current patches because they are included in the master branch
- added new patches to fix various build errors related to newer kernel versions
- Fixed typo in hash file
- updated kernel config fixups because CRC_CCITT was transformed into an unselectable blind option in kernel 6.15:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/lib/Kconfig?id=7939da264bcc91ced4d01014241a581e79d414d9
Instead we select ppp_async & deps as reasonable alternative:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ppp/Kconfig?h=v6.18.8#n188
Fixes:
https://autobuild.buildroot.net/results/47f/47fe1bfe3b052c7c085536569b895e62ab4ce5e8/
---
v2: fix build with kernel >= 6.15 (Thomas)
.../0001-fix-build-with-32-bits-kernel.patch | 145 ----------- ...ers-for-del_timer-and-del_timer_sync.patch | 36 +++ ...ilation-issue-for-6-8-y-6-9-y-kernel.patch | 230 ------------------ ...pper-for-renamed-from_timer-function.patch | 33 +++ ...se-ccflags-y-instead-of-EXTRA_CFLAGS.patch | 222 +++++++++++++++++ ...const-struct-device_device-if-needed.patch | 82 ------- package/dahdi-linux/dahdi-linux.hash | 6 +- package/dahdi-linux/dahdi-linux.mk | 9 +- 8 files changed, 299 insertions(+), 464 deletions(-) delete mode 100644 package/dahdi-linux/0001-fix-build-with-32-bits-kernel.patch create mode 100644 package/dahdi-linux/0001-kernel.h-Add-wrappers-for-del_timer-and-del_timer_sync.patch delete mode 100644 package/dahdi-linux/0002-Fix-compilation-issue-for-6-8-y-6-9-y-kernel.patch create mode 100644 package/dahdi-linux/0002-kernel.h-Add-wrapper-for-renamed-from_timer-function.patch create mode 100644 package/dahdi-linux/0003-oct612x-Use-ccflags-y-instead-of-EXTRA_CFLAGS.patch delete mode 100644 package/dahdi-linux/0003-xpp-sysfs-Use-const-struct-device_device-if-needed.patch
package/dahdi-linux/0001-fix-build-with-32-bits-kernel.patch deleted +0 -145
@@ -1,145 +0,0 @@ -From aa74fa2fb5acf54bd46ad4c1b10e0a23a2cb3d25 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <[email protected]> -Date: Thu, 4 Nov 2021 18:45:11 +0100 -Subject: [PATCH] fix build with 32-bits kernel - -Use div_s64 or div_s64_rem to fix the following build failure on 32-bits -kernels: - -ERROR: modpost: "__divdi3" [/home/fabrice/buildroot/output/build/dahdi-linux-5c840cf43838e0690873e73409491c392333b3b8/drivers/dahdi/xpp/xpp_usb.ko] undefined! -ERROR: modpost: "__udivdi3" [/home/fabrice/buildroot/output/build/dahdi-linux-5c840cf43838e0690873e73409491c392333b3b8/drivers/dahdi/xpp/xpp_usb.ko] undefined! -ERROR: modpost: "__moddi3" [/home/fabrice/buildroot/output/build/dahdi-linux-5c840cf43838e0690873e73409491c392333b3b8/drivers/dahdi/xpp/xpp.ko] undefined! -ERROR: modpost: "__divdi3" [/home/fabrice/buildroot/output/build/dahdi-linux-5c840cf43838e0690873e73409491c392333b3b8/drivers/dahdi/xpp/xpp.ko] undefined! - -Signed-off-by: Fabrice Fontaine <[email protected]> -Upstream: https://github.com/asterisk/dahdi-linux/pull/32 ---- - drivers/dahdi/xpp/xbus-core.c | 9 ++++++--- - drivers/dahdi/xpp/xbus-pcm.c | 4 ++-- - drivers/dahdi/xpp/xbus-sysfs.c | 2 +- - drivers/dahdi/xpp/xframe_queue.c | 15 ++++++++++----- - drivers/dahdi/xpp/xpp_usb.c | 2 +- - 5 files changed, 20 insertions(+), 12 deletions(-) - -diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c -index fc4ce7b..b1d1fd7 100644 ---- a/drivers/dahdi/xpp/xbus-core.c -+++ b/drivers/dahdi/xpp/xbus-core.c -@@ -1754,11 +1754,14 @@ out: - - static void xbus_fill_proc_queue(struct seq_file *sfile, struct xframe_queue *q) - { -+ s64 msec = 0; -+ s32 rem = 0; -+ -+ msec = div_s64_rem(q->worst_lag_usec, 1000, &rem); - seq_printf(sfile, -- "%-15s: counts %3d, %3d, %3d worst %3d, overflows %3d worst_lag %02lld.%lld ms\n", -+ "%-15s: counts %3d, %3d, %3d worst %3d, overflows %3d worst_lag %02lld.%d ms\n", - q->name, q->steady_state_count, q->count, q->max_count, -- q->worst_count, q->overflows, q->worst_lag_usec / 1000, -- q->worst_lag_usec % 1000); -+ q->worst_count, q->overflows, msec, rem); - xframe_queue_clearstats(q); - } - -diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c -index 8bb2fe7..e690ce7 100644 ---- a/drivers/dahdi/xpp/xbus-pcm.c -+++ b/drivers/dahdi/xpp/xbus-pcm.c -@@ -129,7 +129,7 @@ static int xpp_ticker_step(struct xpp_ticker *ticker, const ktime_t t) - usec = ktime_us_delta(ticker->last_sample, - ticker->first_sample); - ticker->first_sample = ticker->last_sample; -- ticker->tick_period = usec / ticker->cycle; -+ ticker->tick_period = div_s64(usec, ticker->cycle); - cycled = 1; - } - ticker->count++; -@@ -497,7 +497,7 @@ static void send_drift(xbus_t *xbus, int drift) - XBUS_DBG(SYNC, xbus, - "%sDRIFT adjust %s (%d) (last update %lld seconds ago)\n", - (disable_pll_sync) ? "Fake " : "", msg, drift, -- msec_delta / MSEC_PER_SEC); -+ div_s64(msec_delta, MSEC_PER_SEC)); - if (!disable_pll_sync) - CALL_PROTO(GLOBAL, SYNC_SOURCE, xbus, NULL, SYNC_MODE_PLL, - drift); -diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c -index d8c11dc..35180d9 100644 ---- a/drivers/dahdi/xpp/xbus-sysfs.c -+++ b/drivers/dahdi/xpp/xbus-sysfs.c -@@ -249,7 +249,7 @@ static DEVICE_ATTR_READER(driftinfo_show, dev, buf) - /* - * Calculate lost ticks time - */ -- seconds = ktime_ms_delta(now, di->last_lost_tick) / 1000; -+ seconds = div_s64(ktime_ms_delta(now, di->last_lost_tick), 1000); - minutes = seconds / 60; - seconds = seconds % 60; - hours = minutes / 60; -diff --git a/drivers/dahdi/xpp/xframe_queue.c b/drivers/dahdi/xpp/xframe_queue.c -index e986083..8e5e508 100644 ---- a/drivers/dahdi/xpp/xframe_queue.c -+++ b/drivers/dahdi/xpp/xframe_queue.c -@@ -35,15 +35,18 @@ static void __xframe_dump_queue(struct xframe_queue *q) - int i = 0; - char prefix[30]; - ktime_t now = ktime_get(); -+ s64 msec = 0; -+ s32 rem = 0; - - printk(KERN_DEBUG "%s: dump queue '%s' (first packet in each frame)\n", - THIS_MODULE->name, q->name); - list_for_each_entry_reverse(xframe, &q->head, frame_list) { - xpacket_t *pack = (xpacket_t *)&xframe->packets[0]; - s64 usec = ktime_us_delta(now, xframe->kt_queued); -+ msec = div_s64_rem(usec, 1000, &rem); - -- snprintf(prefix, ARRAY_SIZE(prefix), " %3d> %5lld.%03lld msec", -- i++, usec / 1000, usec % 1000); -+ snprintf(prefix, ARRAY_SIZE(prefix), " %3d> %5lld.%03d msec", -+ i++, msec, rem); - dump_packet(prefix, pack, 1); - } - } -@@ -52,6 +55,8 @@ static bool __xframe_enqueue(struct xframe_queue *q, xframe_t *xframe) - { - int ret = 1; - static int overflow_cnt; -+ s64 msec = 0; -+ s32 rem = 0; - - if (unlikely(q->disabled)) { - ret = 0; -@@ -60,11 +65,11 @@ static bool __xframe_enqueue(struct xframe_queue *q, xframe_t *xframe) - if (q->count >= q->max_count) { - q->overflows++; - if ((overflow_cnt++ % 1000) < 5) { -- NOTICE("Overflow of %-15s: counts %3d, %3d, %3d worst %3d, overflows %3d worst_lag %02lld.%lld ms\n", -+ msec = div_s64_rem(q->worst_lag_usec, 1000, &rem); -+ NOTICE("Overflow of %-15s: counts %3d, %3d, %3d worst %3d, overflows %3d worst_lag %02lld.%d ms\n", - q->name, q->steady_state_count, q->count, - q->max_count, q->worst_count, q->overflows, -- q->worst_lag_usec / 1000, -- q->worst_lag_usec % 1000); -+ msec, rem); - __xframe_dump_queue(q); - } - ret = 0; -diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c -index 1a591b1..3741457 100644 ---- a/drivers/dahdi/xpp/xpp_usb.c -+++ b/drivers/dahdi/xpp/xpp_usb.c -@@ -882,7 +882,7 @@ static void xpp_send_callback(struct urb *urb) - usec = 0; /* System clock jumped */ - if (usec > xusb->max_tx_delay) - xusb->max_tx_delay = usec; -- i = usec / USEC_BUCKET; -+ i = div_s64(usec, USEC_BUCKET); - if (i >= NUM_BUCKETS) - i = NUM_BUCKETS - 1; - xusb->usb_tx_delay[i]++; --- -2.33.0 -
package/dahdi-linux/0001-kernel.h-Add-wrappers-for-del_timer-and-del_timer_sync.patch new file +36 -0
@@ -0,0 +1,36 @@ +From 520cf14256503b4fb5449d72e3c179065d17871a Mon Sep 17 00:00:00 2001 +From: InterLinked1 <[email protected]> +Date: Tue, 8 Jul 2025 18:35:56 -0400 +Subject: [PATCH] kernel.h: Add wrappers for del_timer and del_timer_sync. + +del_timer[_sync] was renamed to timer_delete[_sync] in kernel +commit bb663f0f3c396c6d05f6c5eeeea96ced20ff112e, and the +compatibility wrappers were removed completely in kernel commit +8fa7292fee5c5240402371ea89ab285ec856c916. Add the wrappers +back on newer kernels to allow compilation. + +Resolves: #91 + +Upstream: https://github.com/asterisk/dahdi-linux/pull/92 + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + include/dahdi/kernel.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h +index fdd2f885..e23ea256 100644 +--- a/include/dahdi/kernel.h ++++ b/include/dahdi/kernel.h +@@ -66,6 +66,11 @@ + #endif /* RHEL_RELEASE_CODE */ + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0) ++#define del_timer timer_delete ++#define del_timer_sync timer_delete_sync ++#endif ++ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) + #include <linux/pci.h> + #include <linux/dma-mapping.h>
package/dahdi-linux/0002-Fix-compilation-issue-for-6-8-y-6-9-y-kernel.patch deleted +0 -230
230 lines not on this page · raw message
package/dahdi-linux/0002-kernel.h-Add-wrapper-for-renamed-from_timer-function.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 9baf903501a797465b47da3a4731411e1b5a1021 Mon Sep 17 00:00:00 2001 +From: InterLinked1 <[email protected]> +Date: Sat, 12 Jul 2025 17:52:40 -0400 +Subject: [PATCH] kernel.h: Add wrapper for renamed from_timer function. + +from_timer was renamed to timer_container_of in kernel commit +41cb08555c4164996d67c78b3bf1c658075b75f1 as part of updates to +the timer APIs. Add a compatibility wrapper for kernels >= 6.16.0. + +Resolves: #95 + +Upstream: https://github.com/asterisk/dahdi-linux/pull/96 + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + include/dahdi/kernel.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h +index fdd2f885..6201d9c9 100644 +--- a/include/dahdi/kernel.h ++++ b/include/dahdi/kernel.h +@@ -58,6 +58,10 @@ + + #include <linux/poll.h> + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) ++#define from_timer timer_container_of ++#endif ++ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) + #define netif_napi_add netif_napi_add_weight + #elif defined(RHEL_RELEASE_VERSION) && defined(RHEL_RELEASE_CODE)
package/dahdi-linux/0003-oct612x-Use-ccflags-y-instead-of-EXTRA_CFLAGS.patch new file +222 -0
222 lines not on this page · raw message
package/dahdi-linux/0003-xpp-sysfs-Use-const-struct-device_device-if-needed.patch deleted +0 -82
82 lines not on this page · raw message
package/dahdi-linux/dahdi-linux.hash +3 -3
@@ -1,7 +1,7 @@ -# From http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-3.3.0.sha256 -sha256 f9528a82b5e88c1d92d737efd65bd571bef2cd1b1b44d43b857a76e38e01a7c0 dahdi-linux-3.3.0.tar.gz +# Locally compputed +sha256 8490a19369fc606feb723b44c8acca4a58f4f244b89234ba97ea988ffd217e17 dahdi-linux-648016d6b3a06f7ec75c17ef94ffa17be59eebcf.tar.gz -# Firmware files have no upstream hash, so sha56 locally computed +# Firmware files have no upstream hash, so sha256 locally computed sha256 3ff26cf80555fd7470b43a87c51d03c1db2a75abcd4561d79f69b6c48298e4a1 dahdi-fwload-vpmadt032-1.25.0.tar.gz sha256 d5b6ab6851e431afcfec2ecc39d95fa88fe3939ffdb2e3d4f28a43cabf30e95b dahdi-fw-a4a-a0017.tar.gz sha256 e039af8bec36407b74e1dd9ebdd49ba077469eda79d4e6093721ed2836d4536f dahdi-fw-a4b-d001e.tar.gz
package/dahdi-linux/dahdi-linux.mk +5 -4
@@ -4,9 +4,8 @@ # ################################################################################ -DAHDI_LINUX_VERSION = 3.3.0 -DAHDI_LINUX_SITE = \ - http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases +DAHDI_LINUX_VERSION = 648016d6b3a06f7ec75c17ef94ffa17be59eebcf +DAHDI_LINUX_SITE = $(call github,asterisk,dahdi-linux,$(DAHDI_LINUX_VERSION)) # We need to download all those firmware blobs ourselves, otherwise # dahdi-linux will try to download them at install time.
@@ -62,7 +61,9 @@ endef DAHDI_LINUX_POST_EXTRACT_HOOKS += DAHDI_LINUX_EXTRACT_FW define DAHDI_LINUX_LINUX_CONFIG_FIXUPS - $(call KCONFIG_ENABLE_OPT,CONFIG_CRC_CCITT) + $(call KCONFIG_ENABLE_OPT,CONFIG_PPP) + $(call KCONFIG_ENABLE_OPT,CONFIG_PPP_ASYNC) + $(call KCONFIG_ENABLE_OPT,CONFIG_TTY) endef # Need to pass the same options as for building the modules, because
Signature · 6 lines
2.47.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot