Skip to contentSkip to conversation

linux-next: build failure after merge of the asm-generic tree

PATCH Stephen Rothwell 3 participants 5 messages Sep 26, 2014 – Sep 30, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Arnd,

After merging the asm-generic tree, today's linux-next build (sparc defconfig) failed like this:

In file included from /scratch/sfr/next/include/linux/clocksource.h:19:0,

                 from /scratch/sfr/next/arch/sparc/include/asm/timer_32.h:11,
                 from /scratch/sfr/next/arch/sparc/include/asm/timer.h:6,
                 from /scratch/sfr/next/arch/sparc/kernel/sun4m_irq.c:14:

/scratch/sfr/next/arch/sparc/include/asm/io.h:14:0: error: "readb_relaxed" redefined [-Werror]
#define readb_relaxed(__addr) readb(__addr)
^
In file included from /scratch/sfr/next/arch/sparc/include/asm/io_32.h:13:0,

                 from /scratch/sfr/next/arch/sparc/include/asm/io.h:6,
                 from /scratch/sfr/next/include/linux/clocksource.h:19,
                 from /scratch/sfr/next/arch/sparc/include/asm/timer_32.h:11,
                 from /scratch/sfr/next/arch/sparc/include/asm/timer.h:6,
                 from /scratch/sfr/next/arch/sparc/kernel/sun4m_irq.c:14:

/scratch/sfr/next/include/asm-generic/io.h:182:0: note: this is the location of the previous definition
#define readb_relaxed readb
^

