Commit e2557a2c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pci-v5.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:

 - Fix ACS regression that broke device pass-through (Rajat Jain)

 - Revert DesignWare ATU memory resource to use last entry to fix
   Tegra194 regression (Rob Herring)

 - Remove duplicate mvebu resource requests to fix regression on Turris
   Omnia (Rob Herring)

* tag 'pci-v5.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: mvebu: Fix duplicate resource requests
  PCI: dwc: Restore ATU memory resource setup to use last entry
  PCI: Always enable ACS even if no ACS Capability
parents 4ef8451b 832ea234
...@@ -586,8 +586,12 @@ void dw_pcie_setup_rc(struct pcie_port *pp) ...@@ -586,8 +586,12 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
* ATU, so we should not program the ATU here. * ATU, so we should not program the ATU here.
*/ */
if (pp->bridge->child_ops == &dw_child_pcie_ops) { if (pp->bridge->child_ops == &dw_child_pcie_ops) {
struct resource_entry *entry = struct resource_entry *tmp, *entry = NULL;
resource_list_first_type(&pp->bridge->windows, IORESOURCE_MEM);
/* Get last memory resource entry */
resource_list_for_each_entry(tmp, &pp->bridge->windows)
if (resource_type(tmp->res) == IORESOURCE_MEM)
entry = tmp;
dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX0, dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX0,
PCIE_ATU_TYPE_MEM, entry->res->start, PCIE_ATU_TYPE_MEM, entry->res->start,
......
...@@ -958,25 +958,16 @@ static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port) ...@@ -958,25 +958,16 @@ static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port)
} }
/* /*
* We can't use devm_of_pci_get_host_bridge_resources() because we * devm_of_pci_get_host_bridge_resources() only sets up translateable resources,
* need to parse our special DT properties encoding the MEM and IO * so we need extra resource setup parsing our special DT properties encoding
* apertures. * the MEM and IO apertures.
*/ */
static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie) static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
{ {
struct device *dev = &pcie->pdev->dev; struct device *dev = &pcie->pdev->dev;
struct device_node *np = dev->of_node;
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
int ret; int ret;
/* Get the bus range */
ret = of_pci_parse_bus_range(np, &pcie->busn);
if (ret) {
dev_err(dev, "failed to parse bus-range property: %d\n", ret);
return ret;
}
pci_add_resource(&bridge->windows, &pcie->busn);
/* Get the PCIe memory aperture */ /* Get the PCIe memory aperture */
mvebu_mbus_get_pcie_mem_aperture(&pcie->mem); mvebu_mbus_get_pcie_mem_aperture(&pcie->mem);
if (resource_size(&pcie->mem) == 0) { if (resource_size(&pcie->mem) == 0) {
...@@ -986,6 +977,9 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie) ...@@ -986,6 +977,9 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
pcie->mem.name = "PCI MEM"; pcie->mem.name = "PCI MEM";
pci_add_resource(&bridge->windows, &pcie->mem); pci_add_resource(&bridge->windows, &pcie->mem);
ret = devm_request_resource(dev, &iomem_resource, &pcie->mem);
if (ret)
return ret;
/* Get the PCIe IO aperture */ /* Get the PCIe IO aperture */
mvebu_mbus_get_pcie_io_aperture(&pcie->io); mvebu_mbus_get_pcie_io_aperture(&pcie->io);
...@@ -999,9 +993,12 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie) ...@@ -999,9 +993,12 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
pcie->realio.name = "PCI I/O"; pcie->realio.name = "PCI I/O";
pci_add_resource(&bridge->windows, &pcie->realio); pci_add_resource(&bridge->windows, &pcie->realio);
ret = devm_request_resource(dev, &ioport_resource, &pcie->realio);
if (ret)
return ret;
} }
return devm_request_pci_bus_resources(dev, &bridge->windows); return 0;
} }
/* /*
......
...@@ -3516,8 +3516,13 @@ void pci_acs_init(struct pci_dev *dev) ...@@ -3516,8 +3516,13 @@ void pci_acs_init(struct pci_dev *dev)
{ {
dev->acs_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS); dev->acs_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS);
if (dev->acs_cap) /*
pci_enable_acs(dev); * Attempt to enable ACS regardless of capability because some Root
* Ports (e.g. those quirked with *_intel_pch_acs_*) do not have
* the standard ACS capability but still support ACS via those
* quirks.
*/
pci_enable_acs(dev);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment