030-PCI-dwc-skip-MSI-init-if-MSIs-have-been-explicitly-d.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 26a3cdb73644090ff9a2fb68775ef61d361a8883 Mon Sep 17 00:00:00 2001
  2. From: Lucas Stach <[email protected]>
  3. Date: Wed, 27 Feb 2019 17:52:19 +0100
  4. Subject: [PATCH] PCI: dwc: skip MSI init if MSIs have been explicitly disabled
  5. commit 3afc8299f39a27b60e1519a28e18878ce878e7dd upstream.
  6. Since 7c5925afbc58 (PCI: dwc: Move MSI IRQs allocation to IRQ domains
  7. hierarchical API) the MSI init claims one of the controller IRQs as a
  8. chained IRQ line for the MSI controller. On some designs, like the i.MX6,
  9. this line is shared with a PCIe legacy IRQ. When the line is claimed for
  10. the MSI domain, any device trying to use this legacy IRQs will fail to
  11. request this IRQ line.
  12. As MSI and legacy IRQs are already mutually exclusive on the DWC core,
  13. as the core won't forward any legacy IRQs once any MSI has been enabled,
  14. users wishing to use legacy IRQs already need to explictly disable MSI
  15. support (usually via the pci=nomsi kernel commandline option). To avoid
  16. any issues with MSI conflicting with legacy IRQs, just skip all of the
  17. DWC MSI initalization, including the IRQ line claim, when MSI is disabled.
  18. Fixes: 7c5925afbc58 ("PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API")
  19. Tested-by: Tim Harvey <[email protected]>
  20. Signed-off-by: Lucas Stach <[email protected]>
  21. Signed-off-by: Lorenzo Pieralisi <[email protected]>
  22. Acked-by: Gustavo Pimentel <[email protected]>
  23. Cc: [email protected]
  24. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  25. ---
  26. drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
  27. 1 file changed, 1 insertion(+), 1 deletion(-)
  28. diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
  29. index 0fa9e8fdce66..b56e22262a77 100644
  30. --- a/drivers/pci/controller/dwc/pcie-designware-host.c
  31. +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
  32. @@ -439,7 +439,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
  33. if (ret)
  34. pci->num_viewport = 2;
  35. - if (IS_ENABLED(CONFIG_PCI_MSI)) {
  36. + if (IS_ENABLED(CONFIG_PCI_MSI) && pci_msi_enabled()) {
  37. /*
  38. * If a specific SoC driver needs to change the
  39. * default number of vectors, it needs to implement
  40. --
  41. 2.17.1