Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932961AbdHVNfx (ORCPT ); Tue, 22 Aug 2017 09:35:53 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:35693 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932932AbdHVNfv (ORCPT ); Tue, 22 Aug 2017 09:35:51 -0400 MIME-Version: 1.0 In-Reply-To: <20170817090908.GP20805@n2100.armlinux.org.uk> References: <20170731222452.22887-1-danilokrummrich@dk-develop.de> <20170807182207.348762301bf3d7f8509b1bf7@dk-develop.de> <8e5e73575b3a70e0e60931698687471d@dk-develop.de> <20170817090908.GP20805@n2100.armlinux.org.uk> From: Linus Walleij Date: Tue, 22 Aug 2017 15:35:50 +0200 Message-ID: Subject: Re: [PATCH] serio: PS2 gpio bit banging driver for the serio bus To: Russell King - ARM Linux Cc: Danilo Krummrich , Will Deacon , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Linux Input , Dmitry Torokhov , "devicetree@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1231 Lines: 27 On Thu, Aug 17, 2017 at 11:09 AM, Russell King - ARM Linux wrote: > On Fri, Aug 11, 2017 at 11:16:20AM +0200, Linus Walleij wrote: >> 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