public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: vpe-mt: provide a default 'physical_memsize'
@ 2023-02-14  1:09 Randy Dunlap
  2023-02-14  7:40 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2023-02-14  1:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Dengcheng Zhu, John Crispin,
	Thomas Bogendoerfer, linux-mips

When neither LANTIQ nor MIPS_MALTA is set, 'physical_memsize' is not
declared. This causes the build to fail with:

mips-linux-ld: arch/mips/kernel/vpe-mt.o: in function `vpe_run':
arch/mips/kernel/vpe-mt.c:(.text.vpe_run+0x280): undefined reference to `physical_memsize'

Fix this by declaring a 0-value physical_memsize with neither LANTIQ
nor MIPS_MALTA is set, like LANTIQ does.

Fixes: 1a2a6d7e8816 ("MIPS: APRP: Split VPE loader into separate files.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/all/202302030625.2g3E98sY-lkp@intel.com/
Cc: Dengcheng Zhu <dzhu@wavecomp.com>
Cc: John Crispin <john@phrozen.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
---
How has this build error not been detected for 10 years?

 arch/mips/kernel/vpe-mt.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff -- a/arch/mips/kernel/vpe-mt.c b/arch/mips/kernel/vpe-mt.c
--- a/arch/mips/kernel/vpe-mt.c
+++ b/arch/mips/kernel/vpe-mt.c
@@ -22,6 +22,15 @@ static int major;
 /* The number of TCs and VPEs physically available on the core */
 static int hw_tcs, hw_vpes;
 
+#if !defined(CONFIG_MIPS_MALTA) && !defined(CONFIG_LANTIQ)
+/* The 2 above provide their own 'physical_memsize' variable. */
+/*
+ * This is needed by the vpe-mt loader code, just set it to 0 and assume
+ * that the firmware hardcodes this value to something useful.
+ */
+unsigned long physical_memsize = 0L;
+#endif
+
 /* We are prepared so configure and start the VPE... */
 int vpe_run(struct vpe *v)
 {

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

end of thread, other threads:[~2023-02-19  9:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14  1:09 [PATCH] MIPS: vpe-mt: provide a default 'physical_memsize' Randy Dunlap
2023-02-14  7:40 ` Philippe Mathieu-Daudé
2023-02-14 18:29   ` Randy Dunlap
2023-02-16  6:59   ` Randy Dunlap
2023-02-17 11:57     ` Thomas Bogendoerfer
2023-02-17 20:04       ` Randy Dunlap
2023-02-17 23:24       ` Randy Dunlap
2023-02-19  8:40         ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox