On Mon, Nov 22, 2021 at 3:59 PM Sai Prakash Ranjan
<quic_saipraka@xxxxxxxxxxx> wrote:
Ah, you are right that the arm64 version currently has custom definitionsSorry, I didn't get this part, so I am trying this on ARM64:And if we do move this instrumentation to asm-generic/io.h, how willAs I understand it, your version also requires architecture specific
that be executed since
the arch specifc read{b,w,l,q} overrides this generic version?
changes, so that would be the same: it only works for architectures
that get the definition of readl()/readl_relaxed()/inl()/... from
include/asm-generic/io.h and only override the __raw version. Arnd
arm64/include/asm/io.h has read{b,l,w,q} defined.
include/asm-generic/io.h has below:
#ifndef readl
#define readl readl
static inline u32 readl(const volatile void __iomem *addr)
and we include asm-generic/io.h in arm64/include/asm/io.h at the end
after the definitions for arm64 mmio accesors.
So arch implementation here overrides generic ones as I see it, am I
missing something? I even confirmed this
with some trace_printk to generic and arch specific definitions of readl
and I see arch specific ones being called.
of the high-level interfaces. These predate the introduction of the
__io_{p,}{b,a}{r,w} macros and are currently only used on risc-v.
I think in this case you should start by changing arm64 to use the
generic readl() etc definitions, by removing the extra definitions and
using
#define __io_ar(v) __iormb(__v)
#define __io_bw() dma_wmb()