diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2019-08-16 16:40:08 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2019-08-16 16:40:08 +0200 |
commit | 3758b8bd81966b63dc93093a323e9bdd734545fd (patch) | |
tree | 229bda2abe1a31d59da4b48e71aeefde934fe1d0 /drivers/pci/controller/pcie-xilinx.c | |
parent | d15d0b7a9f89cf5a905ad6802eb23100c8063939 (diff) | |
parent | dd209b062b86dd951cf1da93f20aa497fe99d52d (diff) |
Merge tag 'v4.19.59-rt24' into toradex_4.19.y-rttoradex_4.19.y-rt
Linux 4.19.59-rt24
Diffstat (limited to 'drivers/pci/controller/pcie-xilinx.c')
-rw-r--r-- | drivers/pci/controller/pcie-xilinx.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c index 7b1389d8e2a5..ea48cba5480b 100644 --- a/drivers/pci/controller/pcie-xilinx.c +++ b/drivers/pci/controller/pcie-xilinx.c @@ -336,14 +336,19 @@ static const struct irq_domain_ops msi_domain_ops = { * xilinx_pcie_enable_msi - Enable MSI support * @port: PCIe port information */ -static void xilinx_pcie_enable_msi(struct xilinx_pcie_port *port) +static int xilinx_pcie_enable_msi(struct xilinx_pcie_port *port) { phys_addr_t msg_addr; port->msi_pages = __get_free_pages(GFP_KERNEL, 0); + if (!port->msi_pages) + return -ENOMEM; + msg_addr = virt_to_phys((void *)port->msi_pages); pcie_write(port, 0x0, XILINX_PCIE_REG_MSIBASE1); pcie_write(port, msg_addr, XILINX_PCIE_REG_MSIBASE2); + + return 0; } /* INTx Functions */ @@ -498,6 +503,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port) struct device *dev = port->dev; struct device_node *node = dev->of_node; struct device_node *pcie_intc_node; + int ret; /* Setup INTx */ pcie_intc_node = of_get_next_child(node, NULL); @@ -526,7 +532,9 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port) return -ENODEV; } - xilinx_pcie_enable_msi(port); + ret = xilinx_pcie_enable_msi(port); + if (ret) + return ret; } return 0; |