All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/dahdi-linux: fix build with kernel >= 5.18
@ 2022-10-30 12:55 Fabrice Fontaine
  2022-10-30 14:03 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2022-10-30 12:55 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E . MORIN, Fabrice Fontaine

Fix the following build failure with kernel >= 5.18 raised since bump to
version 3.2.0 in commit 6cbfed0dbf43c5e04e3cc543b642e3c996bfed97:

/home/autobuild/autobuild/instance-0/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wct4xxp/base.c: In function ‘t4_allocate_buffers’:
/home/autobuild/autobuild/instance-0/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wct4xxp/base.c:3864:17: error: implicit declaration of function ‘pci_alloc_consistent’ [-Werror=implicit-function-declaration]
 3864 |         alloc = pci_alloc_consistent(wc->dev, numbufs * T4_BASE_SIZE(wc) * 2,
      |                 ^~~~~~~~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/ddacd807dddeb1649e957264ac57bba27d9bb463

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...lation-issues-on-linux-kernel-5-18-0.patch | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 package/dahdi-linux/0003-Fixed-compilation-issues-on-linux-kernel-5-18-0.patch

diff --git a/package/dahdi-linux/0003-Fixed-compilation-issues-on-linux-kernel-5-18-0.patch b/package/dahdi-linux/0003-Fixed-compilation-issues-on-linux-kernel-5-18-0.patch
new file mode 100644
index 0000000000..a896def375
--- /dev/null
+++ b/package/dahdi-linux/0003-Fixed-compilation-issues-on-linux-kernel-5-18-0.patch
@@ -0,0 +1,58 @@
+From dbb43101c2a9205b67223b006bf75c29ebadced9 Mon Sep 17 00:00:00 2001
+From: Pushkar Singh <psingh@sangoma.com>
+Date: Tue, 2 Aug 2022 19:40:00 +0530
+Subject: [PATCH] Fixed compilation issues on linux kernel >= 5.18.0
+
+With kernel 5.18 and higher
+PCI: Remove the deprecated "pci-dma-compat.h" API
+
+The commit will make sure to impplement pci dma related api's
+[Retrieved from:
+https://github.com/asterisk/dahdi-linux/commit/dbb43101c2a9205b67223b006bf75c29ebadced9]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ include/dahdi/kernel.h | 31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
+index ed81e9e3..35e93bc4 100644
+--- a/include/dahdi/kernel.h
++++ b/include/dahdi/kernel.h
+@@ -58,6 +58,37 @@
+ 
+ #include <linux/poll.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++#include <linux/pci.h>
++#include <linux/dma-mapping.h>
++
++static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
++{
++    return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC);
++}
++
++static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
++{
++    dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle);
++}
++
++static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
++{
++    return dma_map_single(&hwdev->dev, ptr, size, (enum dma_data_direction)direction);
++}
++
++static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction)
++{
++    dma_unmap_single(&hwdev->dev, dma_addr, size, (enum dma_data_direction)direction);
++}
++
++static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
++{
++    return dma_set_mask(&dev->dev, mask);
++}
++
++#endif
++
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+ #define HAVE_NET_DEVICE_OPS
+ #endif
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/dahdi-linux: fix build with kernel >= 5.18
  2022-10-30 12:55 [Buildroot] [PATCH 1/1] package/dahdi-linux: fix build with kernel >= 5.18 Fabrice Fontaine
@ 2022-10-30 14:03 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-30 14:03 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Yann E . MORIN, buildroot

On Sun, 30 Oct 2022 13:55:54 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure with kernel >= 5.18 raised since bump to
> version 3.2.0 in commit 6cbfed0dbf43c5e04e3cc543b642e3c996bfed97:
> 
> /home/autobuild/autobuild/instance-0/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wct4xxp/base.c: In function ‘t4_allocate_buffers’:
> /home/autobuild/autobuild/instance-0/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wct4xxp/base.c:3864:17: error: implicit declaration of function ‘pci_alloc_consistent’ [-Werror=implicit-function-declaration]
>  3864 |         alloc = pci_alloc_consistent(wc->dev, numbufs * T4_BASE_SIZE(wc) * 2,
>       |                 ^~~~~~~~~~~~~~~~~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/ddacd807dddeb1649e957264ac57bba27d9bb463
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...lation-issues-on-linux-kernel-5-18-0.patch | 58 +++++++++++++++++++
>  1 file changed, 58 insertions(+)
>  create mode 100644 package/dahdi-linux/0003-Fixed-compilation-issues-on-linux-kernel-5-18-0.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-30 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-30 12:55 [Buildroot] [PATCH 1/1] package/dahdi-linux: fix build with kernel >= 5.18 Fabrice Fontaine
2022-10-30 14:03 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.