Code Monkey home page Code Monkey logo

Comments (6)

chemeris avatar chemeris commented on August 15, 2024

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/

from xtrx_linux_pcie_drv.

smunaut avatar smunaut commented on August 15, 2024

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.

from xtrx_linux_pcie_drv.

smunaut avatar smunaut commented on August 15, 2024

Seems to work fine, feel free to apply :)

from xtrx_linux_pcie_drv.

smunaut avatar smunaut commented on August 15, 2024
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;
 

from xtrx_linux_pcie_drv.

chemeris avatar chemeris commented on August 15, 2024

Nice, thank you!

from xtrx_linux_pcie_drv.

sergforce avatar sergforce commented on August 15, 2024

Merged

from xtrx_linux_pcie_drv.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.