Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'pci/controller/rcar-host'

- Pass the correct IRQ domain to generic_handle_domain_irq() to fix a
regression when converting to msi_create_parent_irq_domain() (Claudiu
Beznea)

- Drop the spinlock protecting the PMSR register; it's no longer required
since pci_lock already serializes accesses (Marek Vasut)

- Convert struct rcar_msi mask_lock to raw spinlock to avoid a lock nesting
error (Marek Vasut)

* pci/controller/rcar-host:
PCI: rcar-host: Convert struct rcar_msi mask_lock into raw spinlock
PCI: rcar-host: Drop PMSR spinlock
PCI: rcar-host: Pass proper IRQ domain to generic_handle_domain_irq()

+16 -26
+16 -26
drivers/pci/controller/pcie-rcar-host.c
··· 12 12 */ 13 13 14 14 #include <linux/bitops.h> 15 + #include <linux/cleanup.h> 15 16 #include <linux/clk.h> 16 17 #include <linux/clk-provider.h> 17 18 #include <linux/delay.h> ··· 39 38 DECLARE_BITMAP(used, INT_PCI_MSI_NR); 40 39 struct irq_domain *domain; 41 40 struct mutex map_lock; 42 - spinlock_t mask_lock; 41 + raw_spinlock_t mask_lock; 43 42 int irq1; 44 43 int irq2; 45 44 }; ··· 53 52 int (*phy_init_fn)(struct rcar_pcie_host *host); 54 53 }; 55 54 56 - static DEFINE_SPINLOCK(pmsr_lock); 57 - 58 55 static int rcar_pcie_wakeup(struct device *pcie_dev, void __iomem *pcie_base) 59 56 { 60 - unsigned long flags; 61 57 u32 pmsr, val; 62 58 int ret = 0; 63 59 64 - spin_lock_irqsave(&pmsr_lock, flags); 65 - 66 - if (!pcie_base || pm_runtime_suspended(pcie_dev)) { 67 - ret = -EINVAL; 68 - goto unlock_exit; 69 - } 60 + if (!pcie_base || pm_runtime_suspended(pcie_dev)) 61 + return -EINVAL; 70 62 71 63 pmsr = readl(pcie_base + PMSR); 72 64 ··· 81 87 writel(L1FAEG | PMEL1RX, pcie_base + PMSR); 82 88 } 83 89 84 - unlock_exit: 85 - spin_unlock_irqrestore(&pmsr_lock, flags); 86 90 return ret; 87 91 } 88 92 ··· 576 584 unsigned int index = find_first_bit(&reg, 32); 577 585 int ret; 578 586 579 - ret = generic_handle_domain_irq(msi->domain->parent, index); 587 + ret = generic_handle_domain_irq(msi->domain, index); 580 588 if (ret) { 581 589 /* Unknown MSI, just clear it */ 582 590 dev_dbg(dev, "unexpected MSI\n"); ··· 603 611 { 604 612 struct rcar_msi *msi = irq_data_get_irq_chip_data(d); 605 613 struct rcar_pcie *pcie = &msi_to_host(msi)->pcie; 606 - unsigned long flags; 607 614 u32 value; 608 615 609 - spin_lock_irqsave(&msi->mask_lock, flags); 610 - value = rcar_pci_read_reg(pcie, PCIEMSIIER); 611 - value &= ~BIT(d->hwirq); 612 - rcar_pci_write_reg(pcie, value, PCIEMSIIER); 613 - spin_unlock_irqrestore(&msi->mask_lock, flags); 616 + scoped_guard(raw_spinlock_irqsave, &msi->mask_lock) { 617 + value = rcar_pci_read_reg(pcie, PCIEMSIIER); 618 + value &= ~BIT(d->hwirq); 619 + rcar_pci_write_reg(pcie, value, PCIEMSIIER); 620 + } 614 621 } 615 622 616 623 static void rcar_msi_irq_unmask(struct irq_data *d) 617 624 { 618 625 struct rcar_msi *msi = irq_data_get_irq_chip_data(d); 619 626 struct rcar_pcie *pcie = &msi_to_host(msi)->pcie; 620 - unsigned long flags; 621 627 u32 value; 622 628 623 - spin_lock_irqsave(&msi->mask_lock, flags); 624 - value = rcar_pci_read_reg(pcie, PCIEMSIIER); 625 - value |= BIT(d->hwirq); 626 - rcar_pci_write_reg(pcie, value, PCIEMSIIER); 627 - spin_unlock_irqrestore(&msi->mask_lock, flags); 629 + scoped_guard(raw_spinlock_irqsave, &msi->mask_lock) { 630 + value = rcar_pci_read_reg(pcie, PCIEMSIIER); 631 + value |= BIT(d->hwirq); 632 + rcar_pci_write_reg(pcie, value, PCIEMSIIER); 633 + } 628 634 } 629 635 630 636 static void rcar_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) ··· 735 745 int err; 736 746 737 747 mutex_init(&msi->map_lock); 738 - spin_lock_init(&msi->mask_lock); 748 + raw_spin_lock_init(&msi->mask_lock); 739 749 740 750 err = of_address_to_resource(dev->of_node, 0, &res); 741 751 if (err)