linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH 1/1] edac x38: new MC driver module
@ 2008-11-29  0:56 H. Peter Anvin
  2008-11-29  7:47 ` Hitoshi Mitake
  0 siblings, 1 reply; 43+ messages in thread
From: H. Peter Anvin @ 2008-11-29  0:56 UTC (permalink / raw)
  To: Hitoshi Mitake
  Cc: Geert Uytterhoeven, Luck, Tony, Russell King, Ralf Baechle,
	Andrew Morton, Doug Thompson, dougthompson, linux-kernel,
	linux-arch

The cast is unnecessary; one can argue for a cast to (u32) for clarity, but personally I think writel() is a clear enough especialy given the context.

-- 
Sent from my mobile phone (pardon any lack of formatting)


-----Original Message-----
From: Hitoshi Mitake <h.mitake@gmail.com>
Sent: Friday, November 28, 2008 16:11
To: Hitoshi Mitake <h.mitake@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>; H. Peter Anvin <hpa@zytor.com>; Luck, Tony <tony.luck@intel.com>; Russell King <rmk+lkml@arm.linux.org.uk>; Ralf Baechle <ralf@linux-mips.org>; Andrew Morton <akpm@linux-foundation.org>; Doug Thompson <norsk5@yahoo.com>; dougthompson@xmission.com <dougthompson@xmission.com>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; linux-arch@vger.kernel.org <linux-arch@vger.kernel.org>
Subject: Re: [PATCH 1/1] edac x38: new MC driver module

On Wed, 26 Nov 2008 01:10:59 +0900
Hitoshi Mitake <h.mitake@gmail.com> wrote:

> On Tue, 25 Nov 2008 16:46:18 +0100 (CET)
> Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> 
> > On Wed, 26 Nov 2008, Hitoshi Mitake wrote:
> > > On Mon, 24 Nov 2008 21:13:58 -0800
> > > "H. Peter Anvin" <hpa@zytor.com> wrote:
> > > > Are you planning to add writeq() as well?
> > > 
> > > Yes, I want to add writeq().
> > > But there's a problem that
> > > I don't have a plan to use writeq() now, so I can't test writeq() soon.
> > > 
> > > How is this? I think it isn't bad. I want to hear your opinion.
> > > 
> > > static inline void writeq(__u64 val, volatile void __iomem *addr)
> > > {
> > > 	writel((unsigned int)val, addr);
> > > 	writel((unsigned int)(val >> 32), addr+1);
> >                                                ^
> > 					       4
> > 
> > > }
> > 
> 
> Thanks, I missed about void pointer...
> 

I rewrote the patch. I think newest version is good enough.
Could you please review this?

description of this patch
Adding implementation of readq/writeq to x86_32,
and adding config value to x86 architecture to determine existence of readq/writeq

Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
---
 arch/x86/Kconfig          |    4 ++++
 arch/x86/include/asm/io.h |   24 ++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ac22bb7..10bd84c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -11,9 +11,13 @@ config 64BIT
 
 config X86_32
 	def_bool !64BIT
+	select ARCH_HAS_READQ
+	select ARCH_HAS_WRITEQ
 
 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..ac15d0e 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -4,6 +4,7 @@
 #define ARCH_HAS_IOREMAP_WC
 
 #include <linux/compiler.h>
+#include <asm-generic/int-ll64.h>
 
 #define build_mmio_read(name, size, type, reg, barrier) \
 static inline type name(const volatile void __iomem *addr) \
@@ -57,6 +58,29 @@ build_mmio_write(__writeq, "q", unsigned long, "r", )
 /* Let people know we have them */
 #define readq readq
 #define writeq writeq
+
+#else  /* CONFIG_X86_32 from here */
+
+static inline __u64 readq(const volatile void __iomem *addr)
+{
+	const volatile u32 __iomem *p = addr;
+	u32 l, h;
+
+	l = readl(p);
+	h = readl(p+1);
+
+	return l + ((u64)h << 32);
+}
+
+static inline void writeq(__u64 val, volatile void __iomem *addr)
+{
+	writel((unsigned int)val, addr);
+	writel((unsigned int)(val >> 32), addr+4);
+}
+
+#define readq readq
+#define writeq writeq
+
 #endif
 
 extern int iommu_bio_merge;
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 43+ messages in thread
[parent not found: <20081105222911.d76e7e1c.mitake@clustcom.com>]

end of thread, other threads:[~2009-02-22 14:21 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-29  0:56 [PATCH 1/1] edac x38: new MC driver module 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  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-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:16                                   ` Hitoshi Mitake
2009-02-22 14:18                                 ` 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
     [not found] <20081105222911.d76e7e1c.mitake@clustcom.com>
     [not found] ` <413709.12821.qm@web50106.mail.re2.yahoo.com>
     [not found]   ` <20081106164641.ed369060.akpm@linux-foundation.org>
     [not found]     ` <20081107152830.a42766f3.mitake@clustcom.com>
     [not found]       ` <20081106223122.8a255211.akpm@linux-foundation.org>
     [not found]         ` <20081107153824.0ec934e6.mitake@clustcom.com>
     [not found]           ` <20081106231102.aab83cd4.akpm@linux-foundation.org>
     [not found]             ` <a6b9f31a0811090710y17e956bawf20675d6678b145e@mail.gmail.com>
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
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

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).