From: Hitoshi Mitake <h.mitake@gmail.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Andrew Morton <akpm@linux-foundation.org>,
Doug Thompson <norsk5@yahoo.com>,
dougthompson@xmission.com, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org
Subject: Re: [PATCH 1/1] edac x38: new MC driver module
Date: Fri, 21 Nov 2008 01:19:41 +0900 [thread overview]
Message-ID: <20081121011941.26e05a25.h.mitake@gmail.com> (raw)
In-Reply-To: <20081118123215.GB30509@flint.arm.linux.org.uk>
On Tue, 18 Nov 2008 12:32:15 +0000
Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> On Tue, Nov 18, 2008 at 12:16:20PM +0000, Ralf Baechle wrote:
> > On Sun, Nov 09, 2008 at 11:26:46AM -0800, Andrew Morton wrote:
> >
> > > Perhaps it would be better to have a CONFIG_ARCH_HAS_READQ and to then
> > > disable these drivers on the architectures which don't provide
> > > readq/writeq support.
> >
> > And we also need to define the exact semantics. Questions coming to mind:
> >
> > o are implementations performing 2 32-bit accesses acceptable?
> > o if so, what ordering for the two accesses is acceptable?
>
> and don't forget to document the semantics. If we're going to end up
> with CONFIG_ARCH_HAS_READQ which architectures can select, I suggest
> putting it in the help for that symbol. Why not another random file
> in Documentation/ ? Because it's a random file in Documentation/
> that'll be overlooked when someone decided to select ARCH_HAS_READQ.
> If it's along side the relevent config option, there is a higher
> chance it will be noticed.
>
Sorry for my late response...
I knew that implementing architecture-independed readq/writeq is too hard.
To check that implementation is good for every architecture and test that readq/writeq are
difficult works.
So I wrote patch in Andrew's way.
This patch adds ARCH_HAS_READQ to X86_32 and X86_64, adds ARCH_HAS_WRITEQ to X86_64
and adds readq() to X86_32 (writeq is yet).
I want someone to review it. If this patch is good enough, I'll write help document and more patch
adding ARCH_HAS_READQ and ARCH_HAS_WRITEQ to other architectre which has readq/writeq.
description of this patch: Adding config value to x86 architecture to determine existence of readq/writeq
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
---
arch/x86/Kconfig | 3 +++
arch/x86/include/asm/io.h | 8 ++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ac22bb7..8f3c949 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -11,9 +11,12 @@ config 64BIT
config X86_32
def_bool !64BIT
+ select ARCH_HAS_READQ
config X86_64
def_bool 64BIT
+ select ARCH_HAS_READQ
+ select ARCH_HAS_WRITEQ
### Arch settings
config X86
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index ac2abc8..2a8fc26 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -57,6 +57,14 @@ build_mmio_write(__writeq, "q", unsigned long, "r", )
/* Let people know we have them */
#define readq readq
#define writeq writeq
+
+#else /* CONFIG_X86_32 */
+
+static inline unsigned long readq(const volatile void __iomem *addr)
+{
+ return readl(addr) | (((u64)readl(addr + 4)) << 32);
+}
+
#endif
extern int iommu_bio_merge;
--
1.5.6.5
next prev parent reply other threads:[~2008-11-20 16:20 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-17 21:39 [PATCH 1/1] edac x38: new MC driver module dougthompson
2008-10-20 23:32 ` Andrew Morton
2008-11-05 22:29 ` Hitoshi Mitake
2008-11-05 16:26 ` Doug Thompson
2008-11-07 0:46 ` Andrew Morton
2008-11-07 15:28 ` Hitoshi Mitake
2008-11-07 6:31 ` Andrew Morton
2008-11-07 15:38 ` Hitoshi Mitake
2008-11-07 7:11 ` Andrew Morton
2008-11-09 15:10 ` Hitoshi Mitake
2008-11-09 19:26 ` Andrew Morton
2008-11-11 6:11 ` Paul Mundt
2008-11-13 15:15 ` Hitoshi Mitake
2008-11-18 12:16 ` Ralf Baechle
2008-11-18 12:32 ` Russell King
2008-11-20 16:19 ` Hitoshi Mitake [this message]
2008-11-23 23:52 ` H. Peter Anvin
2008-11-24 17:18 ` Luck, Tony
2008-11-24 18:02 ` H. Peter Anvin
2008-11-25 2:55 ` Hitoshi Mitake
2008-11-25 5:13 ` H. Peter Anvin
2008-11-25 15:30 ` Hitoshi Mitake
2008-11-25 15:46 ` Geert Uytterhoeven
2008-11-25 16:10 ` Hitoshi Mitake
2008-11-29 0:11 ` Hitoshi Mitake
-- strict thread matches above, loose matches on Subject: below --
2008-11-29 0:56 H. Peter Anvin
2008-11-29 7:47 ` Hitoshi Mitake
2008-11-29 9:38 ` Ingo Molnar
2008-11-29 10:26 ` Hitoshi Mitake
2008-11-29 10:52 ` Sam Ravnborg
2008-11-29 13:24 ` Hitoshi Mitake
2008-11-29 18:01 ` Sam Ravnborg
2008-11-30 8:16 ` Hitoshi Mitake
2008-11-30 8:37 ` Ingo Molnar
2008-11-30 9:24 ` Ingo Molnar
2008-11-30 15:20 ` Hitoshi Mitake
2008-11-30 16:15 ` Ingo Molnar
2008-12-01 13:51 ` Hitoshi Mitake
2008-12-01 13:59 ` Ingo Molnar
2008-12-01 23:58 ` Hitoshi Mitake
2008-12-04 15:58 ` Hitoshi Mitake
2009-01-16 1:24 ` Hitoshi Mitake
2009-02-21 10:11 ` Hitoshi Mitake
2009-02-21 10:39 ` Russell King
2009-02-21 13:09 ` Sam Ravnborg
2009-02-22 14:15 ` Hitoshi Mitake
2009-02-22 14:16 ` Hitoshi Mitake
2009-02-22 14:18 ` Hitoshi Mitake
2009-02-22 14:19 ` Hitoshi Mitake
2009-02-22 14:20 ` Hitoshi Mitake
2009-02-22 14:21 ` Hitoshi Mitake
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=20081121011941.26e05a25.h.mitake@gmail.com \
--to=h.mitake@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dougthompson@xmission.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=norsk5@yahoo.com \
--cc=ralf@linux-mips.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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