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:39 +0100
commitcab31cf186c850d95956f413e2e49430f5ba0c32 (patch)
tree2e66d6111e5925e2e23ce3ab2af1cbf657303517
parentd8fbde092e2f0b8ba11477016717b7effd467e22 (diff)
PCI: dwc: Move interrupt acking into the proper callback
-rw-r--r--patches.kernel.org/4.20.3-040-PCI-dwc-Move-interrupt-acking-into-the-proper-.patch72
-rw-r--r--series.conf1
2 files changed, 73 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-040-PCI-dwc-Move-interrupt-acking-into-the-proper-.patch b/patches.kernel.org/4.20.3-040-PCI-dwc-Move-interrupt-acking-into-the-proper-.patch
new file mode 100644
index 0000000000..a6c2e855d1
--- /dev/null
+++ b/patches.kernel.org/4.20.3-040-PCI-dwc-Move-interrupt-acking-into-the-proper-.patch
@@ -0,0 +1,72 @@
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Tue, 13 Nov 2018 22:57:34 +0000
+Subject: [PATCH] PCI: dwc: Move interrupt acking into the proper callback
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: 3f7bb2ec20ce07c02b2002349d256c91a463fcc5
+
+commit 3f7bb2ec20ce07c02b2002349d256c91a463fcc5 upstream.
+
+The write to the status register is really an ACK for the HW,
+and should be treated as such by the driver. Let's move it to the
+irq_ack() callback, which will prevent people from moving it around
+in order to paper over other bugs.
+
+Fixes: 8c934095fa2f ("PCI: dwc: Clear MSI interrupt status after it is handled,
+not before")
+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/
+Reported-by: Trent Piepho <tpiepho@impinj.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>
+---
+ drivers/pci/controller/dwc/pcie-designware-host.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
+index 610a5e018d27..0fa9e8fdce66 100644
+--- a/drivers/pci/controller/dwc/pcie-designware-host.c
++++ b/drivers/pci/controller/dwc/pcie-designware-host.c
+@@ -99,9 +99,6 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)
+ (i * MAX_MSI_IRQS_PER_CTRL) +
+ pos);
+ generic_handle_irq(irq);
+- dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS +
+- (i * MSI_REG_CTRL_BLOCK_SIZE),
+- 4, 1 << pos);
+ pos++;
+ }
+ }
+@@ -200,14 +197,18 @@ static void dw_pci_bottom_unmask(struct irq_data *data)
+
+ static void dw_pci_bottom_ack(struct irq_data *d)
+ {
+- struct msi_desc *msi = irq_data_get_msi_desc(d);
+- struct pcie_port *pp;
++ struct pcie_port *pp = irq_data_get_irq_chip_data(d);
++ unsigned int res, bit, ctrl;
+ unsigned long flags;
+
+- pp = msi_desc_to_pci_sysdata(msi);
++ ctrl = d->hwirq / MAX_MSI_IRQS_PER_CTRL;
++ res = ctrl * MSI_REG_CTRL_BLOCK_SIZE;
++ bit = d->hwirq % MAX_MSI_IRQS_PER_CTRL;
+
+ raw_spin_lock_irqsave(&pp->lock, flags);
+
++ dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + res, 4, 1 << bit);
++
+ if (pp->ops->msi_irq_ack)
+ pp->ops->msi_irq_ack(d->hwirq, pp);
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 22bee7e4d7..21b96073f2 100644
--- a/series.conf
+++ b/series.conf
@@ -277,6 +277,7 @@
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
patches.kernel.org/4.20.3-039-PCI-dwc-Take-lock-when-ACKing-an-interrupt.patch
+ patches.kernel.org/4.20.3-040-PCI-dwc-Move-interrupt-acking-into-the-proper-.patch
########################################################
# Build fixes that apply to the vanilla kernel too.