And so on several hundred times ... :-(

Caused by commits 95a668b0452e ("sparc: io: implement dummy relaxed accessor macros for writes") and 4c255791ffd6 ("asm-generic: io:
implement relaxed accessor macros as conditional wrappers").

arch/sparc/include/asm_32.h includes asm-generic/io.h which means it is include before the arch specific versions of the relaxed functions are defined ...

I have added this patch for today:

From: Stephen Rothwell <[email protected]>
Date: Fri, 26 Sep 2014 19:57:03 +1000
Subject: [PATCH] sparc: io: fix for asm-generic: io: implement relaxed
accessor macros as conditional wrappers

---
 arch/sparc/include/asm/io.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
arch/sparc/include/asm/io.h +6 -5
index 493f22c4684f..79b167674010 100644
@@ -1,10 +1,5 @@
 #ifndef ___ASM_SPARC_IO_H
 #define ___ASM_SPARC_IO_H
-#if defined(__sparc__) && defined(__arch64__)
-#include <asm/io_64.h>
-#else
-#include <asm/io_32.h>
-#endif
 
 /*
  * Defines used for both SPARC32 and SPARC64
@@ -19,6 +14,12 @@
 #define writew_relaxed(__w, __addr)	writew(__w, __addr)
 #define writel_relaxed(__l, __addr)	writel(__l, __addr)
 
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/io_64.h>
+#else
+#include <asm/io_32.h>
+#endif
+
 /* Big endian versions of memory read/write routines */
 #define readb_be(__addr)	__raw_readb(__addr)
 #define readw_be(__addr)	__raw_readw(__addr)
Signature · 5 lines
2.1.1

-- 
Cheers,
Stephen Rothwell                    [email protected]
#1 lore raw
Quoted 22 lines · Stephen Rothwell

After merging the asm-generic tree, today's linux-next build (sparc defconfig) failed like this:

In file included from /scratch/sfr/next/include/linux/clocksource.h:19:0,

                 from /scratch/sfr/next/arch/sparc/include/asm/timer_32.h:11,
                 from /scratch/sfr/next/arch/sparc/include/asm/timer.h:6,
                 from /scratch/sfr/next/arch/sparc/kernel/sun4m_irq.c:14:

/scratch/sfr/next/arch/sparc/include/asm/io.h:14:0: error: "readb_relaxed" redefined [-Werror]
#define readb_relaxed(__addr) readb(__addr)
^
In file included from /scratch/sfr/next/arch/sparc/include/asm/io_32.h:13:0,

                 from /scratch/sfr/next/arch/sparc/include/asm/io.h:6,
                 from /scratch/sfr/next/include/linux/clocksource.h:19,
                 from /scratch/sfr/next/arch/sparc/include/asm/timer_32.h:11,
                 from /scratch/sfr/next/arch/sparc/include/asm/timer.h:6,
                 from /scratch/sfr/next/arch/sparc/kernel/sun4m_irq.c:14:

/scratch/sfr/next/include/asm-generic/io.h:182:0: note: this is the location of the previous definition
#define readb_relaxed readb
^

And so on several hundred times ... :-(

Quoted 7 lines

Caused by commits 95a668b0452e ("sparc: io: implement dummy relaxed accessor macros for writes") and 4c255791ffd6 ("asm-generic: io:
implement relaxed accessor macros as conditional wrappers").

arch/sparc/include/asm_32.h includes asm-generic/io.h which means it is include before the arch specific versions of the relaxed functions are defined ...

Ah yes, Sam recently moved sparc32 over to asm-generic/io.h.

Quoted 28 lines

I have added this patch for today:

From: Stephen Rothwell <[email protected]>
Date: Fri, 26 Sep 2014 19:57:03 +1000
Subject: [PATCH] sparc: io: fix for asm-generic: io: implement relaxed
accessor macros as conditional wrappers

---
 arch/sparc/include/asm/io.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
arch/sparc/include/asm/io.h +0 -5
index 493f22c4684f..79b167674010 100644
@@ -1,10 +1,5 @@
 #ifndef ___ASM_SPARC_IO_H
 #define ___ASM_SPARC_IO_H
-#if defined(__sparc__) && defined(__arch64__)
-#include <asm/io_64.h>
-#else
-#include <asm/io_32.h>
-#endif
 
 /*
  * Defines used for both SPARC32 and SPARC64

arch/sparc/include/asm/io.h line 22

Quoted 9 lines
arch/sparc/include/asm/io.h +6 -0
@@ -19,6 +14,12 @@
 #define writew_relaxed(__w, __addr)	writew(__w, __addr)
 #define writel_relaxed(__l, __addr)	writel(__l, __addr)
 
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/io_64.h>
+#else
+#include <asm/io_32.h>
+#endif
+

This patch looks fine to me. Arnd, can you pick this up please?

Thanks,

Will

#2 lore raw
Quoted 29 lines · On Friday 26 September 2014 11:53:33 Will Deacon wrote:
Quoted 29 lines

From: Stephen Rothwell <[email protected]>
Date: Fri, 26 Sep 2014 19:57:03 +1000
Subject: [PATCH] sparc: io: fix for asm-generic: io: implement relaxed
accessor macros as conditional wrappers

---
 arch/sparc/include/asm/io.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
arch/sparc/include/asm/io.h +0 -5
index 493f22c4684f..79b167674010 100644
@@ -1,10 +1,5 @@
 #ifndef ___ASM_SPARC_IO_H
 #define ___ASM_SPARC_IO_H
-#if defined(__sparc__) && defined(__arch64__)
-#include <asm/io_64.h>
-#else
-#include <asm/io_32.h>
-#endif
 
 /*
  * Defines used for both SPARC32 and SPARC64
@@ -19,6 +14,12 @@
 #define writew_relaxed(__w, __addr)  writew(__w, __addr)
 #define writel_relaxed(__l, __addr)  writel(__l, __addr)
 
Quoted 9 lines

arch/sparc/include/asm/io.h line 22

Quoted 6 lines
arch/sparc/include/asm/io.h +6 -0
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/io_64.h>
+#else
+#include <asm/io_32.h>
+#endif
+

This patch looks fine to me. Arnd, can you pick this up please?

Thanks, applied on top with Stephen's full report in the commit message and your Ack.

If David and Sam prefer, I could also do the patch below instead. As sparc32 already uses the asm-generic header, it doesn't really need the extra definitions, and they essentially become sparc64-only.

I've picked Stephen's version for now, since it's known to build in the configurations he tests and has Will's Ack.

Arnd

arch/sparc/include/asm/io.h +0 -9
index 493f22c4684f..f6902cf3cbe9 100644
@@ -10,15 +10,6 @@
  * Defines used for both SPARC32 and SPARC64
  */
 
-/* Relaxed accessors for MMIO */
-#define readb_relaxed(__addr)		readb(__addr)
-#define readw_relaxed(__addr)		readw(__addr)
-#define readl_relaxed(__addr)		readl(__addr)
-
-#define writeb_relaxed(__b, __addr)	writeb(__b, __addr)
-#define writew_relaxed(__w, __addr)	writew(__w, __addr)
-#define writel_relaxed(__l, __addr)	writel(__l, __addr)
-
 /* Big endian versions of memory read/write routines */
 #define readb_be(__addr)	__raw_readb(__addr)
 #define readw_be(__addr)	__raw_readw(__addr)
arch/sparc/include/asm/io_64.h +9 -0
index d50e6127325d..e03df49e0dd8 100644
@@ -412,6 +412,15 @@ static inline void iounmap(volatile void __iomem *addr)
 #define iowrite32(val,X)		writel(val,X)
 #define iowrite32be(val,X)		__raw_writel(val,X)
 
+/* Relaxed accessors for MMIO */
+#define readb_relaxed(__addr)		readb(__addr)
+#define readw_relaxed(__addr)		readw(__addr)
+#define readl_relaxed(__addr)		readl(__addr)
+
+#define writeb_relaxed(__b, __addr)	writeb(__b, __addr)
+#define writew_relaxed(__w, __addr)	writew(__w, __addr)
+#define writel_relaxed(__l, __addr)	writel(__l, __addr)
+
 /* Create a virtual mapping cookie for an IO port range */
 void __iomem *ioport_map(unsigned long port, unsigned int nr);
 void ioport_unmap(void __iomem *);
#3 lore raw

Hi Arnd,

Quoted 3 lines · On Fri, 26 Sep 2014 13:14:45 +0200 Arnd Bergmann <[email protected]> wrote:

Thanks, applied on top with Stephen's full report in the commit message and your Ack.

I look at your tree today, and its empty ... just checking that you didn't forget to push or something.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#4 lore raw
Quoted 10 lines · On Tuesday 30 September 2014 08:31:16 Stephen Rothwell wrote:

Hi Arnd,

Quoted 3 lines · On Fri, 26 Sep 2014 13:14:45 +0200 Arnd Bergmann <[email protected]> wrote:

Thanks, applied on top with Stephen's full report in the commit message and your Ack.

I look at your tree today, and its empty ... just checking that you didn't forget to push or something.

Thanks for the notification. I got overloaded with regressions and ended up backing it all out for now. I still hope to get the subset that Will did merged, but first need to split out some or all of Thierry's patches that caused the regressions.

Arnd