Re: About commit "io: change inX() to have their own IO barrier overrides"

From: John Garry
Date: Wed Mar 11 2020 - 12:13:05 EST


On 06/03/2020 16:43, John Garry wrote:
On 06/03/2020 16:29, Arnd Bergmann wrote:
The idea is good, but it would be nice if we just somehow use a common
asm-generic io.h definition directly in logic_pio.c, like:

asm-generic io.h:

#ifndef __raw_inw // name?
#define __raw_inw __raw_inw
static inline u16 __raw_inw(unsigned long addr)
{
ÂÂÂÂÂÂÂÂ u16 val;

ÂÂÂÂÂÂÂÂ __io_pbr();
ÂÂÂÂÂÂÂÂ val = __le16_to_cpu(__raw_readw(addr));
ÂÂÂÂÂÂÂÂ __io_par(val);
ÂÂÂÂÂÂÂÂ return val;
}
#endif

#include <linux/logic_pio.h>

#ifndef inw
#define inw __raw_inw
#endif
Yes, makes sense. Maybe __arch_inw() then? Not great either, but I think
that's better than __raw_inw() because __raw_* would sound like it
mirrors __raw_readl() that lacks the barriers and byteswaps.

Right, I had the same concern. And maybe the "arch" prefix is misleading. Just __inw could be ok, and hopefully not conflict with the arch/arm/mach-* definitions.


I think that it hasn't been mentioned already, but it looks like the outX methods also need the same treatment, from a7851aa54c.

thanks,
John