Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1694599 > unrolled thread

[tip:x86/asm] x86/io: Make readq() / writeq() API consistent

Started bytip-bot for Andy Shevchenko <tipbot@zytor.com>
First post2017-07-24 12:30 +0200
Last post2017-07-24 12:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [tip:x86/asm] x86/io: Make readq() / writeq() API consistent tip-bot for Andy Shevchenko <tipbot@zytor.com> - 2017-07-24 12:30 +0200

#1694599 — [tip:x86/asm] x86/io: Make readq() / writeq() API consistent

Fromtip-bot for Andy Shevchenko <tipbot@zytor.com>
Date2017-07-24 12:30 +0200
Subject[tip:x86/asm] x86/io: Make readq() / writeq() API consistent
Message-ID<u6IMF-3rL-7@gated-at.bofh.it>
Commit-ID:  9683a64fc3cb67e663859a6bb2e0db5dcee9ed32
Gitweb:     http://git.kernel.org/tip/9683a64fc3cb67e663859a6bb2e0db5dcee9ed32
Author:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Fri, 30 Jun 2017 20:09:34 +0300
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 24 Jul 2017 11:18:21 +0200

x86/io: Make readq() / writeq() API consistent

Despite the following commit:

  93093d099e5d ("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 <andriy.shevchenko@linux.intel.com>
Cc: Baolin Wang <baolin.wang@spreadtrum.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-i2c@vger.kernel.org
Cc: wsa@the-dreams.de
Link: http://lkml.kernel.org/r/20170630170934.83028-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/io.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index b3bba2f..9ada93f 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -94,13 +94,15 @@ build_mmio_write(__writel, "l", unsigned int, "r", )
 #ifdef CONFIG_X86_64
 
 build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
+build_mmio_read(__readq, "q", unsigned long, "=r", )
 build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
+build_mmio_write(__writeq, "q", unsigned long, "r", )
 
-#define readq_relaxed(a)	readq(a)
-#define writeq_relaxed(v, a)	writeq(v, a)
+#define readq_relaxed(a)	__readq(a)
+#define writeq_relaxed(v, a)	__writeq(v, a)
 
-#define __raw_readq(a)		readq(a)
-#define __raw_writeq(val, addr)	writeq(val, addr)
+#define __raw_readq		__readq
+#define __raw_writeq		__writeq
 
 /* Let people know that we have them */
 #define readq			readq

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web