]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: dwc: Remove default MSI initialization for platform specific MSI chips
authorKishon Vijay Abraham I <kishon@ti.com>
Thu, 21 Mar 2019 09:59:27 +0000 (15:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:53:03 +0000 (11:53 +0200)
[ Upstream commit fd8a44bd5b76dc77133f814dd63d414d49dc74c0 ]

Platforms which populate msi_host_init() have their own MSI controller
logic. Writing to MSI control registers on platforms which do not use
Designware's MSI controller logic might have side effects.

To be safe, do not write to MSI control registers if the platform uses
its own MSI controller logic instead of Designware's MSI one.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pcie-designware-host.c

index 9d22b19b76f2ddb63ea6d63b003fe0dbc5562ced..214e883aa0a17d7ceeead12de4fd0868fc29dcc1 100644 (file)
@@ -653,17 +653,19 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
 
        dw_pcie_setup(pci);
 
-       num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
-
-       /* Initialize IRQ Status array */
-       for (ctrl = 0; ctrl < num_ctrls; ctrl++) {
-               pp->irq_mask[ctrl] = ~0;
-               dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK +
-                                       (ctrl * MSI_REG_CTRL_BLOCK_SIZE),
-                                   4, pp->irq_mask[ctrl]);
-               dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE +
-                                       (ctrl * MSI_REG_CTRL_BLOCK_SIZE),
-                                   4, ~0);
+       if (!pp->ops->msi_host_init) {
+               num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
+
+               /* Initialize IRQ Status array */
+               for (ctrl = 0; ctrl < num_ctrls; ctrl++) {
+                       pp->irq_mask[ctrl] = ~0;
+                       dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK +
+                                           (ctrl * MSI_REG_CTRL_BLOCK_SIZE),
+                                           4, pp->irq_mask[ctrl]);
+                       dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE +
+                                           (ctrl * MSI_REG_CTRL_BLOCK_SIZE),
+                                           4, ~0);
+               }
        }
 
        /* Setup RC BARs */