Skip to content

Commit

Permalink
Merge tag 'pci-v4.11-fixes-4' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:

 - fix ThunderX legacy firmware resources

 - fix ARTPEC-6 and DesignWare platform driver NULL pointer dereferences

 - fix HiSilicon link error

* tag 'pci-v4.11-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: dwc: Fix dw_pcie_ops NULL pointer dereference
  PCI: dwc: Select PCI_HOST_COMMON for hisi
  PCI: thunder-pem: Fix legacy firmware PEM-specific resources
  • Loading branch information
torvalds committed Apr 7, 2017
2 parents 81d4bab + 794a860 commit c2eb7be
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/pci/dwc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ config PCI_HISI
depends on PCI_MSI_IRQ_DOMAIN
select PCIEPORTBUS
select PCIE_DW_HOST
select PCI_HOST_COMMON
help
Say Y here if you want PCIe controller support on HiSilicon
Hip05 and Hip06 SoCs
Expand Down
4 changes: 4 additions & 0 deletions drivers/pci/dwc/pcie-artpec6.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie,
return 0;
}

static const struct dw_pcie_ops dw_pcie_ops = {
};

static int artpec6_pcie_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand All @@ -252,6 +255,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
return -ENOMEM;

pci->dev = dev;
pci->ops = &dw_pcie_ops;

artpec6_pcie->pci = pci;

Expand Down
4 changes: 4 additions & 0 deletions drivers/pci/dwc/pcie-designware-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ static int dw_plat_add_pcie_port(struct pcie_port *pp,
return 0;
}

static const struct dw_pcie_ops dw_pcie_ops = {
};

static int dw_plat_pcie_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand All @@ -103,6 +106,7 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
return -ENOMEM;

pci->dev = dev;
pci->ops = &dw_pcie_ops;

dw_plat_pcie->pci = pci;

Expand Down
10 changes: 8 additions & 2 deletions drivers/pci/host/pci-thunder-pem.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
index -= node * PEM_MAX_DOM_IN_NODE;
res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
FIELD_PREP(PEM_INDX_MASK, index);
res_pem->end = res_pem->start + SZ_16M - 1;
res_pem->flags = IORESOURCE_MEM;
}

Expand All @@ -399,8 +398,15 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg)
*/
if (ret) {
thunder_pem_legacy_fw(root, res_pem);
/* Reserve PEM-specific resources and PCI configuration space */
/*
* Reserve 64K size PEM specific resources. The full 16M range
* size is required for thunder_pem_init() call.
*/
res_pem->end = res_pem->start + SZ_64K - 1;
thunder_pem_reserve_range(dev, root->segment, res_pem);
res_pem->end = res_pem->start + SZ_16M - 1;

/* Reserve PCI configuration space as well. */
thunder_pem_reserve_range(dev, root->segment, &cfg->res);
}

Expand Down

0 comments on commit c2eb7be

Please sign in to comment.