[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7b44608bed9eccad80457cbfdfcca9043aae56f2.camel@kernel.crashing.org>
Date: Wed, 21 Oct 2020 09:05:34 +1100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: David Laight <David.Laight@...LAB.COM>,
"'Dylan Hung'" <dylan_hung@...eedtech.com>,
Jakub Kicinski <kuba@...nel.org>, Joel Stanley <joel@....id.au>
Cc: "David S . Miller" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Po-Yu Chuang <ratbert@...aday-tech.com>,
linux-aspeed <linux-aspeed@...ts.ozlabs.org>,
OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
BMC-SW <BMC-SW@...eedtech.com>
Subject: Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue
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.
Powered by blists - more mailing lists