# Re: \[RFT PATCH v3 08/27\] asm-generic/io.h: Add a non-posted variant of ioremap()

- From: Marc Zyngier \<maz@kernel.org\>
- Date: 2021-03-08 11:21:55 
- List: linux-arch
- Page: https://ratatoskr.run/linux-arch/2021/03/6291965
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/03/6288800/t.md

```text
On Thu, 04 Mar 2021 21:38:43 +0000,
Hector Martin [ref] wrote:
> 
> ARM64 currently defaults to posted MMIO (nGnRnE), but some devices
> require the use of non-posted MMIO (nGnRE). Introduce a new ioremap()
> variant to handle this case. ioremap_np() is aliased to ioremap() by
> default on arches that do not implement this variant.
> 
> sparc64 is the only architecture that needs to be touched directly,
> because it includes neither of the generic io.h or iomap.h headers.
> 
> This adds the IORESOURCE_MEM_NONPOSTED flag, which maps to this
> variant and marks a given resource as requiring non-posted mappings.
> This is implemented in the resource system because it is a SoC-level
> requirement, so existing drivers do not need special-case code to pick
> this ioremap variant.
> 
> Then this is implemented in devres by introducing devm_ioremap_np(),
> and making devm_ioremap_resource() automatically select this variant
> when the resource has the IORESOURCE_MEM_NONPOSTED flag set.
> 
> Signed-off-by: Hector Martin <redacted>

Acked-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.
```
