Skip to contentSkip to conversation

Openrisc fixes for 4.11

PATCH In review Stafford Horne 2 participants 6 messages Mar 14, 2017 Openrisc architecture

lore
Share & tools
lore

Stafford Horne

author maintainer
#0 lore raw

cover Openrisc fixes for 4.11

Hello,

These are a few compile error and warning fixes which were pointed out after the 4.11 code was merged.

Most of these could be found at this kbuild failure here:

https://lkml.org/lkml/2017/3/9/976

The rest I found with some local testing.

Stafford Horne (3):
openrisc: xchg: fix computed is not used warning
openrisc: fix issue handling 8 byte get_user calls
openrisc: Export symbols needed by modules

 arch/openrisc/include/asm/cmpxchg.h | 8 ++++++--
 arch/openrisc/include/asm/uaccess.h | 2 +-
 arch/openrisc/kernel/or32_ksyms.c   | 5 +++++
 arch/openrisc/kernel/process.c      | 1 +
 4 files changed, 13 insertions(+), 3 deletions(-)
Signature · 1 line
2.9.3
author maintainer
#1 lore raw

PATCH 1/3 openrisc: xchg: fix `computed is not used` warning

When building allmodconfig this warning shows.

fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
./arch/openrisc/include/asm/cmpxchg.h:81:3: warning: value computed is not used [-Wunused-value]

    ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
     ^

Applying the same patch logic that was done to the cmpxchg macro.

---
 arch/openrisc/include/asm/cmpxchg.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/openrisc/include/asm/cmpxchg.h +6 -2
index 5fcb9ac..f0a5d8b 100644
@@ -77,7 +77,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
 	return val;
 }
 
-#define xchg(ptr, with) \
-	((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
+#define xchg(ptr, with) 						\
+	({								\
+		(__typeof__(*(ptr))) __xchg((unsigned long)(with),	\
+					    (ptr),			\
+					    sizeof(*(ptr)));		\
+	})
 
 #endif /* __ASM_OPENRISC_CMPXCHG_H */
Signature · 1 line
2.9.3
author maintainer
#2 lore raw

PATCH 2/3 openrisc: fix issue handling 8 byte get_user calls

In reply to Stafford Horne

Was getting the following error with allmodconfig:

ERROR: "__get_user_bad" [lib/test_user_copy.ko] undefined!

This was simply a missing break statement, causing an unwanted fall through.

---
 arch/openrisc/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/openrisc/include/asm/uaccess.h +1 -1
index 140faa1..1311e6b 100644
@@ -211,7 +211,7 @@ do {									\
 	case 1: __get_user_asm(x, ptr, retval, "l.lbz"); break;		\
 	case 2: __get_user_asm(x, ptr, retval, "l.lhz"); break;		\
 	case 4: __get_user_asm(x, ptr, retval, "l.lwz"); break;		\
-	case 8: __get_user_asm2(x, ptr, retval);			\
+	case 8: __get_user_asm2(x, ptr, retval); break;			\
 	default: (x) = __get_user_bad();				\
 	}								\
 } while (0)
Signature · 1 line
2.9.3
author maintainer
#3 lore raw

PATCH 3/3 openrisc: Export symbols needed by modules

In reply to Stafford Horne

This was detected by allmodconfig, errors reported:

ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
ERROR: "empty_zero_page" [fs/nfs/objlayout/objlayoutdriver.ko] undefined!
ERROR: "empty_zero_page" [fs/exofs/exofs.ko] undefined!
ERROR: "empty_zero_page" [fs/crypto/fscrypto.ko] undefined!
ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!
ERROR: "pm_power_off" [drivers/regulator/act8865-regulator.ko] undefined!

---
 arch/openrisc/kernel/or32_ksyms.c | 5 +++++
 arch/openrisc/kernel/process.c    | 1 +
 2 files changed, 6 insertions(+)
arch/openrisc/kernel/or32_ksyms.c +5 -0
index 5c4695d..2842979 100644
@@ -42,6 +42,11 @@ DECLARE_EXPORT(__muldi3);
 DECLARE_EXPORT(__ashrdi3);
 DECLARE_EXPORT(__ashldi3);
 DECLARE_EXPORT(__lshrdi3);
+DECLARE_EXPORT(__ucmpdi2);
+
+extern unsigned long empty_zero_page[2048];
+EXPORT_SYMBOL(empty_zero_page);
 
 EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__clear_user);
 EXPORT_SYMBOL(memset);
