Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5036600pxu; Wed, 21 Oct 2020 11:30:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaH4bPIPHx3LdL/uzMqJKX6MdK3CjAm5m8DmpcdcTt61Sdc1dFC2Hhr6KyPVQMaAgfDv89 X-Received: by 2002:a17:906:d0c6:: with SMTP id bq6mr4734523ejb.16.1603305014550; Wed, 21 Oct 2020 11:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603305014; cv=none; d=google.com; s=arc-20160816; b=Z+u6zqXW1sRk8/9SYVaId4/kMxJ+niGL8lMzKIet0ZUy4y86gLw/Vz2jCxwCrNPr3N igb1TIFCtyPyKefRCz8EzemPolYVlr4Meh7vI00PHVo9xZS9WYtxOTdIJjq+w4owP5Z7 JLe+svb5y2+L8+mhOdWKJ60pnkafDz7Fd3Y1e3v9c1yn/MjK/m83dPULHe7CZTV1906l 2jtJ5tfDVuBluwm+Gjv0Z2lr9ctW3+fW87v+eswkCudkAaqzkOyGI/aNOfWJ7sHLptYJ bW6h8E7T/5uYyUHUZTOAM5nHWir4rAp1Oo/WylhhaFElGPKa9JlPWelY9Mq0UFw+D4Mm AHqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=plrOEiTMF2QTWhZztKTO0SjOh3PCwLBXkgcMdCcgC+o=; b=K1YBAIySNOdI21yjgPcf1jrNbdJWRhxKdDxDfs4QMat4dY9K9buPekfV7oZfszZtrA 8xm3bLwoUJHRTRFtV8YAfLK1sNDW38BTMG44LAHzYBpOLT/lEVMf76OSBFbR4WMDut6I wjK2CELsc2W1qCX/gE/URlybQGiyV4sMp1vl9TqPYcBh2EF71NgchJFWnilAOl0hwp3g Fhzxvp8VPUdHWLWI5VAgxJB9OqggngJ2/zRNTY/G6kCKJe76GrgWza7WNbkwc+XXeJjf VAFRXWOeL9KtaoPEewkP5/JV9dVrUzfWdr84qBgPl77wEPmVDq/Kyc173qmChYdFGEdT MwDg== ARC-Authentication-Results: i=1; mx.google.com; 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 ay17si2490894ejb.281.2020.10.21.11.29.51; Wed, 21 Oct 2020 11:30:14 -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; 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 S2410323AbgJTWG2 (ORCPT + 99 others); Tue, 20 Oct 2020 18:06:28 -0400 Received: from kernel.crashing.org ([76.164.61.194]:43502 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391762AbgJTWG2 (ORCPT ); Tue, 20 Oct 2020 18:06:28 -0400 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 09KM5Zhv006771 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Oct 2020 17:05:44 -0500 Message-ID: <7b44608bed9eccad80457cbfdfcca9043aae56f2.camel@kernel.crashing.org> Subject: Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue From: Benjamin Herrenschmidt To: David Laight , "'Dylan Hung'" , Jakub Kicinski , Joel Stanley Cc: "David S . Miller" , "netdev@vger.kernel.org" , Linux Kernel Mailing List , Po-Yu Chuang , linux-aspeed , OpenBMC Maillist , BMC-SW Date: Wed, 21 Oct 2020 09:05:34 +1100 In-Reply-To: References: <20201019073908.32262-1-dylan_hung@aspeedtech.com> <20201019120040.3152ea0b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-10-20 at 13:15 +0000, David Laight wrote: > That rather depends where the data is 'stuck'. > > An old sparc cpu would flush the cpu store buffer before the read. > But a modern x86 cpu will satisfy the read from the store buffer > for cached data. > > If the write is 'posted' on a PCI(e) bus then the read can't overtake it. > But that is a memory access so shouldn't be to a PCI(e) address. > > Shouldn't dma_wb() actually force your 'cpu to dram' queue be flushed? > In which case you need one after writing the ring descriptor and > before the poke of the mac engine. > > The barrier before the descriptor write only needs to guarantee > ordering of the writes - it can probably be a lighter barrier? > > It might be that your dma_wmb() needs to do a write+read of > an uncached DRAM location in order to empty the cpu to dram queue. This is a specific bug with how a specific IP block is hooked up in those SOCs, I wouldn't bloat the global dma_wmb for that. The read back in the driver with appropriate comment should be enough. Cheers, Ben.