Thread (8 messages) 8 messages, 3 authors, 2017-08-22

Re: [PATCH] serio: PS2 gpio bit banging driver for the serio bus

From: Linus Walleij <hidden>
Date: 2017-08-22 13:35:53
Also in: linux-arm-kernel, linux-devicetree, lkml

Possibly related (same subject, not in this thread)

On Thu, Aug 17, 2017 at 11:09 AM, Russell King - ARM Linux
[off-list ref] wrote:
On Fri, Aug 11, 2017 at 11:16:20AM +0200, Linus Walleij wrote:
quoted
writel() should be guaranteeing that the values hit the hardware, wmb() is
spelled out "write memory barrier" I don't see what you're after here.
Incorrect.  writel() has a barrier which ensures that data written to
memory (eg, dma coherent memory) is visible to the hardware prior to
the write hitting the hardware.

There is no barrier to ensure that the write hits the hardware in a
timely manner - the write can be buffered by the buses, which will
delay it before it hits its destination.

PCI particularly buffers MMIO writes, and the requirement there has
always been that if you need the write to hit the hardware in a timely
fashion, you must perform a read-back to force the bus to deliver the
write (since a read is not allowed to overlap a write.)

The solution is never to use barrier() - barrier() is a _compiler_
barrier and does nothing for posted writes on hardware buses.
Thanks Russell. I tend to forget things over time even though I have
some memory of this being spelled out to me in the past :(

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help