Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752010AbdIVHnJ (ORCPT ); Fri, 22 Sep 2017 03:43:09 -0400 Received: from mail-co1nam03on0053.outbound.protection.outlook.com ([104.47.40.53]:59864 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751795AbdIVHnD (ORCPT ); Fri, 22 Sep 2017 03:43:03 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Zhiqiang Hou To: , , , , , , CC: Minghuan Lian , Hou Zhiqiang Subject: [PATCH 2/2] pci/layerscape: change the default error response behavior Date: Fri, 22 Sep 2017 15:25:22 +0800 Message-ID: <20170922072522.36306-3-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072522.36306-1-Zhiqiang.Hou@nxp.com> References: <20170922072522.36306-1-Zhiqiang.Hou@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131505397821843172;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7966004)(336005)(346002)(39380400002)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(105606002)(47776003)(6636002)(551934003)(2950100002)(86362001)(498600001)(36756003)(2201001)(6666003)(316002)(97736004)(50226002)(104016004)(5003940100001)(189998001)(48376002)(50986999)(356003)(54906003)(77096006)(305945005)(50466002)(72206003)(2906002)(1076002)(8936002)(5660300001)(68736007)(85426001)(4326008)(16586007)(53936002)(81166006)(110136005)(8676002)(8656003)(106466001)(76176999)(81156014)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2694;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC009;1:MkZSxX7SaQ76YKnSFYdJRP39hbT2Wn0I+z4S0hRGTohVPS/AhMyCAz4U2ep8P1mcvBpkEwb+n+G1WbvEmiJkGA/Bn56r4iIgR5Pdz+uarJWfYk2aGgbv9evaS2NriJz/ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9873851a-ce40-4f88-4588-08d5018d8dac X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2694;3:7EXFBHuzAgChMoDxx0jnowLY8elLS9AzFq45Bj0F7uSglXHlPMiQOXSbJefwhzhOZvidNI4EOd38rmY/fdsBfMKF4c3HRECzsDF+ySjrUoB8F0N8cgvN6pv6gmM43Ao6snQPRPsoFGuSZlq0rgW429iheucfRH8rvpbUWa1zG9PAoJ/kOGE9I7cS2/DfvQL2S8T7DI5PVd32HcQ2z5bbOz8wEGoIRNeIxOtye3fK3z+DAAxzj2YCUQxvrJ3E/L4Ecu0yc1L5P8rI2LL8MSOY34aJUswHcDMATJtDe4C3GwXJQt/tUzzR7MFPecXqpG9uoQeMADu3ab8s6QAJawB9VB9Eh3nC+/t0+0X7cSCJmi0=;25:VEXMY9Bw1nEl2AF5X8gaTSwcYIDWHMVLz6DToZ35oAQguszelFGUYKXLeuuDq7Dwta7Rd+f1Jxi6D1SxzIMaVc+S8zp4JNcE3jGgEnbF5Tgu4VAqe4BDt99ct/jkQJ7jSOPoOMmyTXjhdMo/r5WNjt1lUZDiV29jdlzHjZgjKwcOWIoqxLelH3wS0Hfb/mWfKtZ296qLUp4lctFtLjjfszC28MRW+PQMVaVLTwDQE43vSqXMlugLyWkToC/d6MMBLPZOoSMh8xuIIXpNbbA7/uIBH+QxqPbbh7rFrEN2lAQPJNRgM2esbr6LKSzzaqULm+QJ9X2yyYUJMi17skEQdg== X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2694;31:o/j8HRVCFiZjcTX6qvnO2cvUGlv9UbKH/1RhoVq3xtpdvvEFrTH976fZAPd1VpZk0GWCKeV6XI2xjelv+1+9UpxI1BgjZmzrB2jTmYAcNJYthC1Rv8+5+31SFECHz2sqNulWx4q6nJm6McTwLWtAZsoFcRgmomvEsWQHCWUA2z4UsqvCocJS0nGXpf2xTbVfwe0rDF5PtT+SikGIq2Lp143sg/9XBjRobl6vw8D78F8=;4:19W+IV/C+52IiPQsMn3IXZDAqxPhPC/pkaqlq5r8HPlaMli2C3328TllLO+myuwtz+86o4zNO7llwbrsgKwFtM1/OtHc7TQTas0QgWqIZ8VTiVwLN02JridwsIoGcy+aYp0IEph0tH5HZtT2ZiumEY0pxQ8OgfCSxuNstC5xE+HeiI+DcRP4EvBSmz+HC1KzXx8BMtnuiru3ONW7JV7fS1b3QdDZYAzvztkFmalnrq2gUOmN6yfbMZlf4X3cdYrvt8OCTEKAGMf2WP/54MfwjBn1a2E9cUa2jXwzf1qP8lM= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123559100)(20161123556025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR03MB2694;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR03MB2694; X-Forefront-PRVS: 0438F90F17 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2694;23:1xwzYckLmsAIia9dupaTaKOaiA6DuD5R2jimDV7JO?= =?us-ascii?Q?sIyUJGrwaqFi8ZE9SQjfSG5NTCLwM6lps0oEUl7ygt85d6/0qWsd7942aSFK?= =?us-ascii?Q?xXdpCjpTrlhkzKCufKwYWoNEGr4+IViXtH25lsasqTIQl/Kn1U9+N2X61HwL?= =?us-ascii?Q?FBjnHlhMz70NUBY5E/gopGgVhszle89Ilbd5Dz94k+W8ck4bxSBa7mL2fWre?= =?us-ascii?Q?TEzd5iwogiwwmn76BnXVNT/omrUn5Wg8oTIWc3CDXXCyfYmjdgBZX/buzTaF?= =?us-ascii?Q?Is5lRrxLYq+2h+qqA4IJ5TKrC4STFGnYBl6DLZyBXH7SqCBUAj3Obd1QKYk8?= =?us-ascii?Q?M9RCISy70tsypSYi2mpPIIx9PGc7z5M6Hg44EaFKiENoWCCShSMDsaI5wZVV?= =?us-ascii?Q?uOVsokhr/1MabMT3iVHAjgN4xLM+zDrzmiyY8pwI1OshKvb/8QXkb7MLF+Bc?= =?us-ascii?Q?v1HcMQdgaB2My5DYGeDZhfvfG9Q2JTuXRN2sgLNut1t+yLeBTHb4YXr9IMsW?= =?us-ascii?Q?7ipNMpUAzwESYdxHQAHPBoYcysuhyLR/DA+hJHO+P3Fb0e6qZ6IObYz83amC?= =?us-ascii?Q?kT8vOqyzFoNwP/TkfUTiGTb0UvlZnvW6SaMb4qtz+3vE23b2GIt0AjeIA2LQ?= =?us-ascii?Q?3ZkBu1/glnALkmjjdK+ZyOEjs9oLupNuS48igOubU6ByfJGkBWyU9KP9+nlE?= =?us-ascii?Q?3RVopX9wxTAkdVvhuCOBzPHmo+jCzIOZnLAfIZ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vz9wqK233QpNmyGPuCyFZQ1dVcXSrZHKUtz32WW4eQt7du5Io0I/h84BNJ6ekNREY05EPJJ+EZKev/pNqMsixm8bN3r/8Gm2DtdBFZdaL+T8MF6wOr0vGhmQ4sMGr6X/w==;24:C6hBhZQ4MMqCt6w6oxESuMbZ82A614Yto5aDHRyyAWADUatnHoHa0oSh65r3xnIeEqIKedKSWRlM77jhng5u9orJqpBb4+vWnrrPPJCcZFQ=;7:4V5VGPqiWbr9/MDc4mdBOjMn5KfFM2O1Lt7kh4EJUDLob496IiQasV+GuCfwn7TPCX1ce99h+jqp1HQQk8C5zAbjfxlz42VPjLKemfbhR/4wcEQzutCQBHnmdDiRJbz/6lYz+IkXqJnhyiUKdJ/yZDeBvcF+hEO9vjlTGoI5ZbHCZvgiquBVEo2UL60RK5t+wc+AnLNWfYTfzFAzuyjzdcCL39lnfbGw0W05DgHW37I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2017 07:42:57.0364 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2694 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2490 Lines: 77 From: Minghuan Lian 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 Signed-off-by: Hou Zhiqiang --- 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