diff options
author | Sinan Kaya <okaya@codeaurora.org> | 2018-04-05 09:09:13 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2018-04-06 06:02:13 -0400 |
commit | 87fe2d543f817300e13f0ea683f38c122737856e (patch) | |
tree | 2004868de5dde731d7fa663b9ed0afe67f8d77c1 | |
parent | a7851aa54c0cdd2f62457b72aee0da5d5586e514 (diff) |
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: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | include/asm-generic/io.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 53226d907c45..578b6883dd6a 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -433,7 +433,12 @@ static inline void writesq(volatile void __iomem *addr, const void *buffer, | |||
433 | #define inb inb | 433 | #define inb inb |
434 | static inline u8 inb(unsigned long addr) | 434 | static inline u8 inb(unsigned long addr) |
435 | { | 435 | { |
436 | return readb(PCI_IOBASE + addr); | 436 | u8 val; |
437 | |||
438 | __io_pbr(); | ||
439 | val = __raw_readb(PCI_IOBASE + addr); | ||
440 | __io_par(); | ||
441 | return val; | ||
437 | } | 442 | } |
438 | #endif | 443 | #endif |
439 | 444 | ||
@@ -441,7 +446,12 @@ static inline u8 inb(unsigned long addr) | |||
441 | #define inw inw | 446 | #define inw inw |
442 | static inline u16 inw(unsigned long addr) | 447 | static inline u16 inw(unsigned long addr) |
443 | { | 448 | { |
444 | return readw(PCI_IOBASE + addr); | 449 | u16 val; |
450 | |||
451 | __io_pbr(); | ||
452 | val = __le16_to_cpu(__raw_readw(PCI_IOBASE + addr)); | ||
453 | __io_par(); | ||
454 | return val; | ||
445 | } | 455 | } |
446 | #endif | 456 | #endif |
447 | 457 | ||
@@ -449,7 +459,12 @@ static inline u16 inw(unsigned long addr) | |||
449 | #define inl inl | 459 | #define inl inl |
450 | static inline u32 inl(unsigned long addr) | 460 | static inline u32 inl(unsigned long addr) |
451 | { | 461 | { |
452 | return readl(PCI_IOBASE + addr); | 462 | u32 val; |
463 | |||
464 | __io_pbr(); | ||
465 | val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr)); | ||
466 | __io_par(); | ||
467 | return val; | ||
453 | } | 468 | } |
454 | #endif | 469 | #endif |
455 | 470 | ||