Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4721652pxu; Wed, 21 Oct 2020 03:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYVxLVmuQqsEe+1LRaI7eY93pB1OZQmzaxP1p27obMIK0CuQB+t0J+pqHEy9mhqdBREAFh X-Received: by 2002:a17:906:cc18:: with SMTP id ml24mr2674603ejb.298.1603277240460; Wed, 21 Oct 2020 03:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603277240; cv=none; d=google.com; s=arc-20160816; b=doCtO2LthUDxHO5hm160g32MJ+N/CmSNSJxZNkNFYTOkiy5PskKkx6nSVkGitFmA63 SPNLGaBpnGkqYWcBgmGI/vzecgCsAgEXWM1W8meQ3Ef8VM4khqd9HIB6HO3UUcYD3uy5 CnDGKA6kTsEmidwr3IFO4pDIEyLRiwBuFnpUzm236HQVsiCF8mrWjbHtnA68Vg9OPvqv ZGM3mo0DX1jlMGQ3C8L0r5AZlC0CK2sP2eyzdbN2TBOZcEZJpi/qEZeZkdRBydiPNf/P h01WW3bYnx+p9TTr1giqDuxPz4UsCreR4/JD0Rq5XZUcROY2WwK2r4tlQ4m7WMm4qM3t GdMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=tHKl5ShHGM26aw0ab4WfiwYyOOZYZHBqMfpsajmzAwM=; b=F1Q4VVP3ZFF4w6yZCXxs+KWI3ybzAD7gR2n6UpRZow5VTab0aH6V8c+Wcja/UkzMbZ HpsVdQjKj2FtDEdEjgx37Ie00MKDD6s6sOSVaFdQ18Yi7TrpqFgruvh2twzdCcsg7FqV UAggYdm7xG2P4WiUp3ZMNSw8GUVoa26wo7sqfKKBggFuKcVpN3xj9Nir+3LnXa7JWlpz IXeKZGxoY85KXiuI388EfeLtUPbMROuqfxpz01TkoxwKIst197mihRlGqmEM2SA07rd4 80ikbV2iIcapn5AFOveKWl6qH9OLYp53c0hSV8yuXuYmJa1JhdHKQb5MIXwS5L4FVzkO tyzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm1 header.b=QLbpD3tP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Pcp4fBRN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si1090394edv.487.2020.10.21.03.46.58; Wed, 21 Oct 2020 03:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm1 header.b=QLbpD3tP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Pcp4fBRN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439020AbgJTW0W (ORCPT + 99 others); Tue, 20 Oct 2020 18:26:22 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:54267 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392461AbgJTW0W (ORCPT ); Tue, 20 Oct 2020 18:26:22 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 2D30C580304; Tue, 20 Oct 2020 18:26:21 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Tue, 20 Oct 2020 18:26:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=tHKl5ShHGM26aw0ab4WfiwYyOOZYZHB qMfpsajmzAwM=; b=QLbpD3tPmAXiqlMlcnfoj1G+xvLNn4/Nil+G0dtaCoqPso7 QEkIrTRQuRs8Km6UVvFRpYUNI03y9qluqo6feuVeoPHjTTeJTIgMDGNtMA+fiNvw RtVrsUjJha8Y6NR2hLP1KmSDVXxgTJXNsq6J3G0PrgCoporAxbxdpLAG3weXfil0 shG7VOfkOIktACzcB6KYGxbUy0ZoIYR6kBRje2xaUUD4Vwfe039cu/h+N3QXYKjW zUCVM7d6VTgaawPkFLCUw0MqdVjAz3U+IyBGZQlXPKcx33WTFemMgG9ccyQMgXyG rJOiU82qSLpb4c2sqkTqsiOcL9Jl4G9st8mE1ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=tHKl5S hHGM26aw0ab4WfiwYyOOZYZHBqMfpsajmzAwM=; b=Pcp4fBRN5WzP53LIltbB6A RCrwHSFFMcxtRgZyn22cxfBD91KT8CTJvw3ZtYltd5h/lAyoAUSZPJUrOEdDIMJk KKwDkTnH6JV/hTrCWUUDO0PjgXyqcVO89PZXZNTX0hlAajaW60vx3K/CqDEKNjvu NVIi9VUWnH4bLux9YCeflHx4Skvcn+xJP8NPXrC71cTwAi3DWZTVzMVPlF2zooOj 60Qvc9tSMv/L2Kmj5jllocNWH4Iwf3YIuKJyI1G52K46oW8Klf128ZK5KVlSA/UK dLibWFO2uyW0LJJZGVN/SP+DjLmfLCXFoJgPhXBntr3fBJFtEgXRsGx9APOtPtjg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrjeeggddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedftehnughr vgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucggtffrrg htthgvrhhnpeehhfefkefgkeduveehffehieehudejfeejveejfedugfefuedtuedvhefh veeuffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 36A4BE00A8; Tue, 20 Oct 2020 18:26:17 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-502-gfef6c88-fm-20201019.001-gfef6c888 Mime-Version: 1.0 Message-Id: <529612e1-c6c4-4d33-91df-2a30bf2e1675@www.fastmail.com> In-Reply-To: <32bfb619bbb3cd6f52f9e5da205673702fed228f.camel@kernel.crashing.org> References: <20201019073908.32262-1-dylan_hung@aspeedtech.com> <20201019120040.3152ea0b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <32bfb619bbb3cd6f52f9e5da205673702fed228f.camel@kernel.crashing.org> Date: Wed, 21 Oct 2020 08:55:58 +1030 From: "Andrew Jeffery" To: "Benjamin Herrenschmidt" , "Arnd Bergmann" , "Dylan Hung" Cc: BMC-SW , linux-aspeed , "Po-Yu Chuang" , netdev , "OpenBMC Maillist" , "Linux Kernel Mailing List" , "Jakub Kicinski" , "David Miller" Subject: Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Oct 2020, at 08:40, Benjamin Herrenschmidt wrote: > On Tue, 2020-10-20 at 21:49 +0200, Arnd Bergmann wrote: > > On Tue, Oct 20, 2020 at 11:37 AM Dylan Hung wrote: > > > > +1 @first is system memory from dma_alloc_coherent(), right? > > > > > > > > You shouldn't have to do this. Is coherent DMA memory broken on your > > > > platform? > > > > > > It is about the arbitration on the DRAM controller. There are two queues in the dram controller, one is for the CPU access and the other is for the HW engines. > > > When CPU issues a store command, the dram controller just acknowledges cpu's request and pushes the request into the queue. Then CPU triggers the HW MAC engine, the HW engine starts to fetch the DMA memory. > > > But since the cpu's request may still stay in the queue, the HW engine may fetch the wrong data. > > Actually, I take back what I said earlier, the above seems to imply > this is more generic. > > Dylan, please confirm, does this affect *all* DMA capable devices ? If > yes, then it's a really really bad design bug in your chips > unfortunately and the proper fix is indeed to make dma_wmb() do a dummy > read of some sort (what address though ? would any dummy non-cachable > page do ?) to force the data out as *all* drivers will potentially be > affected. > > I was under the impression that it was a specific timing issue in the > vhub and ethernet parts, but if it's more generic then it needs to be > fixed globally. > We see a similar issue in the XDMA engine where it can transfer stale data to the host. I think the driver ended up using memcpy_toio() to work around that despite using a DMA reserved memory region.