Skip to contentSkip to conversation

PCI: iproc: MPS fix and quirks

PATCH In review Jon Mason 3 participants 6 messages Jan 27, 2017 – Feb 8, 2017

Subsystems (2)
lore
Share & tools
lore

Jon Mason

author
#0 lore raw

cover PCI: iproc: MPS fix and quirks

A patch that corrects an issue where the MPS could not be set, and another that fixes some quirks in the PAXC

Jon Mason (2):
PCI: iproc: allow the MPS to be set
PCI: Add quirk entry for NS2 PAXC PCI

 drivers/pci/host/pcie-iproc.c |  5 ++++-
 drivers/pci/quirks.c          | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/2 PCI: iproc: allow the MPS to be set

pcie_bus_configure_settings() needs to be called on each of the root ports to allow for the MPS to be configured for all of the children devices.

---
 drivers/pci/host/pcie-iproc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/host/pcie-iproc.c +4 -1
index 3ebc025..0f39bd2 100644
@@ -1205,7 +1205,7 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)
 	struct device *dev;
 	int ret;
 	void *sysdata;
-	struct pci_bus *bus;
+	struct pci_bus *bus, *child;
 
 	dev = pcie->dev;
 
@@ -1278,6 +1278,9 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)
 	if (pcie->map_irq)
 		pci_fixup_irqs(pci_common_swizzle, pcie->map_irq);
 
+	list_for_each_entry(child, &bus->children, node)
+		pcie_bus_configure_settings(child);
+
 	pci_bus_add_devices(bus);
 
 	return 0;
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/2 PCI: Add quirk entry for NS2 PAXC PCI

In reply to Jon Mason

The Broadcom Northstar2 SoC has a number of quirks for the PAXC (internal/fake) PCI bus. Specifically, the PCI config space is shared between the root port and the first PF (ie., PF0), and a number of fields are tied to zero (thus preventing them from being set). These cannot be "fixed" in device firmware, so we must fix them with a quirk.

---
 drivers/pci/quirks.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/pci/quirks.c +21 -0
index 1800bef..c5ef20a 100644
@@ -2239,6 +2239,27 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
 			 PCI_DEVICE_ID_TIGON3_5719,
 			 quirk_brcm_5719_limit_mrrs);
 
+#ifdef CONFIG_PCIE_IPROC_PLATFORM
+static void quirk_paxc_bridge(struct pci_dev *pdev)
+{
+	/* The PCI config space is shared with the PAXC root port and the first
+	 * Ethernet device.  So, we need to workaround this by telling the PCI
+	 * code that the bridge is not an Ethernet device.
+	 */
+	if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
+		pdev->class = PCI_CLASS_BRIDGE_PCI << 8;
+
+	/* MPSS is not being set properly (as it is currently 0).  This is
+	 * because that area of the PCI config space is hard coded to zero, and
+	 * is not modifiable by firmware.  Set this to 2 (e.g., 512 byte MPS)
+	 * so that the MPS can be set to the real max value.
+	 */
+	pdev->pcie_mpss = 2;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16cd, quirk_paxc_bridge);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
+#endif
+
 /* Originally in EDAC sources for i82875P:
  * Intel tells BIOS developers to hide device 6 which
  * configures the overflow device access containing
Signature · 1 line
2.7.4
Acked-by on the v1 series
#3 lore raw
In reply to Jon Mason

The entire patch set looks good to me. Thanks!

Quoted 11 lines · Jon Mason

A patch that corrects an issue where the MPS could not be set, and another that fixes some quirks in the PAXC

Jon Mason (2):
PCI: iproc: allow the MPS to be set
PCI: Add quirk entry for NS2 PAXC PCI

 drivers/pci/host/pcie-iproc.c |  5 ++++-
 drivers/pci/quirks.c          | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
#4 lore raw
In reply to Jon Mason
Quoted 10 lines · Jon Mason

A patch that corrects an issue where the MPS could not be set, and another that fixes some quirks in the PAXC

Jon Mason (2):
PCI: iproc: allow the MPS to be set
PCI: Add quirk entry for NS2 PAXC PCI

 drivers/pci/host/pcie-iproc.c |  5 ++++-
 drivers/pci/quirks.c          | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

Applied with Ray's ack to pci/host-iproc for v4.11, thanks!

It looks to me like several other drivers need a similar MPS fix. I'll CC you on the patches.

Bjorn

author
#5 lore raw
Quoted 8 lines · Bjorn Helgaas
Quoted 7 lines · Jon Mason

A patch that corrects an issue where the MPS could not be set, and another that fixes some quirks in the PAXC

Jon Mason (2):
PCI: iproc: allow the MPS to be set
PCI: Add quirk entry for NS2 PAXC PCI

Quoted 8 lines
Quoted 3 lines
 drivers/pci/host/pcie-iproc.c |  5 ++++-
 drivers/pci/quirks.c          | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

Applied with Ray's ack to pci/host-iproc for v4.11, thanks!

It looks to me like several other drivers need a similar MPS fix. I'll CC you on the patches.

I'm happy to look at whatever you want to CC me on, but this is an SoC thing that I do not believe is applicable to the standard PCI device (if that is what you are referring to).

Thanks,
Jon

Quoted 2 lines

Bjorn