Skip to content

Commit

Permalink
PCI: dwc: Take lock when ACKing an interrupt
Browse files Browse the repository at this point in the history
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: 7c5925a ("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
  • Loading branch information
Marc Zyngier authored and Lorenzo Pieralisi committed Dec 11, 2018
1 parent 830920e commit fce5423
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/pci/controller/dwc/pcie-designware-host.c
Expand Up @@ -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 = {
Expand Down

0 comments on commit fce5423

Please sign in to comment.