Skip to content

Commit 9683a64

Browse files
andy-shevIngo Molnar
authored andcommitted
x86/io: Make readq() / writeq() API consistent
Despite the following commit: 93093d0 ("x86: provide readq()/writeq() on 32-bit too, complete") which says: ...Also, map all the APIs to the strongest ordering variant. It's way too easy to mess such details up in drivers and the difference between "memory" and "" constrained asm() constructs is in the noise range. ... we have for now only one user of this API (i.e. writeq_relaxed() in drivers/hwtracing/intel_th/sth.c) on x86 and it does care about "relaxed" part of it. Moreover 32-bit support has been removed from that header, though appeared later in specific headers that emphasizes its non-atomic context. The rest should keep in mind a consistent picture of the __raw_IO() vs. IO() vs. IO_relaxed() API. Signed-off-by: Andy Shevchenko <[email protected]> Cc: Baolin Wang <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mika Westerberg <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent eabc2a7 commit 9683a64

File tree

1 file changed

+6
-4
lines changed
  • arch/x86/include/asm

1 file changed

+6
-4
lines changed

arch/x86/include/asm/io.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ build_mmio_write(__writel, "l", unsigned int, "r", )
9494
#ifdef CONFIG_X86_64
9595

9696
build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
97+
build_mmio_read(__readq, "q", unsigned long, "=r", )
9798
build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
99+
build_mmio_write(__writeq, "q", unsigned long, "r", )
98100

99-
#define readq_relaxed(a) readq(a)
100-
#define writeq_relaxed(v, a) writeq(v, a)
101+
#define readq_relaxed(a) __readq(a)
102+
#define writeq_relaxed(v, a) __writeq(v, a)
101103

102-
#define __raw_readq(a) readq(a)
103-
#define __raw_writeq(val, addr) writeq(val, addr)
104+
#define __raw_readq __readq
105+
#define __raw_writeq __writeq
104106

105107
/* Let people know that we have them */
106108
#define readq readq

0 commit comments

Comments
 (0)