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
commitd8fbde092e2f0b8ba11477016717b7effd467e22 (patch)
tree62d8a835d30987893644ffd116a6db881e81656b
parent942dc762cb759d45484f47e26321c353724c9f6f (diff)
PCI: dwc: Take lock when ACKing an interrupt (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-039-PCI-dwc-Take-lock-when-ACKing-an-interrupt.patch57
-rw-r--r--series.conf1
2 files changed, 58 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-039-PCI-dwc-Take-lock-when-ACKing-an-interrupt.patch b/patches.kernel.org/4.20.3-039-PCI-dwc-Take-lock-when-ACKing-an-interrupt.patch
new file mode 100644
index 0000000000..a630e26855
--- /dev/null
+++ b/patches.kernel.org/4.20.3-039-PCI-dwc-Take-lock-when-ACKing-an-interrupt.patch
@@ -0,0 +1,57 @@
+From: Marc Zyngier <marc.zyngier@arm.com>
+Date: Tue, 13 Nov 2018 22:57:33 +0000
+Subject: [PATCH] PCI: dwc: Take lock when ACKing an interrupt
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: fce5423e4f431c71933d6c1f850b540a314aa6ee
+
+commit fce5423e4f431c71933d6c1f850b540a314aa6ee upstream.
+
+Bizarrely, there is no lock taken in the irq_ack() helper. This
+puts the ACK callback provided by a specific platform in a awkward
+situation where there is no synchronization that would be expected
+on other callback.
+
+Introduce the required lock, giving some level of uniformity among
+callbacks.
+
+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>
+---
+ drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
+index 0f81b7169147..610a5e018d27 100644
+--- a/drivers/pci/controller/dwc/pcie-designware-host.c
++++ b/drivers/pci/controller/dwc/pcie-designware-host.c
+@@ -202,11 +202,16 @@ static void dw_pci_bottom_ack(struct irq_data *d)
+ {
+ struct msi_desc *msi = irq_data_get_msi_desc(d);
+ struct pcie_port *pp;
++ unsigned long flags;
+
+ pp = msi_desc_to_pci_sysdata(msi);
+
++ raw_spin_lock_irqsave(&pp->lock, flags);
++
+ if (pp->ops->msi_irq_ack)
+ pp->ops->msi_irq_ack(d->hwirq, pp);
++
++ raw_spin_unlock_irqrestore(&pp->lock, flags);
+ }
+
+ static struct irq_chip dw_pci_msi_bottom_irq_chip = {
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index fcde43e453..22bee7e4d7 100644
--- a/series.conf
+++ b/series.conf
@@ -276,6 +276,7 @@
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
+ patches.kernel.org/4.20.3-039-PCI-dwc-Take-lock-when-ACKing-an-interrupt.patch
########################################################
# Build fixes that apply to the vanilla kernel too.