Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-12 Thread Arnd Bergmann
On Thu, Mar 11, 2021 at 7:10 PM Rob Herring wrote: > > On Thu, Mar 11, 2021 at 9:48 AM Arnd Bergmann wrote: > > > > On Thu, Mar 11, 2021 at 5:10 PM Rob Herring wrote: > > > On Thu, Mar 11, 2021 at 2:12 AM Arnd Bergmann wrote: > > > > On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > > > > O

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-11 Thread Rob Herring
On Thu, Mar 11, 2021 at 9:48 AM Arnd Bergmann wrote: > > On Thu, Mar 11, 2021 at 5:10 PM Rob Herring wrote: > > On Thu, Mar 11, 2021 at 2:12 AM Arnd Bergmann wrote: > > > On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > > > Ok, makes sense. > > > > > > Conceptually, I'd like to then see a c

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-11 Thread Arnd Bergmann
On Thu, Mar 11, 2021 at 5:10 PM Rob Herring wrote: > On Thu, Mar 11, 2021 at 2:12 AM Arnd Bergmann wrote: > > On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > > Ok, makes sense. > > > > Conceptually, I'd like to then see a check that verifies that the > > property is only set for nodes whose

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-11 Thread Rob Herring
On Thu, Mar 11, 2021 at 2:12 AM Arnd Bergmann wrote: > > On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > > > > On Wed, Mar 10, 2021 at 1:27 AM Hector Martin wrote: > > > > > > On 10/03/2021 07.06, Rob Herring wrote: > > > >> My main concern here is that this creates an inconsistency in the

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-11 Thread Arnd Bergmann
On Thu, Mar 11, 2021 at 1:11 PM Hector Martin wrote: > On 11/03/2021 18.12, Arnd Bergmann wrote: > > On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > >> On Wed, Mar 10, 2021 at 1:27 AM Hector Martin wrote: > >>> Works for me; then let's just make it non-recursive. > >>> > >>> Do you think we

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-11 Thread Hector Martin
On 11/03/2021 18.12, Arnd Bergmann wrote: On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: On Wed, Mar 10, 2021 at 1:27 AM Hector Martin wrote: On 10/03/2021 07.06, Rob Herring wrote: My main concern here is that this creates an inconsistency in the device tree representation that only w

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-11 Thread Arnd Bergmann
On Wed, Mar 10, 2021 at 6:01 PM Rob Herring wrote: > > On Wed, Mar 10, 2021 at 1:27 AM Hector Martin wrote: > > > > On 10/03/2021 07.06, Rob Herring wrote: > > >> My main concern here is that this creates an inconsistency in the device > > >> tree representation that only works because PCI driver

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-10 Thread Rob Herring
On Wed, Mar 10, 2021 at 1:27 AM Hector Martin wrote: > > On 10/03/2021 07.06, Rob Herring wrote: > >> My main concern here is that this creates an inconsistency in the device > >> tree representation that only works because PCI drivers happen not to > >> use these code paths. Logically, having "no

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-10 Thread Hector Martin
On 10/03/2021 07.06, Rob Herring wrote: My main concern here is that this creates an inconsistency in the device tree representation that only works because PCI drivers happen not to use these code paths. Logically, having "nonposted-mmio" above the PCI controller would imply that it applies to t

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-09 Thread Rob Herring
On Tue, Mar 9, 2021 at 1:24 PM Hector Martin wrote: > > On 10/03/2021 00.48, Rob Herring wrote: > > On Mon, Mar 8, 2021 at 2:56 PM Arnd Bergmann wrote: > >> > >> On Mon, Mar 8, 2021 at 10:14 PM Rob Herring wrote: > >>> On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: > On Mon,

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-09 Thread Hector Martin
On 10/03/2021 00.48, Rob Herring wrote: On Mon, Mar 8, 2021 at 2:56 PM Arnd Bergmann wrote: On Mon, Mar 8, 2021 at 10:14 PM Rob Herring wrote: On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: On Mon, Mar 8, 2021 at 4:56 PM Rob Herring wrote: Let's just stick with 'nonposted

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-09 Thread Rob Herring
On Mon, Mar 8, 2021 at 2:56 PM Arnd Bergmann wrote: > > On Mon, Mar 8, 2021 at 10:14 PM Rob Herring wrote: > > On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: > > > On Mon, Mar 8, 2021 at 4:56 PM Rob Herring wrote: > > > > Let's just stick with 'nonposted-mmio', but drop 'posted-m

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-09 Thread Linus Walleij
On Tue, Mar 9, 2021 at 1:41 PM Arnd Bergmann wrote: > - A driver writer may want to choose between posted and > nonposted mmio based on performance considerations: > if writes are never serialized, posted writes should always > be faster. However, if the driver uses a spinlock to serialize

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-09 Thread Arnd Bergmann
On Tue, Mar 9, 2021 at 12:14 PM Linus Walleij wrote: > > On Mon, Mar 8, 2021 at 10:13 PM Rob Herring wrote: > > On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: > > > > This is obviously more work for the drivers, but at least it keeps > > > the common code free of the hack while al

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-09 Thread Linus Walleij
On Mon, Mar 8, 2021 at 10:13 PM Rob Herring wrote: > On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: > > This is obviously more work for the drivers, but at least it keeps > > the common code free of the hack while also allowing drivers to > > use ioremap_np() intentionally on othe

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-08 Thread Arnd Bergmann
On Mon, Mar 8, 2021 at 10:14 PM Rob Herring wrote: > On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: > > On Mon, Mar 8, 2021 at 4:56 PM Rob Herring wrote: > > Let's just stick with 'nonposted-mmio', but drop 'posted-mmio'. I'd > rather know if and when we need 'posted-mmio'. It doe

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-08 Thread Rob Herring
On Mon, Mar 08, 2021 at 09:29:54PM +0100, Arnd Bergmann wrote: > On Mon, Mar 8, 2021 at 4:56 PM Rob Herring wrote: > > On Fri, Mar 5, 2021 at 2:17 PM Arnd Bergmann wrote: > > > On Fri, Mar 5, 2021 at 7:18 PM Hector Martin wrote: > > > > > > > What's the code path using these functions on the M1

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-08 Thread Arnd Bergmann
On Mon, Mar 8, 2021 at 4:56 PM Rob Herring wrote: > On Fri, Mar 5, 2021 at 2:17 PM Arnd Bergmann wrote: > > On Fri, Mar 5, 2021 at 7:18 PM Hector Martin wrote: > > > > > What's the code path using these functions on the M1 where we need to > > > > return 'posted'? It's just downstream PCI mappin

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-08 Thread Rob Herring
On Fri, Mar 5, 2021 at 2:17 PM Arnd Bergmann wrote: > > On Fri, Mar 5, 2021 at 7:18 PM Hector Martin wrote: > > > > On 06/03/2021 02.39, Rob Herring wrote: > > >> - return ioremap(res.start, resource_size(&res)); > > >> + if (res.flags & IORESOURCE_MEM_NONPOSTED) > > >> +

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Arnd Bergmann
On Fri, Mar 5, 2021 at 7:18 PM Hector Martin wrote: > > On 06/03/2021 02.39, Rob Herring wrote: > >> - return ioremap(res.start, resource_size(&res)); > >> + if (res.flags & IORESOURCE_MEM_NONPOSTED) > >> + return ioremap_np(res.start, resource_size(&res)); > >> + e

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Hector Martin
On 06/03/2021 02.39, Rob Herring wrote: I'm still a little hesitant to add these properties and having some default. I worry about a similar situation as 'dma-coherent' where the assumed default on non-coherent on Arm doesn't work for PowerPC which defaults coherent. More below on this. The int

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Rob Herring
On Thu, Mar 4, 2021 at 3:40 PM Hector Martin wrote: > > This implements the 'nonposted-mmio' and 'posted-mmio' boolean > properties. Placing these properties in a bus marks all child devices as > requiring non-posted or posted MMIO mappings. If no such properties are > found, the default is posted

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Hector Martin
On 06/03/2021 01.43, Arnd Bergmann wrote: - setting ioremap() on PCI buses non-posted only makes them only slower but not more reliable, because the non-posted flag on the bus is discarded by the PCI host bridge. Note that this doesn't work here *anyway*. The fabric is picky in both dire

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Arnd Bergmann
On Fri, Mar 5, 2021 at 5:08 PM Andy Shevchenko wrote: > > On Fri, Mar 5, 2021 at 5:55 PM Hector Martin wrote: > > On 06/03/2021 00.13, Andy Shevchenko wrote: > > ... > > > >> - return ioremap(res.start, resource_size(&res)); > > >> + if (res.flags & IORESOURCE_MEM_NONPOSTED) > > >> +

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Andy Shevchenko
On Fri, Mar 5, 2021 at 5:55 PM Hector Martin wrote: > On 06/03/2021 00.13, Andy Shevchenko wrote: ... > >> - return ioremap(res.start, resource_size(&res)); > >> + if (res.flags & IORESOURCE_MEM_NONPOSTED) > >> + return ioremap_np(res.start, resource_size(&res)); > >> +

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Rob Herring
On Fri, Mar 5, 2021 at 9:13 AM Andy Shevchenko wrote: > > On Thu, Mar 4, 2021 at 11:40 PM Hector Martin wrote: > > > > This implements the 'nonposted-mmio' and 'posted-mmio' boolean > > properties. Placing these properties in a bus marks all child devices as > > requiring non-posted or posted MMI

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Hector Martin
On 06/03/2021 00.13, Andy Shevchenko wrote: @@ -896,7 +899,10 @@ void __iomem *of_iomap(struct device_node *np, int index) if (of_address_to_resource(np, index, &res)) return NULL; - return ioremap(res.start, resource_size(&res)); + if (res.flags & IORESOURC

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Andy Shevchenko
On Thu, Mar 4, 2021 at 11:40 PM Hector Martin wrote: > > This implements the 'nonposted-mmio' and 'posted-mmio' boolean > properties. Placing these properties in a bus marks all child devices as > requiring non-posted or posted MMIO mappings. If no such properties are > found, the default is poste

Re: [RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-05 Thread Linus Walleij
On Thu, Mar 4, 2021 at 10:40 PM Hector Martin wrote: > This implements the 'nonposted-mmio' and 'posted-mmio' boolean > properties. Placing these properties in a bus marks all child devices as > requiring non-posted or posted MMIO mappings. If no such properties are > found, the default is posted

[RFT PATCH v3 12/27] of/address: Add infrastructure to declare MMIO as non-posted

2021-03-04 Thread Hector Martin
This implements the 'nonposted-mmio' and 'posted-mmio' boolean properties. Placing these properties in a bus marks all child devices as requiring non-posted or posted MMIO mappings. If no such properties are found, the default is posted MMIO. of_mmio_is_nonposted() performs the tree walking to det