From patchwork Thu Oct 12 09:44:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10001443 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B723360325 for ; Thu, 12 Oct 2017 10:03:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA69828D4F for ; Thu, 12 Oct 2017 10:03:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F43828D5A; Thu, 12 Oct 2017 10:03:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F18B28D4F for ; Thu, 12 Oct 2017 10:03:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbdJLKCw (ORCPT ); Thu, 12 Oct 2017 06:02:52 -0400 Received: from mail-by2nam03on0059.outbound.protection.outlook.com ([104.47.42.59]:45616 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751140AbdJLKCs (ORCPT ); Thu, 12 Oct 2017 06:02:48 -0400 Received: from CY1PR03CA0009.namprd03.prod.outlook.com (10.174.128.19) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 10:02:46 +0000 Received: from BN1AFFO11FD033.protection.gbl (2a01:111:f400:7c10::189) by CY1PR03CA0009.outlook.office365.com (2603:10b6:600::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Thu, 12 Oct 2017 10:02:46 +0000 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; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD033.mail.protection.outlook.com (10.58.52.246) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 12 Oct 2017 10:02:41 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v9CA2VVL001998; Thu, 12 Oct 2017 03:02:38 -0700 From: Zhiqiang Hou To: , , , , , , CC: Minghuan Lian , Hou Zhiqiang Subject: [PATCHv2 2/2] pci/layerscape: change the default error response behavior Date: Thu, 12 Oct 2017 17:44:48 +0800 Message-ID: <20171012094448.31217-3-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171012094448.31217-1-Zhiqiang.Hou@nxp.com> References: <20171012094448.31217-1-Zhiqiang.Hou@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131522761663667478; (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)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(81156014)(2201001)(8676002)(81166006)(104016004)(8936002)(498600001)(72206003)(4326008)(36756003)(86362001)(76176999)(50986999)(47776003)(110136005)(16586007)(1076002)(2906002)(54906003)(97736004)(106466001)(105606002)(68736007)(316002)(50226002)(8656003)(5660300001)(53936002)(6636002)(50466002)(6666003)(48376002)(2950100002)(189998001)(305945005)(77096006)(5003940100001)(85426001)(356003)(551934003)(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; BN1AFFO11FD033; 1:S23ULAvKsgKpy0Urs0mLzTw4NNl/hdt+2YugyMKe4T6hzD1NJHaUjXRDMjcgJDDoHA5Kcrw8S6STnqLnfjmXiZdqsrXX6Q6mPELfqDgXoiJH58OcjNnKjGBFUWt2lNNQ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1178e0a-7458-4011-9a54-08d511586349 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:N7uIFJBPnvW7VhjCIiJK/m8qWSd2jReMwtRxXMgDHwwqw5Sp16AP1LMq7dZwKEl5MQ8hoRXBCi+KF+6XwdcHdjls0J0UwbVlxnYY7h+pq7ODMvvBe69E3Ud4WlXk2du1VNBb1p9Dj6fJLrh/WbclFJLVsY2YsI1O8bTJNFSgvJkZqezcKj/ZeLF+LKKXNwNnRl12NqoR9dtDlVIZhEQKQq5sR/QO0zV1vS+kpXDiYcmxB8wh6ZHUTCXKzJud2wQb4QjXBce76JQmrlf5hbHsj1n6seDWt6hnkykNUWZ7kxpHTg3RR+ImgErfIpfRcUew44npxk9eLzQMa87wOEv3dtIZC+avdQBBsyZ/Zx5+YJ8=; 25:Il9+GKBbXH4ZBOatUCH3I7TV+Ad4Oj27NUzeR4IC9MkzGmm9zdLOVlzxzFkKEfnryD4M19Npbhrs+MbCnemTbsJo0UjgsG32haGj96mVL7Iiv6wk4gGKCIGsIChrz57Ft6RGk7lTYcpStN2iGZzYx1hH0Qg2pN4iFncQXkBSKjNhaW2pCe1HBAovAA7HtQxeZ8lMA38hDyAS8CGx08xwSmh9i1wGn4qv0mj3YHAj/lbBOact8/ytTBvXY/Gb3gebf4m9MYhpPyKpfA1LbKVPZequBaEv95Fe9Jz7kNRuFkKE4tr1Do0U/us2riS8M00yN4+wt0e/rLMD/iMPFyG06YHg1EieMyCqMU/oMEu/CBM= X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 31:wr6BtrXHgOQTMGbugTTpK7ZTeKj6NavyNuWhdbE7tZySKY/AZ3IRDqY9lay43iaNpbuncczrNBg51jHlx+U5MoPnxFV4HTIJjLDFyVdCvMojF9lYPTrbuMY4wk5ksOHnZrR2FwTeibo5PK+0Pec0u28YqNsR6nJsSwaRKV0HaiDteuudvWE293PSXrdEyPn2h+BQ5fLlH63tv9ylKlu+Hbenl8sfw8z6WC7w9mMy9J8=; 4:msC8FowDJx4Y71pBO9qRKPuvvS+fulA+gr+sqrAJ7P2B/Eh0LninDRMzYNDd3cq9cTdkJ0mqjzm7Kg53gdQe/XDvRuNNxGh+G6sry3CjWAztHa87M+biNGRVn0hUV0iAoCBDnfZqcdghG7syGUcWiEMzh+pHNm4UMloHusqjTb4NTkfvUfBW1OhoUwBraK7K1EoXiJLUPnZ/7MZwYbT131I3m1+LN3AfNDVSkvWJ+GwP02TFGjWGpXXctzClhOvttpvDQrBXhppAt4mYtTmJ5uCMQuI7XYZgAi5+VVTaZq8= 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)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123556025)(20161123561025)(20161123565025)(20161123559100)(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: 04583CED1A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:SSyOluNLlzkOhelyJoD2Fc1TkPzQ+nBK2Jj0cWZRi?= =?us-ascii?Q?iBoJ1ahPe7DHdBe0NSMNcBCl1CkmiOCOSylx2Un2A/ZJ7LUAGY7P/jyfJ38X?= =?us-ascii?Q?31ByGYO6/VLWc1WcMmhFjS+EBXyD/+IRb6fdVsPN5aDnnN3g3VcJ/c4DQJUW?= =?us-ascii?Q?0QXdgyUqU3O54YtvCFITSxfJsed560DCUgc4BHGa1fplbWo7xP6wUjR8c8iE?= =?us-ascii?Q?6Gu6hh63vzigEek6kUaU8kaNucZuZP63EmIObaBxGXSIQ3h1/Zm1mbjbmdzD?= =?us-ascii?Q?gG7ezv9L2ZUswuFkCuwC5kKdjLRXSfiHKsLjiZ/9nc3wFHV7dW7Gr7QBkted?= =?us-ascii?Q?HrcxAhFRbBWb+WoKQgabpaRZA1tNCJn8YRkHkO6iKVcZKKcnAWekN5QqpSiP?= =?us-ascii?Q?E9i+BKvHZt3lWsRU8+cHO1hbbEL3iTt22VVGjNLEmzA0SBdnYU4vI+3/vtXV?= =?us-ascii?Q?hPXX8WJLzrBAlKckKumYPWbcRTUjLiyBvpRbsvBw0yVBW+S/pezzKm2z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7teRhvwGQyBgRycG/DhsiP54aWAgla9hijlolqAVliAXUzH69yU5hgbwFUUu/HGJKoDKNN1m8TbUhulzyoosLp8aSQG7p6ahZ3zsGOEl6X4QDVmNc4ycSVYczqdryA4FJ1puH1Y6R5/kihm+kQzremRqJMoDFHZcZuzgFcv+x5rtIhba3NY9AWb8tIR/+L4n92HZcOctxGZF+c5/w6TFRpemIcWZAtjq2J+bg4/qSrmVDlh2gmlFTIgPfg==; 5:KBUjCUthGz/EPD7oSd0/xEE+ZVYcln2tsdK4CZ8v37H4ajhMwejN1dsMwzu8EpucFIp7hNwAEQ+sT//maQAbv2Q6qCgjc1MFuTtIuKbhXmEyPLqvQJlY3zvU+yo18C8YEDxDw8LFDI/sQUOTMtGYIQ==; 24:iDUn5xR3YDSjODWOm8yjJpbVVjz7JyNP5+7X3sMWf47mw0eOD5BikPMRBLkW6j9AG8bNm9E24aYCnBDXbiW8fDocog1Hjn/UGdai7lZwO18=; 7:4KB+mmZgFAwBRHTvzIUMiqLL4NPZIvO+Vitd6WNMB6h4L9NVK/ZeZaSoeUYHqXlRaAhRn+O5D1MjBgHafP4anrJk1+7lnssVEAHtpLpR8DNJ5jGUAM0r0QVCwcoBzhKfB+XA1TSSH79RgmHlfez+Wbk4jtSexwD8suqBrX422zhQZLwJugacd0uJqtCPvdrQb7Vk4ex0KQ/gE6IjK7V7r5Yy3qR2GLfd1+nQByOQYX8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 10:02:41.2031 (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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);