arch/openrisc/kernel/process.c +1 -0
index 828a291..f8da545 100644
@@ -90,6 +90,7 @@ void arch_cpu_idle(void)
 }
 
 void (*pm_power_off) (void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
 
 /*
  * When a process does an "exec", machine state like FPU and debug
Signature · 1 line
2.9.3
#4 lore raw

Re: [OpenRISC] [PATCH 3/3] openrisc: Export symbols needed by modules

Hi Stafford,

Quoted 15 lines · Stafford Horne

This was detected by allmodconfig, errors reported:

ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
ERROR: "empty_zero_page" [fs/nfs/objlayout/objlayoutdriver.ko] undefined!
ERROR: "empty_zero_page" [fs/exofs/exofs.ko] undefined!
ERROR: "empty_zero_page" [fs/crypto/fscrypto.ko] undefined!
ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!
ERROR: "pm_power_off" [drivers/regulator/act8865-regulator.ko] undefined!

arch/openrisc/kernel/or32_ksyms.c DECLARE_EXPORT(__muldi3); · line 47

Quoted 6 lines
arch/openrisc/kernel/or32_ksyms.c +3 -0
@@ -42,6 +42,11 @@ DECLARE_EXPORT(__muldi3);
 DECLARE_EXPORT(__ashrdi3);
 DECLARE_EXPORT(__ashldi3);
 DECLARE_EXPORT(__lshrdi3);
+DECLARE_EXPORT(__ucmpdi2);
+
+extern unsigned long empty_zero_page[2048];

Can't you #include <asm/pgtable.h> instead of adding a forward declaration?

arch/openrisc/kernel/or32_ksyms.c DECLARE_EXPORT(__muldi3); · line 48

Quoted 1 line
arch/openrisc/kernel/or32_ksyms.c +1 -0
+EXPORT_SYMBOL(empty_zero_page);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#5 lore raw

Re: [OpenRISC] [PATCH 3/3] openrisc: Export symbols needed by modules

Quoted 15 lines · Geert Uytterhoeven

Hi Stafford,

Quoted 11 lines · Stafford Horne

This was detected by allmodconfig, errors reported:

ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
ERROR: "empty_zero_page" [fs/nfs/objlayout/objlayoutdriver.ko] undefined!
ERROR: "empty_zero_page" [fs/exofs/exofs.ko] undefined!
ERROR: "empty_zero_page" [fs/crypto/fscrypto.ko] undefined!
ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!
ERROR: "pm_power_off" [drivers/regulator/act8865-regulator.ko] undefined!

Quoted 12 lines

arch/openrisc/kernel/or32_ksyms.c DECLARE_EXPORT(__muldi3); · line 47

Quoted 9 lines
arch/openrisc/kernel/or32_ksyms.c +3 -0
@@ -42,6 +42,11 @@ DECLARE_EXPORT(__muldi3);
 DECLARE_EXPORT(__ashrdi3);
 DECLARE_EXPORT(__ashldi3);
 DECLARE_EXPORT(__lshrdi3);
+DECLARE_EXPORT(__ucmpdi2);
+
+extern unsigned long empty_zero_page[2048];

Can't you #include <asm/pgtable.h> instead of adding a forward declaration?

Right, I can do this.

In the end I was hoping to convert empty_zero_page to be more like parisc. which would put something like this mm/init.c

  unsigned long *empty_zero_page __read_mostly;
  EXPORT_SYMBOL(empty_zero_page);

  in init {
    empty_zero_page = get_memblock(PAGE_SIZE);
  }

But I was going to wait until 4.12 for that change.

-Stafford

Quoted 12 lines

arch/openrisc/kernel/or32_ksyms.c DECLARE_EXPORT(__muldi3); · line 48

Quoted 1 line
arch/openrisc/kernel/or32_ksyms.c +1 -0
+EXPORT_SYMBOL(empty_zero_page);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds