linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: dwc: skip MSI init if MSIs have been explicitly disabled
@ 2019-02-27 16:52 Lucas Stach
  2019-02-27 17:25 ` Fabio Estevam
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Lucas Stach @ 2019-02-27 16:52 UTC (permalink / raw)
  To: Jingoo Han, Gustavo Pimentel, Lorenzo Pieralisi
  Cc: Bjorn Helgaas, linux-pci, Tim Harvey, kernel, patchwork-lst

Since 7c5925afbc58 (PCI: dwc: Move MSI IRQs allocation to IRQ domains
hierarchical API) the MSI init claims one of the controller IRQs as a
chained IRQ line for the MSI controller. On some designs, like the i.MX6,
this line is shared with a PCIe legacy IRQ. When the line is claimed for
the MSI domain, any device trying to use this legacy IRQs will fail to
request this IRQ line.

As MSI and legacy IRQs are already mutually exclusive on the DWC core,
as the core won't forward any legacy IRQs once any MSI has been enabled,
users wishing to use legacy IRQs already need to explictly disable MSI
support (usually via the pci=nomsi kernel commandline option). To avoid
any issues with MSI conflicting with legacy IRQs, just skip all of the
DWC MSI initalization, including the IRQ line claim, when MSI is disabled.

Fixes: c5925afbc58
       (PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Tim Harvey <tharvey@gateworks.com>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 29a05759a294..f4a8494f616b 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -433,7 +433,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
 	if (ret)
 		pci->num_viewport = 2;
 
-	if (IS_ENABLED(CONFIG_PCI_MSI)) {
+	if (IS_ENABLED(CONFIG_PCI_MSI) && pci_msi_enabled()) {
 		/*
 		 * If a specific SoC driver needs to change the
 		 * default number of vectors, it needs to implement
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-04-15 14:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27 16:52 [PATCH] PCI: dwc: skip MSI init if MSIs have been explicitly disabled Lucas Stach
2019-02-27 17:25 ` Fabio Estevam
2019-02-27 17:43   ` Tim Harvey
2019-02-28 13:29 ` Lorenzo Pieralisi
2019-03-01 10:10   ` Gustavo Pimentel
2019-03-01 12:29 ` Lorenzo Pieralisi
2019-03-04 19:25 ` Bjorn Helgaas
2019-03-04 19:39   ` Lucas Stach
2019-03-04 20:18     ` Marc Zyngier
2019-03-06  9:53       ` Gustavo Pimentel
2019-03-06 11:39         ` Lucas Stach
2019-03-06 15:59       ` Tim Harvey
2019-04-15 14:34       ` Gustavo Pimentel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).