Commit 5b4e5be1 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/controller/tegra'

- Export irq_domain_free_irqs() to allow PCI/MSI drivers that tear down
  MSI domains to be built as modules (Aaron Kling)

- Export tegra_cpuidle_pcie_irqs_in_use(), which disables Tegra CC6 while
  PCI IRQs are in use, so pci-tegra can be built as a module (Aaron Kling)

- Allow pci-tegra to be built as a module (Aaron Kling)

* pci/controller/tegra:
  PCI: tegra: Allow building as a module
  cpuidle: tegra: Export tegra_cpuidle_pcie_irqs_in_use()
  irqdomain: Export irq_domain_free_irqs()
parents 751776ff aac5ba6a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ void tegra_cpuidle_pcie_irqs_in_use(void)
	pr_info("disabling CC6 state, since PCIe IRQs are in use\n");
	tegra_cpuidle_disable_state(TEGRA_CC6);
}
EXPORT_SYMBOL_GPL(tegra_cpuidle_pcie_irqs_in_use);

static void tegra_cpuidle_setup_tegra114_c7_state(void)
{
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ config PCI_HYPERV_INTERFACE
	  driver.

config PCI_TEGRA
	bool "NVIDIA Tegra PCIe controller"
	tristate "NVIDIA Tegra PCIe controller"
	depends on ARCH_TEGRA || COMPILE_TEST
	depends on PCI_MSI
	select IRQ_MSI_LIB
+4 −31
Original line number Diff line number Diff line
@@ -2545,12 +2545,6 @@ static const struct seq_operations tegra_pcie_ports_sops = {

DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports);

static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie)
{
	debugfs_remove_recursive(pcie->debugfs);
	pcie->debugfs = NULL;
}

static void tegra_pcie_debugfs_init(struct tegra_pcie *pcie)
{
	pcie->debugfs = debugfs_create_dir("pcie", NULL);
@@ -2624,29 +2618,6 @@ static int tegra_pcie_probe(struct platform_device *pdev)
	return err;
}

static void tegra_pcie_remove(struct platform_device *pdev)
{
	struct tegra_pcie *pcie = platform_get_drvdata(pdev);
	struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
	struct tegra_pcie_port *port, *tmp;

	if (IS_ENABLED(CONFIG_DEBUG_FS))
		tegra_pcie_debugfs_exit(pcie);

	pci_stop_root_bus(host->bus);
	pci_remove_root_bus(host->bus);
	pm_runtime_put_sync(pcie->dev);
	pm_runtime_disable(pcie->dev);

	if (IS_ENABLED(CONFIG_PCI_MSI))
		tegra_pcie_msi_teardown(pcie);

	tegra_pcie_put_resources(pcie);

	list_for_each_entry_safe(port, tmp, &pcie->ports, list)
		tegra_pcie_port_free(port);
}

static int tegra_pcie_pm_suspend(struct device *dev)
{
	struct tegra_pcie *pcie = dev_get_drvdata(dev);
@@ -2750,6 +2721,8 @@ static struct platform_driver tegra_pcie_driver = {
		.pm = &tegra_pcie_pm_ops,
	},
	.probe = tegra_pcie_probe,
	.remove = tegra_pcie_remove,
};
module_platform_driver(tegra_pcie_driver);
builtin_platform_driver(tegra_pcie_driver);
MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
MODULE_DESCRIPTION("NVIDIA PCI host controller driver");
MODULE_LICENSE("GPL");
+1 −0
Original line number Diff line number Diff line
@@ -1901,6 +1901,7 @@ void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs)
	irq_domain_free_irq_data(virq, nr_irqs);
	irq_free_descs(virq, nr_irqs);
}
EXPORT_SYMBOL_GPL(irq_domain_free_irqs);

static void irq_domain_free_one_irq(struct irq_domain *domain, unsigned int virq)
{