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/tegra'

- Correct the devm_kcalloc() argument order (Alok Tiwari)

- When asserting PERST#, disable the controller instead of mistakenly
disabling the PLL twice (Nagarjuna Kristam)

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

- Rename 'root_bus' to 'root_port_bus' for clarity (Manivannan Sadhasivam)

* pci/controller/tegra:
PCI: tegra194: Rename 'root_bus' to 'root_port_bus' in tegra_pcie_downstream_dev_to_D0()
PCI: tegra: Convert struct tegra_msi mask_lock into raw spinlock
PCI: tegra194: Fix duplicate PLL disable in pex_ep_event_pex_rst_assert()
PCI: tegra: Fix devm_kcalloc() argument order for port->phys allocation

+22 -23
+8 -8
drivers/pci/controller/dwc/pcie-tegra194.c
··· 1284 1284 static void tegra_pcie_downstream_dev_to_D0(struct tegra_pcie_dw *pcie) 1285 1285 { 1286 1286 struct dw_pcie_rp *pp = &pcie->pci.pp; 1287 - struct pci_bus *child, *root_bus = NULL; 1287 + struct pci_bus *child, *root_port_bus = NULL; 1288 1288 struct pci_dev *pdev; 1289 1289 1290 1290 /* ··· 1297 1297 */ 1298 1298 1299 1299 list_for_each_entry(child, &pp->bridge->bus->children, node) { 1300 - /* Bring downstream devices to D0 if they are not already in */ 1301 1300 if (child->parent == pp->bridge->bus) { 1302 - root_bus = child; 1301 + root_port_bus = child; 1303 1302 break; 1304 1303 } 1305 1304 } 1306 1305 1307 - if (!root_bus) { 1308 - dev_err(pcie->dev, "Failed to find downstream devices\n"); 1306 + if (!root_port_bus) { 1307 + dev_err(pcie->dev, "Failed to find downstream bus of Root Port\n"); 1309 1308 return; 1310 1309 } 1311 1310 1312 - list_for_each_entry(pdev, &root_bus->devices, bus_list) { 1311 + /* Bring downstream devices to D0 if they are not already in */ 1312 + list_for_each_entry(pdev, &root_port_bus->devices, bus_list) { 1313 1313 if (PCI_SLOT(pdev->devfn) == 0) { 1314 1314 if (pci_set_power_state(pdev, PCI_D0)) 1315 1315 dev_err(pcie->dev, ··· 1736 1736 ret); 1737 1737 } 1738 1738 1739 - ret = tegra_pcie_bpmp_set_pll_state(pcie, false); 1739 + ret = tegra_pcie_bpmp_set_ctrl_state(pcie, false); 1740 1740 if (ret) 1741 - dev_err(pcie->dev, "Failed to turn off UPHY: %d\n", ret); 1741 + dev_err(pcie->dev, "Failed to disable controller: %d\n", ret); 1742 1742 1743 1743 pcie->ep_state = EP_STATE_DISABLED; 1744 1744 dev_dbg(pcie->dev, "Uninitialization of endpoint is completed\n");
+14 -15
drivers/pci/controller/pci-tegra.c
··· 14 14 */ 15 15 16 16 #include <linux/clk.h> 17 + #include <linux/cleanup.h> 17 18 #include <linux/debugfs.h> 18 19 #include <linux/delay.h> 19 20 #include <linux/export.h> ··· 271 270 DECLARE_BITMAP(used, INT_PCI_MSI_NR); 272 271 struct irq_domain *domain; 273 272 struct mutex map_lock; 274 - spinlock_t mask_lock; 273 + raw_spinlock_t mask_lock; 275 274 void *virt; 276 275 dma_addr_t phys; 277 276 int irq; ··· 1345 1344 unsigned int i; 1346 1345 int err; 1347 1346 1348 - port->phys = devm_kcalloc(dev, sizeof(phy), port->lanes, GFP_KERNEL); 1347 + port->phys = devm_kcalloc(dev, port->lanes, sizeof(phy), GFP_KERNEL); 1349 1348 if (!port->phys) 1350 1349 return -ENOMEM; 1351 1350 ··· 1582 1581 struct tegra_msi *msi = irq_data_get_irq_chip_data(d); 1583 1582 struct tegra_pcie *pcie = msi_to_pcie(msi); 1584 1583 unsigned int index = d->hwirq / 32; 1585 - unsigned long flags; 1586 1584 u32 value; 1587 1585 1588 - spin_lock_irqsave(&msi->mask_lock, flags); 1589 - value = afi_readl(pcie, AFI_MSI_EN_VEC(index)); 1590 - value &= ~BIT(d->hwirq % 32); 1591 - afi_writel(pcie, value, AFI_MSI_EN_VEC(index)); 1592 - spin_unlock_irqrestore(&msi->mask_lock, flags); 1586 + scoped_guard(raw_spinlock_irqsave, &msi->mask_lock) { 1587 + value = afi_readl(pcie, AFI_MSI_EN_VEC(index)); 1588 + value &= ~BIT(d->hwirq % 32); 1589 + afi_writel(pcie, value, AFI_MSI_EN_VEC(index)); 1590 + } 1593 1591 } 1594 1592 1595 1593 static void tegra_msi_irq_unmask(struct irq_data *d) ··· 1596 1596 struct tegra_msi *msi = irq_data_get_irq_chip_data(d); 1597 1597 struct tegra_pcie *pcie = msi_to_pcie(msi); 1598 1598 unsigned int index = d->hwirq / 32; 1599 - unsigned long flags; 1600 1599 u32 value; 1601 1600 1602 - spin_lock_irqsave(&msi->mask_lock, flags); 1603 - value = afi_readl(pcie, AFI_MSI_EN_VEC(index)); 1604 - value |= BIT(d->hwirq % 32); 1605 - afi_writel(pcie, value, AFI_MSI_EN_VEC(index)); 1606 - spin_unlock_irqrestore(&msi->mask_lock, flags); 1601 + scoped_guard(raw_spinlock_irqsave, &msi->mask_lock) { 1602 + value = afi_readl(pcie, AFI_MSI_EN_VEC(index)); 1603 + value |= BIT(d->hwirq % 32); 1604 + afi_writel(pcie, value, AFI_MSI_EN_VEC(index)); 1605 + } 1607 1606 } 1608 1607 1609 1608 static void tegra_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) ··· 1710 1711 int err; 1711 1712 1712 1713 mutex_init(&msi->map_lock); 1713 - spin_lock_init(&msi->mask_lock); 1714 + raw_spin_lock_init(&msi->mask_lock); 1714 1715 1715 1716 if (IS_ENABLED(CONFIG_PCI_MSI)) { 1716 1717 err = tegra_allocate_domains(msi);