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

- From: Linus Walleij \<hidden\>
- Date: 2021-03-05 10:29:54 
- List: linux-serial
- Page: https://ratatoskr.run/linux-serial/2021/03/6289416
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/03/6288800/t.md

```text
On Thu, Mar 4, 2021 at 10:40 PM Hector Martin [ref] 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 MMIO.
>
> of_mmio_is_nonposted() performs the tree walking to determine if a given
> device has requested non-posted MMIO.
>
> of_address_to_resource() uses this to set the IORESOURCE_MEM_NONPOSTED
> flag on resources that require non-posted MMIO.
>
> of_iomap() and of_io_request_and_map() then use this flag to pick the
> correct ioremap() variant.
>
> This mechanism is currently restricted to Apple ARM platforms, as an
> optimization.
>
> Signed-off-by: Hector Martin <redacted>

This is fine with me atleast given that the nonposted IO is acceptable.
Caching the quirk state in a static local is maybe a bit overoptimized
but if the compiler can't see it but we can, why not.
Reviewed-by: Linus Walleij <redacted>

Yours,
Linus Walleij
```
