linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata
@ 2017-10-12  9:44 Zhiqiang Hou
  2017-10-12  9:44 ` [PATCHv2 1/2] PCI: Disable MSI for Freescale PCIe RC mode Zhiqiang Hou
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhiqiang Hou @ 2017-10-12  9:44 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-pci, bhelgaas, roy.zang,
	mingkai.hu, minghuan.lian
  Cc: Hou Zhiqiang

From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

The [1/2] is to fix layerscape PCIe MSI/MSI-X capability errata.
The [2/2] is to change the default AXI system error response behavior
for PCI Express outbound non-posted requests.

Hou Zhiqiang (1):
  PCI: Disable MSI for Freescale PCIe RC mode

Minghuan Lian (1):
  pci/layerscape: change the default error response behavior

 drivers/pci/dwc/pci-layerscape.c | 11 +++++++++++
 drivers/pci/quirks.c             |  8 ++++++++
 2 files changed, 19 insertions(+)

-- 
2.14.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCHv2 1/2] PCI: Disable MSI for Freescale PCIe RC mode
  2017-10-12  9:44 [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Zhiqiang Hou
@ 2017-10-12  9:44 ` Zhiqiang Hou
  2017-10-12  9:44 ` [PATCHv2 2/2] pci/layerscape: change the default error response behavior Zhiqiang Hou
  2017-10-20 18:28 ` [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Bjorn Helgaas
  2 siblings, 0 replies; 4+ messages in thread
From: Zhiqiang Hou @ 2017-10-12  9:44 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-pci, bhelgaas, roy.zang,
	mingkai.hu, minghuan.lian
  Cc: Hou Zhiqiang

From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

The Freescale PCIe controller advertises the MSI/MSI-X capability
in both RC and Endpoint mode, but in RC mode it doesn't support
MSI/MSI-X by itself, it can only transfer MSI/MSI-X from downstream
devices. So add this quirk to prevent use of MSI/MSI-X in RC mode.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Acked-by: Minghuan Lian <minghuan.Lian@nxp.com>
---
V2:
 - Fixed a typo in the commit message.

 drivers/pci/quirks.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a4d33619a7bb..c1063a420f0c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4799,3 +4799,11 @@ static void quirk_no_ats(struct pci_dev *pdev)
 /* AMD Stoney platform GPU */
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_no_ats);
 #endif /* CONFIG_PCI_ATS */
+
+/* Freescale PCIe doesn't support MSI in RC mode */
+static void quirk_fsl_no_msi(struct pci_dev *pdev)
+{
+	if (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT)
+		pdev->no_msi = 1;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, quirk_fsl_no_msi);
-- 
2.14.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCHv2 2/2] pci/layerscape: change the default error response behavior
  2017-10-12  9:44 [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Zhiqiang Hou
  2017-10-12  9:44 ` [PATCHv2 1/2] PCI: Disable MSI for Freescale PCIe RC mode Zhiqiang Hou
@ 2017-10-12  9:44 ` Zhiqiang Hou
  2017-10-20 18:28 ` [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Bjorn Helgaas
  2 siblings, 0 replies; 4+ messages in thread
From: Zhiqiang Hou @ 2017-10-12  9:44 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-pci, bhelgaas, roy.zang,
	mingkai.hu, minghuan.lian
  Cc: Minghuan Lian, Hou Zhiqiang

From: Minghuan Lian <Minghuan.Lian@nxp.com>

By default, when the PCIe controller experiences an erroneous
completion from an external completer for its outbound non-posted
request, it always sends an OKAY response to the device's internal
AXI slave system interface. However, such default system error
response behavior cannot be used for other types of outbound
non-posted requests. For example, the outbound memory read
transaction requires an actual ERROR response, like UR completion
or completion timeout. The patch is to fix it by forwarding
the error response of the non-posted request.

Signed-off-by: Minghuan Lian <Minghuan.Lian@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
---
V2:
 - Removed the parameter ls_pcie which is for debugging.

 drivers/pci/dwc/pci-layerscape.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c
index 87fa486bee2c..3a4277a5ab2c 100644
--- a/drivers/pci/dwc/pci-layerscape.c
+++ b/drivers/pci/dwc/pci-layerscape.c
@@ -33,6 +33,8 @@
 
 /* PEX Internal Configuration Registers */
 #define PCIE_STRFMR1		0x71c /* Symbol Timer & Filter Mask Register1 */
+#define PCIE_ABSERR		0x8d0 /* Bridge Slave Error Response Register */
+#define PCIE_ABSERR_SETTING	0x9401 /* Forward error of non-posted request */
 
 #define PCIE_IATU_NUM		6
 
@@ -124,6 +126,14 @@ static int ls_pcie_link_up(struct dw_pcie *pci)
 	return 1;
 }
 
+/* Forward error response of outbound non-posted requests */
+static void ls_pcie_fix_error_response(struct ls_pcie *pcie)
+{
+	struct dw_pcie *pci = pcie->pci;
+
+	iowrite32(PCIE_ABSERR_SETTING, pci->dbi_base + PCIE_ABSERR);
+}
+
 static int ls_pcie_host_init(struct pcie_port *pp)
 {
 	struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
@@ -135,6 +145,7 @@ static int ls_pcie_host_init(struct pcie_port *pp)
 	 * dw_pcie_setup_rc() will reconfigure the outbound windows.
 	 */
 	ls_pcie_disable_outbound_atus(pcie);
+	ls_pcie_fix_error_response(pcie);
 
 	dw_pcie_dbi_ro_wr_en(pci);
 	ls_pcie_clear_multifunction(pcie);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata
  2017-10-12  9:44 [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Zhiqiang Hou
  2017-10-12  9:44 ` [PATCHv2 1/2] PCI: Disable MSI for Freescale PCIe RC mode Zhiqiang Hou
  2017-10-12  9:44 ` [PATCHv2 2/2] pci/layerscape: change the default error response behavior Zhiqiang Hou
@ 2017-10-20 18:28 ` Bjorn Helgaas
  2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2017-10-20 18:28 UTC (permalink / raw)
  To: Zhiqiang Hou
  Cc: roy.zang, linux-pci, linux-kernel, minghuan.lian,
	linux-arm-kernel, bhelgaas, mingkai.hu

On Thu, Oct 12, 2017 at 05:44:46PM +0800, Zhiqiang Hou wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> 
> The [1/2] is to fix layerscape PCIe MSI/MSI-X capability errata.
> The [2/2] is to change the default AXI system error response behavior
> for PCI Express outbound non-posted requests.
> 
> Hou Zhiqiang (1):
>   PCI: Disable MSI for Freescale PCIe RC mode
> 
> Minghuan Lian (1):
>   pci/layerscape: change the default error response behavior
> 
>  drivers/pci/dwc/pci-layerscape.c | 11 +++++++++++
>  drivers/pci/quirks.c             |  8 ++++++++
>  2 files changed, 19 insertions(+)

Applied to pci/host-layerscape for v4.15, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-20 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-12  9:44 [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Zhiqiang Hou
2017-10-12  9:44 ` [PATCHv2 1/2] PCI: Disable MSI for Freescale PCIe RC mode Zhiqiang Hou
2017-10-12  9:44 ` [PATCHv2 2/2] pci/layerscape: change the default error response behavior Zhiqiang Hou
2017-10-20 18:28 ` [PATCHv2 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).