cxl/pci: Allocate irq vectors earlier during probe
authorDavidlohr Bueso <dave@stgolabs.net>
Tue, 23 May 2023 17:09:25 +0000 (10:09 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 23 May 2023 19:55:12 +0000 (12:55 -0700)
Move the cxl_alloc_irq_vectors() call further up in the probing
in order to allow for mailbox interrupt usage. No change in
semantics.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://lore.kernel.org/r/20230523170927.20685-3-dave@stgolabs.net
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/pci.c

index 0872f2233ed0c88aa9fec7e9e93935dfa1f0e740..f2039fe0805d8658e3989d6ca0c423dadc557438 100644 (file)
@@ -714,6 +714,10 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        else
                dev_warn(&pdev->dev, "Media not active (%d)\n", rc);
 
+       rc = cxl_alloc_irq_vectors(pdev);
+       if (rc)
+               return rc;
+
        rc = cxl_pci_setup_mailbox(cxlds);
        if (rc)
                return rc;
@@ -738,10 +742,6 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        if (rc)
                return rc;
 
-       rc = cxl_alloc_irq_vectors(pdev);
-       if (rc)
-               return rc;
-
        cxlmd = devm_cxl_add_memdev(cxlds);
        if (IS_ERR(cxlmd))
                return PTR_ERR(cxlmd);