Commit 87fe2d54 authored by Sinan Kaya's avatar Sinan Kaya Committed by Arnd Bergmann

io: change inX() to have their own IO barrier overrides

Open code readX() inside inX() so that inX() variants have their own
overrideable Port IO barrier combinations as __io_pbr() and __io_par() for
actions to be taken before port IO and after port IO read.
Signed-off-by: default avatarSinan Kaya <okaya@codeaurora.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent a7851aa5
...@@ -433,7 +433,12 @@ static inline void writesq(volatile void __iomem *addr, const void *buffer, ...@@ -433,7 +433,12 @@ static inline void writesq(volatile void __iomem *addr, const void *buffer,
#define inb inb #define inb inb
static inline u8 inb(unsigned long addr) static inline u8 inb(unsigned long addr)
{ {
return readb(PCI_IOBASE + addr); u8 val;
__io_pbr();
val = __raw_readb(PCI_IOBASE + addr);
__io_par();
return val;
} }
#endif #endif
...@@ -441,7 +446,12 @@ static inline u8 inb(unsigned long addr) ...@@ -441,7 +446,12 @@ static inline u8 inb(unsigned long addr)
#define inw inw #define inw inw
static inline u16 inw(unsigned long addr) static inline u16 inw(unsigned long addr)
{ {
return readw(PCI_IOBASE + addr); u16 val;
__io_pbr();
val = __le16_to_cpu(__raw_readw(PCI_IOBASE + addr));
__io_par();
return val;
} }
#endif #endif
...@@ -449,7 +459,12 @@ static inline u16 inw(unsigned long addr) ...@@ -449,7 +459,12 @@ static inline u16 inw(unsigned long addr)
#define inl inl #define inl inl
static inline u32 inl(unsigned long addr) static inline u32 inl(unsigned long addr)
{ {
return readl(PCI_IOBASE + addr); u32 val;
__io_pbr();
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
__io_par();
return val;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment