All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fixes for ARCH=hexagon allmodconfig
@ 2021-11-15 17:42 Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 1/3] hexagon: Export raw I/O routines for modules Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-11-15 17:42 UTC (permalink / raw)
  To: Andrew Morton, Brian Cain
  Cc: linux-hexagon, Nick Desaulniers, linux-kernel, llvm, Nathan Chancellor

This series fixes some issues noticed with ARCH=hexagon allmodconfig.

The first two patches were previously sent as individual patches but it
makes sense to bundle them together after CONFIG_WERROR as they are both
required to fix the build.

The third patch is new, I only noticed it when building "normally", as
opposed to with O=...

I would like to see these merged into mainline sooner rather than later
since I initially sent them in July.

v1 -> v2:

https://lore.kernel.org/r/20210708233849.3140194-1-nathan@kernel.org/
https://lore.kernel.org/r/20210728001729.1960182-1-nathan@kernel.org/

* Add patch 3.
* Add Brian Cain's ack on patches 1 and 2.
* The warning in patch 2 is now an error because CONFIG_WERROR is
  enabled with allmodconfig.
* Add stable CC for patches 1 and 2 because they fix build errors.

Nathan Chancellor (3):
  hexagon: Export raw I/O routines for modules
  hexagon: Clean up timer-regs.h
  hexagon: Ignore vmlinux.lds

 arch/hexagon/include/asm/timer-regs.h | 26 --------------------------
 arch/hexagon/include/asm/timex.h      |  3 +--
 arch/hexagon/kernel/.gitignore        |  1 +
 arch/hexagon/kernel/time.c            | 12 ++++++++++--
 arch/hexagon/lib/io.c                 |  4 ++++
 5 files changed, 16 insertions(+), 30 deletions(-)
 delete mode 100644 arch/hexagon/include/asm/timer-regs.h
 create mode 100644 arch/hexagon/kernel/.gitignore


base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
-- 
2.34.0.rc0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/3] hexagon: Export raw I/O routines for modules
  2021-11-15 17:42 [PATCH v2 0/3] Fixes for ARCH=hexagon allmodconfig Nathan Chancellor
@ 2021-11-15 17:42 ` Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 2/3] hexagon: Clean up timer-regs.h Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 3/3] hexagon: Ignore vmlinux.lds Nathan Chancellor
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-11-15 17:42 UTC (permalink / raw)
  To: Andrew Morton, Brian Cain
  Cc: linux-hexagon, Nick Desaulniers, linux-kernel, llvm,
	Nathan Chancellor, stable

When building ARCH=hexagon allmodconfig, the following errors occur:

ERROR: modpost: "__raw_readsl" [drivers/i3c/master/svc-i3c-master.ko] undefined!
ERROR: modpost: "__raw_writesl" [drivers/i3c/master/dw-i3c-master.ko] undefined!
ERROR: modpost: "__raw_readsl" [drivers/i3c/master/dw-i3c-master.ko] undefined!
ERROR: modpost: "__raw_writesl" [drivers/i3c/master/i3c-master-cdns.ko] undefined!
ERROR: modpost: "__raw_readsl" [drivers/i3c/master/i3c-master-cdns.ko] undefined!

Export these symbols so that modules can use them without any errors.

Cc: stable@vger.kernel.org
Fixes: 013bf24c3829 ("Hexagon: Provide basic implementation and/or stubs for I/O routines.")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Brian Cain <bcain@codeaurora.org>
---
 arch/hexagon/lib/io.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/hexagon/lib/io.c b/arch/hexagon/lib/io.c
index d35d69d6588c..55f75392857b 100644
--- a/arch/hexagon/lib/io.c
+++ b/arch/hexagon/lib/io.c
@@ -27,6 +27,7 @@ void __raw_readsw(const void __iomem *addr, void *data, int len)
 		*dst++ = *src;
 
 }
+EXPORT_SYMBOL(__raw_readsw);
 
 /*
  * __raw_writesw - read words a short at a time
@@ -47,6 +48,7 @@ void __raw_writesw(void __iomem *addr, const void *data, int len)
 
 
 }
+EXPORT_SYMBOL(__raw_writesw);
 
 /*  Pretty sure len is pre-adjusted for the length of the access already */
 void __raw_readsl(const void __iomem *addr, void *data, int len)
@@ -62,6 +64,7 @@ void __raw_readsl(const void __iomem *addr, void *data, int len)
 
 
 }
+EXPORT_SYMBOL(__raw_readsl);
 
 void __raw_writesl(void __iomem *addr, const void *data, int len)
 {
@@ -76,3 +79,4 @@ void __raw_writesl(void __iomem *addr, const void *data, int len)
 
 
 }
+EXPORT_SYMBOL(__raw_writesl);
-- 
2.34.0.rc0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 2/3] hexagon: Clean up timer-regs.h
  2021-11-15 17:42 [PATCH v2 0/3] Fixes for ARCH=hexagon allmodconfig Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 1/3] hexagon: Export raw I/O routines for modules Nathan Chancellor
@ 2021-11-15 17:42 ` Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 3/3] hexagon: Ignore vmlinux.lds Nathan Chancellor
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-11-15 17:42 UTC (permalink / raw)
  To: Andrew Morton, Brian Cain
  Cc: linux-hexagon, Nick Desaulniers, linux-kernel, llvm,
	Nathan Chancellor, stable

When building allmodconfig, there is a warning about TIMER_ENABLE being
redefined:

 drivers/clocksource/timer-oxnas-rps.c:39:9: error: 'TIMER_ENABLE' macro redefined [-Werror,-Wmacro-redefined]
 #define TIMER_ENABLE            BIT(7)
         ^
 ./arch/hexagon/include/asm/timer-regs.h:13:9: note: previous definition is here
 #define TIMER_ENABLE            0
         ^
 1 error generated.

The values in this header are only used in one file each, if they are
used at all. Remove the header and sink all of the constants into their
respective files.

TCX0_CLK_RATE is only used in arch/hexagon/include/asm/timex.h

TIMER_ENABLE, RTOS_TIMER_INT, RTOS_TIMER_REGS_ADDR are only used in
arch/hexagon/kernel/time.c.

SLEEP_CLK_RATE and TIMER_CLR_ON_MATCH have both been unused since the
file's introduction in commit 71e4a47f32f4 ("Hexagon: Add time and timer
functions").

TIMER_ENABLE is redefined as BIT(0) so the shift is moved into the
definition, rather than its use.

Cc: stable@vger.kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Brian Cain <bcain@codeaurora.org>
---
 arch/hexagon/include/asm/timer-regs.h | 26 --------------------------
 arch/hexagon/include/asm/timex.h      |  3 +--
 arch/hexagon/kernel/time.c            | 12 ++++++++++--
 3 files changed, 11 insertions(+), 30 deletions(-)
 delete mode 100644 arch/hexagon/include/asm/timer-regs.h

diff --git a/arch/hexagon/include/asm/timer-regs.h b/arch/hexagon/include/asm/timer-regs.h
deleted file mode 100644
index ee6c61423a05..000000000000
--- a/arch/hexagon/include/asm/timer-regs.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Timer support for Hexagon
- *
- * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- */
-
-#ifndef _ASM_TIMER_REGS_H
-#define _ASM_TIMER_REGS_H
-
-/*  This stuff should go into a platform specific file  */
-#define TCX0_CLK_RATE		19200
-#define TIMER_ENABLE		0
-#define TIMER_CLR_ON_MATCH	1
-
-/*
- * 8x50 HDD Specs 5-8.  Simulator co-sim not fixed until
- * release 1.1, and then it's "adjustable" and probably not defaulted.
- */
-#define RTOS_TIMER_INT		3
-#ifdef CONFIG_HEXAGON_COMET
-#define RTOS_TIMER_REGS_ADDR	0xAB000000UL
-#endif
-#define SLEEP_CLK_RATE		32000
-
-#endif
diff --git a/arch/hexagon/include/asm/timex.h b/arch/hexagon/include/asm/timex.h
index 8d4ec76fceb4..dfe69e118b2b 100644
--- a/arch/hexagon/include/asm/timex.h
+++ b/arch/hexagon/include/asm/timex.h
@@ -7,11 +7,10 @@
 #define _ASM_TIMEX_H
 
 #include <asm-generic/timex.h>
-#include <asm/timer-regs.h>
 #include <asm/hexagon_vm.h>
 
 /* Using TCX0 as our clock.  CLOCK_TICK_RATE scheduled to be removed. */
-#define CLOCK_TICK_RATE              TCX0_CLK_RATE
+#define CLOCK_TICK_RATE              19200
 
 #define ARCH_HAS_READ_CURRENT_TIMER
 
diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index feffe527ac92..febc95714d75 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -17,9 +17,10 @@
 #include <linux/of_irq.h>
 #include <linux/module.h>
 
-#include <asm/timer-regs.h>
 #include <asm/hexagon_vm.h>
 
+#define TIMER_ENABLE		BIT(0)
+
 /*
  * For the clocksource we need:
  *	pcycle frequency (600MHz)
@@ -33,6 +34,13 @@ cycles_t	pcycle_freq_mhz;
 cycles_t	thread_freq_mhz;
 cycles_t	sleep_clk_freq;
 
+/*
+ * 8x50 HDD Specs 5-8.  Simulator co-sim not fixed until
+ * release 1.1, and then it's "adjustable" and probably not defaulted.
+ */
+#define RTOS_TIMER_INT		3
+#define RTOS_TIMER_REGS_ADDR	0xAB000000UL
+
 static struct resource rtos_timer_resources[] = {
 	{
 		.start	= RTOS_TIMER_REGS_ADDR,
@@ -80,7 +88,7 @@ static int set_next_event(unsigned long delta, struct clock_event_device *evt)
 	iowrite32(0, &rtos_timer->clear);
 
 	iowrite32(delta, &rtos_timer->match);
-	iowrite32(1 << TIMER_ENABLE, &rtos_timer->enable);
+	iowrite32(TIMER_ENABLE, &rtos_timer->enable);
 	return 0;
 }
 
-- 
2.34.0.rc0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 3/3] hexagon: Ignore vmlinux.lds
  2021-11-15 17:42 [PATCH v2 0/3] Fixes for ARCH=hexagon allmodconfig Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 1/3] hexagon: Export raw I/O routines for modules Nathan Chancellor
  2021-11-15 17:42 ` [PATCH v2 2/3] hexagon: Clean up timer-regs.h Nathan Chancellor
@ 2021-11-15 17:42 ` Nathan Chancellor
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-11-15 17:42 UTC (permalink / raw)
  To: Andrew Morton, Brian Cain
  Cc: linux-hexagon, Nick Desaulniers, linux-kernel, llvm, Nathan Chancellor

After building allmodconfig, there is an untracked vmlinux.lds file in
arch/hexagon/kernel:

$ git ls-files . --exclude-standard --others
arch/hexagon/kernel/vmlinux.lds

Ignore it as all other architectures have.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/.gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 arch/hexagon/kernel/.gitignore

diff --git a/arch/hexagon/kernel/.gitignore b/arch/hexagon/kernel/.gitignore
new file mode 100644
index 000000000000..c5f676c3c224
--- /dev/null
+++ b/arch/hexagon/kernel/.gitignore
@@ -0,0 +1 @@
+vmlinux.lds
-- 
2.34.0.rc0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-15 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 17:42 [PATCH v2 0/3] Fixes for ARCH=hexagon allmodconfig Nathan Chancellor
2021-11-15 17:42 ` [PATCH v2 1/3] hexagon: Export raw I/O routines for modules Nathan Chancellor
2021-11-15 17:42 ` [PATCH v2 2/3] hexagon: Clean up timer-regs.h Nathan Chancellor
2021-11-15 17:42 ` [PATCH v2 3/3] hexagon: Ignore vmlinux.lds Nathan Chancellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.