From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org,
Baolin Wang <baolin.wang@spreadtrum.com>,
wsa@the-dreams.de, linux-i2c@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 5/5] x86/io: Make readq() / writeq() API consistent
Date: Fri, 30 Jun 2017 20:09:34 +0300 [thread overview]
Message-ID: <20170630170934.83028-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20170630170934.83028-1-andriy.shevchenko@linux.intel.com>
Despite the commit 93093d099e5d
x86: provide readq()/writeq() on 32-bit too, complete
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 consistent picture of __raw_IO() vs. IO()
vs. IO_relaxed() API.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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 b3bba2f87e18..9ada93f01524 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
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-06-30 17:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 17:09 [PATCH v2 0/5] x86/io: Rely on asm-generic/io.h Andy Shevchenko
2017-06-30 17:09 ` [PATCH v2 1/5] x86/io: Define IO accessors by preprocessor Andy Shevchenko
2017-06-30 17:09 ` [PATCH v2 2/5] x86/io: Include asm-generic/io.h to architectural code Andy Shevchenko
2017-06-30 17:09 ` [PATCH v2 3/5] x86/io: Remove mem*io() duplications Andy Shevchenko
2017-06-30 17:09 ` [PATCH v2 4/5] x86/io: Remove xlate_dev_kmem_ptr() duplication Andy Shevchenko
2017-06-30 17:09 ` Andy Shevchenko [this message]
2017-07-18 15:52 ` [PATCH v2 0/5] x86/io: Rely on asm-generic/io.h Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170630170934.83028-6-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=baolin.wang@spreadtrum.com \
--cc=hpa@zytor.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=wsa@the-dreams.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).