linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: at91: fix build for SAMA5D3 w/o L2 cache
@ 2022-11-12 15:40 Peter Rosin
  2022-11-18 21:38 ` Peter Rosin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peter Rosin @ 2022-11-12 15:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexandre Belloni, Russell King, Clément Léger,
	Claudiu Beznea, linux-arm-kernel

The L2 cache is present on the newer SAMA5D2 and SAMA5D4 families, but
apparently not for the older SAMA5D3. At least not always.

Solves a build-time regression with the following symptom:

sama5.c:(.init.text+0x48): undefined reference to `outer_cache'

Fixes: 3b5a7ca7d252 ("ARM: at91: setup outer cache .write_sec() callback if needed")
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 arch/arm/mach-at91/sama5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi!

I'm not sure this is the correct solution? Maybe SAMA5D3 should bring
in CONFIG_OUTER_CACHE unconditionally instead? But that seems like a
bigger change, and not just a tweak of the regressing commit...

Cheers,
Peter

diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index 67ed68fbe3a5..bf2b5c6a18c6 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -26,7 +26,7 @@ static void sama5_l2c310_write_sec(unsigned long val, unsigned reg)
 static void __init sama5_secure_cache_init(void)
 {
 	sam_secure_init();
-	if (sam_linux_is_optee_available())
+	if (IS_ENABLED(CONFIG_OUTER_CACHE) && sam_linux_is_optee_available())
 		outer_cache.write_sec = sama5_l2c310_write_sec;
 }
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-11-24 10:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-12 15:40 [PATCH] ARM: at91: fix build for SAMA5D3 w/o L2 cache Peter Rosin
2022-11-18 21:38 ` Peter Rosin
2022-11-22 15:13 ` Thorsten Leemhuis
2022-11-22 17:14   ` Clément Léger
2022-11-23  7:19     ` Claudiu.Beznea
2022-11-23  8:38       ` Peter Rosin
2022-11-23 10:40         ` Nicolas Ferre
2022-11-24 10:52 ` Claudiu.Beznea

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