* [[PATCH] ] linux/igb_uio: fix build with Linux 5.18
@ 2023-01-30 7:27 jiangheng (G)
2023-02-05 17:34 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: jiangheng (G) @ 2023-01-30 7:27 UTC (permalink / raw)
To: dev
Since commit 7968778914 (PCI: Remove the deprecated "pci-dma-compat.h" API)
in 5.18, pci_set_dma_mask() and pci_set_consistent_dma_mask() no longer exist
switch those api to dma_set_mask_and_coherent.
---
linux/igb_uio/igb_uio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index 33e0e02..3672314 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -512,13 +512,21 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
goto fail_release_iomem;
/* set 64-bit DMA mask */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
err = pci_set_dma_mask(dev, DMA_BIT_MASK(64));
+#else
+ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+#endif
if (err != 0) {
dev_err(&dev->dev, "Cannot set DMA mask\n");
goto fail_release_iomem;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64));
+#else
+ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+#endif
if (err != 0) {
dev_err(&dev->dev, "Cannot set consistent DMA mask\n");
goto fail_release_iomem;
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [[PATCH] ] linux/igb_uio: fix build with Linux 5.18
2023-01-30 7:27 [[PATCH] ] linux/igb_uio: fix build with Linux 5.18 jiangheng (G)
@ 2023-02-05 17:34 ` Thomas Monjalon
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2023-02-05 17:34 UTC (permalink / raw)
To: jiangheng (G); +Cc: dev, ferruh.yigit
30/01/2023 08:27, jiangheng (G):
> Since commit 7968778914 (PCI: Remove the deprecated "pci-dma-compat.h" API)
> in 5.18, pci_set_dma_mask() and pci_set_consistent_dma_mask() no longer exist
> switch those api to dma_set_mask_and_coherent.
> ---
> linux/igb_uio/igb_uio.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
The patch from Ferruh looks simpler:
https://patches.dpdk.org/project/dpdk/patch/20221216115732.3552650-1-ferruh.yigit@amd.com/
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
> err = pci_set_dma_mask(dev, DMA_BIT_MASK(64));
> +#else
> + err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
> +#endif
[...]
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
> err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64));
> +#else
> + err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
> +#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-05 17:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 7:27 [[PATCH] ] linux/igb_uio: fix build with Linux 5.18 jiangheng (G)
2023-02-05 17:34 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).