Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:38 +0100
commit942dc762cb759d45484f47e26321c353724c9f6f (patch)
treeee3ea510237b866af13ffb504bde97069a55a3c1
parent885167852052bb4a876f7867978799c2804c5e08 (diff)
PCI: dwc: Use interrupt masking instead of disabling
-rw-r--r--patches.kernel.org/4.20.3-038-PCI-dwc-Use-interrupt-masking-instead-of-disab.patch81
-rw-r--r--series.conf1
2 files changed, 82 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-038-PCI-dwc-Use-interrupt-masking-instead-of-disab.patch b/patches.kernel.org/4.20.3-038-PCI-dwc-Use-interrupt-masking-instead-of-disab.patch
new file mode 100644
index 0000000000..5a57cbbb8f
--- /dev/null
+++ b/patches.kernel.org/4.20.3-038-PCI-dwc-Use-interrupt-masking-instead-of-disab.patch
@@ -0,0 +1,81 @@
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Tue, 13 Nov 2018 22:57:32 +0000
+Subject: [PATCH] PCI: dwc: Use interrupt masking instead of disabling
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: 830920e065e90db318a0da98bf13a02b641eae7f
+
+commit 830920e065e90db318a0da98bf13a02b641eae7f upstream.
+
+The dwc driver is showing an interesting level of brokeness, as it
+insists on using the enable/disable set of registers to mask/unmask
+MSIs, meaning that an MSIs being generated while the interrupt is in
+that "disabled" state will simply be lost.
+
+Let's move to the mask/unmask set of registers, which offers the
+expected semantics.
+
+Fixes: 7c5925afbc58 ("PCI: dwc: Move MSI IRQs allocation to IRQ domains
+hierarchical API")
+Link: https://lore.kernel.org/linux-pci/20181113225734.8026-1-marc.zyngier@arm.com/
+Tested-by: Niklas Cassel <niklas.cassel@linaro.org>
+Tested-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
+Tested-by: Stanimir Varbanov <svarbanov@mm-sol.com>
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+[lorenzo.pieralisi@arm.com: updated commit log]
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ .../pci/controller/dwc/pcie-designware-host.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
+index 29a05759a294..0f81b7169147 100644
+--- a/drivers/pci/controller/dwc/pcie-designware-host.c
++++ b/drivers/pci/controller/dwc/pcie-designware-host.c
+@@ -168,8 +168,8 @@ static void dw_pci_bottom_mask(struct irq_data *data)
+ bit = data->hwirq % MAX_MSI_IRQS_PER_CTRL;
+
+ pp->irq_status[ctrl] &= ~(1 << bit);
+- dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4,
+- pp->irq_status[ctrl]);
++ dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + res, 4,
++ ~pp->irq_status[ctrl]);
+ }
+
+ raw_spin_unlock_irqrestore(&pp->lock, flags);
+@@ -191,8 +191,8 @@ static void dw_pci_bottom_unmask(struct irq_data *data)
+ bit = data->hwirq % MAX_MSI_IRQS_PER_CTRL;
+
+ pp->irq_status[ctrl] |= 1 << bit;
+- dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4,
+- pp->irq_status[ctrl]);
++ dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + res, 4,
++ ~pp->irq_status[ctrl]);
+ }
+
+ raw_spin_unlock_irqrestore(&pp->lock, flags);
+@@ -658,10 +658,15 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
+ num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
+
+ /* Initialize IRQ Status array */
+- for (ctrl = 0; ctrl < num_ctrls; ctrl++)
+- dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE +
++ for (ctrl = 0; ctrl < num_ctrls; ctrl++) {
++ dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK +
+ (ctrl * MSI_REG_CTRL_BLOCK_SIZE),
+- 4, &pp->irq_status[ctrl]);
++ 4, ~0);
++ dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE +
++ (ctrl * MSI_REG_CTRL_BLOCK_SIZE),
++ 4, ~0);
++ pp->irq_status[ctrl] = 0;
++ }
+
+ /* Setup RC BARs */
+ dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, 0x00000004);
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 1507d6ca10..fcde43e453 100644
--- a/series.conf
+++ b/series.conf
@@ -275,6 +275,7 @@
patches.kernel.org/4.20.3-035-mtd-rawnand-qcom-fix-memory-corruption-that-ca.patch
patches.kernel.org/4.20.3-036-vfio-type1-Fix-unmap-overflow-off-by-one.patch
patches.kernel.org/4.20.3-037-drm-amdgpu-Add-new-VegaM-pci-id.patch
+ patches.kernel.org/4.20.3-038-PCI-dwc-Use-interrupt-masking-instead-of-disab.patch
########################################################
# Build fixes that apply to the vanilla kernel too.