diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/host/pci-keystone.c | 4 | ||||
-rw-r--r-- | drivers/pci/host/pci-layerscape.c | 1 | ||||
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 15 | ||||
-rw-r--r-- | drivers/pci/host/pci-tegra.c | 13 | ||||
-rw-r--r-- | drivers/pci/host/pci-xgene.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-designware.c | 3 | ||||
-rw-r--r-- | drivers/pci/host/pcie-rcar.c | 7 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 3 | ||||
-rw-r--r-- | drivers/pci/pci.c | 49 |
9 files changed, 57 insertions, 40 deletions
diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index 78f79e31ac5c..75333b0c4f0a 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c | |||
@@ -119,7 +119,7 @@ static void ks_pcie_msi_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
119 | struct pcie_port *pp = &ks_pcie->pp; | 119 | struct pcie_port *pp = &ks_pcie->pp; |
120 | struct irq_chip *chip = irq_desc_get_chip(desc); | 120 | struct irq_chip *chip = irq_desc_get_chip(desc); |
121 | 121 | ||
122 | dev_dbg(pp->dev, "ks_pci_msi_irq_handler, irq %d\n", irq); | 122 | dev_dbg(pp->dev, "%s, irq %d\n", __func__, irq); |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * The chained irq handler installation would have replaced normal | 125 | * The chained irq handler installation would have replaced normal |
@@ -197,7 +197,7 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie, | |||
197 | */ | 197 | */ |
198 | for (temp = 0; temp < max_host_irqs; temp++) { | 198 | for (temp = 0; temp < max_host_irqs; temp++) { |
199 | host_irqs[temp] = irq_of_parse_and_map(*np_temp, temp); | 199 | host_irqs[temp] = irq_of_parse_and_map(*np_temp, temp); |
200 | if (host_irqs[temp] < 0) | 200 | if (!host_irqs[temp]) |
201 | break; | 201 | break; |
202 | } | 202 | } |
203 | if (temp) { | 203 | if (temp) { |
diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c index 6697b1a4d4fa..68c9e5e9b0a8 100644 --- a/drivers/pci/host/pci-layerscape.c +++ b/drivers/pci/host/pci-layerscape.c | |||
@@ -167,7 +167,6 @@ MODULE_DEVICE_TABLE(of, ls_pcie_of_match); | |||
167 | static struct platform_driver ls_pcie_driver = { | 167 | static struct platform_driver ls_pcie_driver = { |
168 | .driver = { | 168 | .driver = { |
169 | .name = "layerscape-pcie", | 169 | .name = "layerscape-pcie", |
170 | .owner = THIS_MODULE, | ||
171 | .of_match_table = ls_pcie_of_match, | 170 | .of_match_table = ls_pcie_of_match, |
172 | }, | 171 | }, |
173 | }; | 172 | }; |
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 1dd759596b0a..1309cfbaa719 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c | |||
@@ -101,9 +101,7 @@ struct mvebu_pcie { | |||
101 | struct mvebu_pcie_port *ports; | 101 | struct mvebu_pcie_port *ports; |
102 | struct msi_controller *msi; | 102 | struct msi_controller *msi; |
103 | struct resource io; | 103 | struct resource io; |
104 | char io_name[30]; | ||
105 | struct resource realio; | 104 | struct resource realio; |
106 | char mem_name[30]; | ||
107 | struct resource mem; | 105 | struct resource mem; |
108 | struct resource busn; | 106 | struct resource busn; |
109 | int nports; | 107 | int nports; |
@@ -723,18 +721,9 @@ static int mvebu_pcie_setup(int nr, struct pci_sys_data *sys) | |||
723 | { | 721 | { |
724 | struct mvebu_pcie *pcie = sys_to_pcie(sys); | 722 | struct mvebu_pcie *pcie = sys_to_pcie(sys); |
725 | int i; | 723 | int i; |
726 | int domain = 0; | ||
727 | 724 | ||
728 | #ifdef CONFIG_PCI_DOMAINS | 725 | pcie->mem.name = "PCI MEM"; |
729 | domain = sys->domain; | 726 | pcie->realio.name = "PCI I/O"; |
730 | #endif | ||
731 | |||
732 | snprintf(pcie->mem_name, sizeof(pcie->mem_name), "PCI MEM %04x", | ||
733 | domain); | ||
734 | pcie->mem.name = pcie->mem_name; | ||
735 | |||
736 | snprintf(pcie->io_name, sizeof(pcie->io_name), "PCI I/O %04x", domain); | ||
737 | pcie->realio.name = pcie->io_name; | ||
738 | 727 | ||
739 | if (request_resource(&iomem_resource, &pcie->mem)) | 728 | if (request_resource(&iomem_resource, &pcie->mem)) |
740 | return 0; | 729 | return 0; |
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index a800ae916394..6f9c29fa70e7 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c | |||
@@ -625,19 +625,6 @@ static void tegra_pcie_port_free(struct tegra_pcie_port *port) | |||
625 | devm_kfree(pcie->dev, port); | 625 | devm_kfree(pcie->dev, port); |
626 | } | 626 | } |
627 | 627 | ||
628 | static void tegra_pcie_fixup_bridge(struct pci_dev *dev) | ||
629 | { | ||
630 | u16 reg; | ||
631 | |||
632 | if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE) { | ||
633 | pci_read_config_word(dev, PCI_COMMAND, ®); | ||
634 | reg |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | | ||
635 | PCI_COMMAND_MASTER | PCI_COMMAND_SERR); | ||
636 | pci_write_config_word(dev, PCI_COMMAND, reg); | ||
637 | } | ||
638 | } | ||
639 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_fixup_bridge); | ||
640 | |||
641 | /* Tegra PCIE root complex wrongly reports device class */ | 628 | /* Tegra PCIE root complex wrongly reports device class */ |
642 | static void tegra_pcie_fixup_class(struct pci_dev *dev) | 629 | static void tegra_pcie_fixup_class(struct pci_dev *dev) |
643 | { | 630 | { |
diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c index b1d0596457c5..fdb348d3ccd3 100644 --- a/drivers/pci/host/pci-xgene.c +++ b/drivers/pci/host/pci-xgene.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | #include <linux/clk-private.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/jiffies.h> | 22 | #include <linux/jiffies.h> |
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index df781cdf13c1..eef311115899 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c | |||
@@ -508,9 +508,6 @@ int __init dw_pcie_host_init(struct pcie_port *pp) | |||
508 | dw_pci.private_data = (void **)&pp; | 508 | dw_pci.private_data = (void **)&pp; |
509 | 509 | ||
510 | pci_common_init_dev(pp->dev, &dw_pci); | 510 | pci_common_init_dev(pp->dev, &dw_pci); |
511 | #ifdef CONFIG_PCI_DOMAINS | ||
512 | dw_pci.domain++; | ||
513 | #endif | ||
514 | 511 | ||
515 | return 0; | 512 | return 0; |
516 | } | 513 | } |
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 748786c402fc..c57bd0ac39a0 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c | |||
@@ -397,9 +397,6 @@ static void rcar_pcie_enable(struct rcar_pcie *pcie) | |||
397 | #endif | 397 | #endif |
398 | 398 | ||
399 | pci_common_init_dev(&pdev->dev, &rcar_pci); | 399 | pci_common_init_dev(&pdev->dev, &rcar_pci); |
400 | #ifdef CONFIG_PCI_DOMAINS | ||
401 | rcar_pci.domain++; | ||
402 | #endif | ||
403 | } | 400 | } |
404 | 401 | ||
405 | static int phy_wait_for_ack(struct rcar_pcie *pcie) | 402 | static int phy_wait_for_ack(struct rcar_pcie *pcie) |
@@ -757,7 +754,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev, | |||
757 | goto err_map_reg; | 754 | goto err_map_reg; |
758 | 755 | ||
759 | i = irq_of_parse_and_map(pdev->dev.of_node, 0); | 756 | i = irq_of_parse_and_map(pdev->dev.of_node, 0); |
760 | if (i < 0) { | 757 | if (!i) { |
761 | dev_err(pcie->dev, "cannot get platform resources for msi interrupt\n"); | 758 | dev_err(pcie->dev, "cannot get platform resources for msi interrupt\n"); |
762 | err = -ENOENT; | 759 | err = -ENOENT; |
763 | goto err_map_reg; | 760 | goto err_map_reg; |
@@ -765,7 +762,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev, | |||
765 | pcie->msi.irq1 = i; | 762 | pcie->msi.irq1 = i; |
766 | 763 | ||
767 | i = irq_of_parse_and_map(pdev->dev.of_node, 1); | 764 | i = irq_of_parse_and_map(pdev->dev.of_node, 1); |
768 | if (i < 0) { | 765 | if (!i) { |
769 | dev_err(pcie->dev, "cannot get platform resources for msi interrupt\n"); | 766 | dev_err(pcie->dev, "cannot get platform resources for msi interrupt\n"); |
770 | err = -ENOENT; | 767 | err = -ENOENT; |
771 | goto err_map_reg; | 768 | goto err_map_reg; |
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index a5a7fd8332ac..46db29395a62 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c | |||
@@ -214,8 +214,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot) | |||
214 | 214 | ||
215 | kfree(slot->hotplug_slot->info); | 215 | kfree(slot->hotplug_slot->info); |
216 | kfree(slot->hotplug_slot); | 216 | kfree(slot->hotplug_slot); |
217 | if (slot->dev) | 217 | pci_dev_put(slot->dev); |
218 | pci_dev_put(slot->dev); | ||
219 | kfree(slot); | 218 | kfree(slot); |
220 | } | 219 | } |
221 | 220 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index cab05f31223f..c419554d0b4b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/of.h> | ||
14 | #include <linux/of_pci.h> | ||
13 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
14 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
15 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
@@ -4439,6 +4441,53 @@ int pci_get_new_domain_nr(void) | |||
4439 | { | 4441 | { |
4440 | return atomic_inc_return(&__domain_nr); | 4442 | return atomic_inc_return(&__domain_nr); |
4441 | } | 4443 | } |
4444 | |||
4445 | #ifdef CONFIG_PCI_DOMAINS_GENERIC | ||
4446 | void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) | ||
4447 | { | ||
4448 | static int use_dt_domains = -1; | ||
4449 | int domain = of_get_pci_domain_nr(parent->of_node); | ||
4450 | |||
4451 | /* | ||
4452 | * Check DT domain and use_dt_domains values. | ||
4453 | * | ||
4454 | * If DT domain property is valid (domain >= 0) and | ||
4455 | * use_dt_domains != 0, the DT assignment is valid since this means | ||
4456 | * we have not previously allocated a domain number by using | ||
4457 | * pci_get_new_domain_nr(); we should also update use_dt_domains to | ||
4458 | * 1, to indicate that we have just assigned a domain number from | ||
4459 | * DT. | ||
4460 | * | ||
4461 | * If DT domain property value is not valid (ie domain < 0), and we | ||
4462 | * have not previously assigned a domain number from DT | ||
4463 | * (use_dt_domains != 1) we should assign a domain number by | ||
4464 | * using the: | ||
4465 | * | ||
4466 | * pci_get_new_domain_nr() | ||
4467 | * | ||
4468 | * API and update the use_dt_domains value to keep track of method we | ||
4469 | * are using to assign domain numbers (use_dt_domains = 0). | ||
4470 | * | ||
4471 | * All other combinations imply we have a platform that is trying | ||
4472 | * to mix domain numbers obtained from DT and pci_get_new_domain_nr(), | ||
4473 | * which is a recipe for domain mishandling and it is prevented by | ||
4474 | * invalidating the domain value (domain = -1) and printing a | ||
4475 | * corresponding error. | ||
4476 | */ | ||
4477 | if (domain >= 0 && use_dt_domains) { | ||
4478 | use_dt_domains = 1; | ||
4479 | } else if (domain < 0 && use_dt_domains != 1) { | ||
4480 | use_dt_domains = 0; | ||
4481 | domain = pci_get_new_domain_nr(); | ||
4482 | } else { | ||
4483 | dev_err(parent, "Node %s has inconsistent \"linux,pci-domain\" property in DT\n", | ||
4484 | parent->of_node->full_name); | ||
4485 | domain = -1; | ||
4486 | } | ||
4487 | |||
4488 | bus->domain_nr = domain; | ||
4489 | } | ||
4490 | #endif | ||
4442 | #endif | 4491 | #endif |
4443 | 4492 | ||
4444 | /** | 4493 | /** |