Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbdHIQhm (ORCPT ); Wed, 9 Aug 2017 12:37:42 -0400 Received: from mail-by2nam03on0117.outbound.protection.outlook.com ([104.47.42.117]:48512 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752841AbdHIQhj (ORCPT ); Wed, 9 Aug 2017 12:37:39 -0400 From: Casey Leedom To: Ding Tianhong , Bjorn Helgaas CC: "ashok.raj@intel.com" , "bhelgaas@google.com" , Michael Werner , Ganesh GR , "asit.k.mallick@intel.com" , "patrick.j.cramer@intel.com" , "Suravee.Suthikulpanit@amd.com" , "Bob.Shaw@amd.com" , "l.stach@pengutronix.de" , "amira@mellanox.com" , "gabriele.paoloni@huawei.com" , "David.Laight@aculab.com" , "jeffrey.t.kirsher@intel.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "mark.rutland@arm.com" , "robin.murphy@arm.com" , "davem@davemloft.net" , "alexander.duyck@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "netdev@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxarm@huawei.com" Subject: Re: [PATCH v9 1/4] PCI: Add new PCIe Fabric End Node flag, PCI_DEV_FLAGS_NO_RELAXED_ORDERING Thread-Topic: [PATCH v9 1/4] PCI: Add new PCIe Fabric End Node flag, PCI_DEV_FLAGS_NO_RELAXED_ORDERING Thread-Index: AQHTDbseETiekn3E/ky/7c4YQbAw3aJ7Hs4AgAAfpJqAAB3/AIAAmwuAgAA/kS0= Date: Wed, 9 Aug 2017 16:36:32 +0000 Message-ID: References: <1501917313-9812-1-git-send-email-dingtianhong@huawei.com> <1501917313-9812-2-git-send-email-dingtianhong@huawei.com> <20170808232200.GO16580@bhelgaas-glaptop.roam.corp.google.com> <20170809030236.GA7191@bhelgaas-glaptop.roam.corp.google.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leedom@chelsio.com; x-originating-ip: [12.32.117.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR12MB1438;6:O9vFOxgVD2fhXGdtvTfeZf4LphF1sADEk5sGSkqdEpbj47abfRL/mG6qK/q67+3wsXkjgHJcu2BDmOCGr66IdB1XJMnGuYP34GTKS+bxBdn446nkhhHyxd+mnWucbrEeJsMRl95YyxgZOhoyn+QzlrBUQwDaXkIQdJRHUz2jHd/imC2nikTLhC+0pjKf0qbQFe/QOD79s87f1PfrEsY+ZVSnGaYr+PXUldU0Rj8Lz8FA0UXp0KzzmbuKIvKALCXhwpIot33TyOBFHP9lu7IP0l4bOjVyT+OfIKuFRrHnIopNi0X6vEC/qoU8Zyqie78fGg8j3AY8qhQN7vbskOSqlw==;5:DyKBNeq0W3Cc7QIi6OarvSn3Gbe23V6XfKUIeSHttP86Rtl3bTO81+2+V9NPuGRES2n55wskgijB4mHPRIt/IwR3HFsUH0No6xEXcs7TYDZLuOK1SrTHdkltCKmcCGytUo+Y7eV5fku5Utos6PYlFw==;24:kcOsGm4zRPzUV+lZxqNWfPHLSP1nLOhMwlUYH/b8LJUny18/nbpunDJ7p3SH5HijMJW3UMlXgiRngO5TxPlXepv3MUPSPXYJxrOKmnZdIJQ=;7:cRovB+etxFoGpBIp/i9ISQmx3kXEe3e23ZTDQNl33xZjCwtO+bYj/ErU64oDsQSE2F+lQxuICfmValBpqvrOfleStG+MDXW66ZeN3TYl1DqI5DdVHXh+V4T1z3nML4aUoFg5U6oSmKMuay7PJjbE50WiTR5zfzPUz8Jacbxk2TeJETPmLzxKxB06JW7oA4bJEmzGEnsxSOJA3uTCnkFfvVpC8SJ5/rAWyaloNP0sPgM= x-ms-office365-filtering-correlation-id: 03f85878-cd56-41de-5e74-08d4df44cb8d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(2017082002075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR12MB1438; x-ms-traffictypediagnostic: MWHPR12MB1438: x-exchange-antispam-report-test: UriScan:(20558992708506)(50582790962513)(767451399110); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123560025)(201703131423075)(201703061421075)(20161123558100)(2016111802025)(20161123564025)(20161123555025)(6072148)(6043046)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR12MB1438;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR12MB1438; x-forefront-prvs: 0394259C80 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39400400002)(39450400003)(189002)(54534003)(24454002)(199003)(377454003)(3846002)(189998001)(6116002)(4326008)(97736004)(551934003)(86362001)(81156014)(81166006)(6246003)(93886004)(8936002)(8676002)(305945005)(101416001)(7736002)(6436002)(55016002)(9686003)(53936002)(33656002)(8666007)(102836003)(54906002)(38730400002)(2900100001)(6506006)(99286003)(66066001)(2906002)(39060400002)(2950100002)(68736007)(53546010)(5660300001)(3280700002)(7696004)(7416002)(74316002)(229853002)(106356001)(508600001)(25786009)(14454004)(50986999)(3660700001)(54356999)(105586002)(77096006)(76176999);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR12MB1438;H:MWHPR12MB1600.namprd12.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginatorOrg: chelsio.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2017 16:36:32.7829 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 065db76d-a7ae-4c60-b78a-501e8fc17095 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1438 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v79Gbtsi001624 Content-Length: 4227 Lines: 90 | From: Ding Tianhong | Sent: Wednesday, August 9, 2017 5:17 AM | | On 2017/8/9 11:02, Bjorn Helgaas wrote: | > | > On Wed, Aug 09, 2017 at 01:40:01AM +0000, Casey Leedom wrote: | > > | >> | From: Bjorn Helgaas | >> | Sent: Tuesday, August 8, 2017 4:22 PM | >> | ... | >> | It should also include a pointer to the AMD erratum, if available, or | >> | at least some reference to how we know it doesn't obey the rules. | >> | >> Getting an ACK from AMD seems like a forlorn cause at this point. My | >> contact was Bob Shaw and he stopped responding to me | >> messages almost a year ago saying that all of AMD's energies were being | >> redirected towards upcoming x86 products (likely Ryzen as we now know). | >> As far as I can tell AMD has walked away from their A1100 (AKA | >> "Seattle") ARM SoC. | >> | >> On the specific issue, I can certainly write up somthing even more | >> extensive than I wrote up for the comment in drivers/pci/quirks.c. | >> Please review the comment I wrote up and tell me if you'd like | >> something even more detailed -- I'm usually acused of writing comments | >> which are too long, so this would be a new one on me ... :-) | > | > If you have any bug reports with info about how you debugged it and | > concluded that Seattle is broken, you could include a link (probably | > in the changelog). But if there isn't anything, there isn't anything. | ... | OK, I could reorganize it, but still need the Casey to give me the link | for the Seattle, otherwise I could remove the AMD part and wait until | someone show it. Thanks There are no links and I was never given an internal bug number at AMD. As I said, they stopped responding to my notes about a years ago saying that they were moving the focus of all their people and no longer had resources to pursue the issue. Hopefully for them, Ryzen doesn't have the same Data Corruption problem ... As for how we diagnosed it, with our Ingress Packet delivery, we have the Ingress Packet Data delivered (DMA Write) into Free List Buffers, and then then a small message (DMA Write) to a "Response Queue" indicating delivery of the Ingress Packet Data into the Free List Buffers. The Transaction Layer Packets which convey the Ingress Packet Data all have the Relaxed Ordering Attribute set, while the following TLP carring the Ingress Data delivery notification into the Response Queue does not have the Relaxed Ordering Attribute set. The rules for processing TLPs with and without the Relaxed Ordering Attribute set are covered in Section 2.4.1 of the PCIe 3.0 specification (Revision 3.0 November 10, 2010). Table 2-34 "Ordering Rules Summary" covers the cases where one TLP may "pass" (be proccessed earlier) than a preceding TLP. In the case we're talking about, we have a sequence of one or more Posted DMA Write TLPs with the Relaxed Ordering Attribute set and a following Posted DMA Write TLP without the Relaxed Ordering Attribute set. Thus we need to look at the Row A, Column 2 cell of Table 2-34 governing when a Posted Request may "pass" a preceeding Posted Request. In that cell we have: a) No b) Y/N with the explanatory text: A2a A Posted Request must not pass another Posted Request unless A2b applies. A2b A Posted Request with RO[23] Set is permitted to pass another Posted Request[24]. A Posted Request with IDO Set is permitted to pass another Posted Request if the two Requester IDs are different. [23] In this section, "RO" is an abbreviation for the Relaxed Ordering Attribute field. [24] Some usages are enabled by not implementing this passing (see the No RO-enabled PR-PR Passing bit in Section 7.8.15). In our case, we were getting notifications of Ingress Packet Delivery in our Response Queues, but not all of the Ingress Packet Data Posted DMA Write TLPs had been processed yet by the Root Complex. As a result, we were picking up old stale memory data before those lagging Ingress Packet Data TLPs could be processed. This is a clear violation of the PCIe 3.0 TLP processing rules outlined above. Does that help? Casey