Closed chemeris closed 6 years ago
Kernel patch with the change: https://patchwork.kernel.org/patch/9505893/ An example of how to migrate to the new API: https://patchwork.kernel.org/patch/9505891/
This is a patch attempt :
diff --git a/xtrx.c b/xtrx.c
index ba0ec9a..b09972c 100644
--- a/xtrx.c
+++ b/xtrx.c
@@ -1058,7 +1058,7 @@ static int xtrx_probe(struct pci_dev *pdev,
init_waitqueue_head(&xtrxdev->queue_other);
init_waitqueue_head(&xtrxdev->onepps_ctrl);
- err = pci_enable_msi_range(pdev, XTRX_MSI_COUNT, XTRX_MSI_COUNT);
+ err = pci_alloc_irq_vectors(pdev, XTRX_MSI_COUNT, XTRX_MSI_COUNT, PCI_IRQ_MSI);
if (err == XTRX_MSI_COUNT) {
xtrxdev->inttype = XTRX_MSI_4;
It builds fine, but until I actually verified it works I won't do a pull request.
Seems to work fine, feel free to apply :)
diff --git a/xtrx.c b/xtrx.c
index ba0ec9a..01215a2 100644
--- a/xtrx.c
+++ b/xtrx.c
@@ -38,6 +38,7 @@
#include <linux/device.h>
#include <linux/time.h>
#include <linux/pps_kernel.h>
+#include <linux/version.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/uaccess.h>
@@ -1058,7 +1059,11 @@ static int xtrx_probe(struct pci_dev *pdev,
init_waitqueue_head(&xtrxdev->queue_other);
init_waitqueue_head(&xtrxdev->onepps_ctrl);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,11,0)
err = pci_enable_msi_range(pdev, XTRX_MSI_COUNT, XTRX_MSI_COUNT);
+#else
+ err = pci_alloc_irq_vectors(pdev, XTRX_MSI_COUNT, XTRX_MSI_COUNT, PCI_IRQ_MSI);
+#endif
if (err == XTRX_MSI_COUNT) {
xtrxdev->inttype = XTRX_MSI_4;
Nice, thank you!
Merged
Build fails on Ubuntu 17.04 x64.
Output of the build: