From: Zhiqiang Hou <Zhiqiang.Hou@nxp.com>
To: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-pci@vger.kernel.org>, <bhelgaas@google.com>,
<roy.zang@nxp.com>, <mingkai.hu@nxp.com>, <minghuan.lian@nxp.com>
Cc: Minghuan Lian <Minghuan.Lian@nxp.com>,
Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Subject: [PATCH 2/2] pci/layerscape: change the default error response behavior
Date: Fri, 22 Sep 2017 15:25:22 +0800 [thread overview]
Message-ID: <20170922072522.36306-3-Zhiqiang.Hou@nxp.com> (raw)
In-Reply-To: <20170922072522.36306-1-Zhiqiang.Hou@nxp.com>
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>
---
drivers/pci/dwc/pci-layerscape.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c
index 3b01e309a55e..a647090c140e 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
@@ -54,6 +56,19 @@ struct ls_pcie {
#define to_ls_pcie(x) dev_get_drvdata((x)->dev)
+static int err_response_flag = 1;
+
+static int __init ls_pcie_param(char *p)
+{
+ if (p && strncmp(p, "no-err-response", 15) == 0)
+ err_response_flag = 0;
+ else
+ err_response_flag = 1;
+
+ return 0;
+}
+early_param("ls_pcie", ls_pcie_param);
+
static bool ls_pcie_is_bridge(struct ls_pcie *pcie)
{
struct dw_pcie *pci = pcie->pci;
@@ -124,6 +139,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 +158,8 @@ 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);
+ if (err_response_flag)
+ ls_pcie_fix_error_response(pcie);
dw_pcie_dbi_ro_wr_en(pci);
ls_pcie_clear_multifunction(pcie);
--
2.14.1
next prev parent reply other threads:[~2017-09-22 7:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-22 7:25 [PATCH 0/2] PCI: layerscape: add fixes for layerscape-pcie errata Zhiqiang Hou
2017-09-22 7:25 ` [PATCH 1/2] PCI: Disable MSI for Freescale PCIe RC mode Zhiqiang Hou
2017-10-11 19:37 ` Bjorn Helgaas
2017-10-12 3:01 ` M.h. Lian
2017-10-12 3:17 ` Z.q. Hou
2017-09-22 7:25 ` Zhiqiang Hou [this message]
2017-10-11 19:41 ` [PATCH 2/2] pci/layerscape: change the default error response behavior Bjorn Helgaas
2017-10-12 3:33 ` Z.q. Hou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170922072522.36306-3-Zhiqiang.Hou@nxp.com \
--to=zhiqiang.hou@nxp.com \
--cc=bhelgaas@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=minghuan.lian@nxp.com \
--cc=mingkai.hu@nxp.com \
--cc=roy.zang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).