Skip to contentSkip to conversation

m68k: fix flatmem memory model setup

PATCH Superseded Angelo Dureghello 2 participants 2 messages Feb 27, 2021 – Feb 28, 2021 m68k architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: fix flatmem memory model setup

Detected a broken boot on mcf54415, likely introduced from

commit 4bfc848e0981
("m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM")

Fix ARCH_PFN_OFFSET to be a pfn.

---
 arch/m68k/include/asm/page_mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/include/asm/page_mm.h +1 -1
index 8cfc92451711..84551b1a8b93 100644
@@ -167,7 +167,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void)
 	((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn;		\
 })
 #else
-#define ARCH_PFN_OFFSET (m68k_memory[0].addr)
+#define ARCH_PFN_OFFSET	(PAGE_OFFSET >> PAGE_SHIFT)
 #include <asm-generic/memory_model.h>
 #endif
 
Signature · 1 line
2.30.1
#1 lore raw

Hi,

Quoted 17 lines · Angelo Dureghello

Detected a broken boot on mcf54415, likely introduced from

commit 4bfc848e0981
("m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM")

Fix ARCH_PFN_OFFSET to be a pfn.

---
 arch/m68k/include/asm/page_mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/include/asm/page_mm.h +0 -0
index 8cfc92451711..84551b1a8b93 100644

arch/m68k/include/asm/page_mm.h static inline __attribute_const__ int __virt_to_node_shift(void) · line 170

Quoted 5 lines
arch/m68k/include/asm/page_mm.h +1 -1
@@ -167,7 +167,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void)
 	((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn;		\
 })
 #else
-#define ARCH_PFN_OFFSET (m68k_memory[0].addr)
+#define ARCH_PFN_OFFSET	(PAGE_OFFSET >> PAGE_SHIFT)

Please keep m68k_memory[0].addr and only add the PAGE_SHIFT I've forgot in 4bfc848e0981.
Some of the configurations with motorola mmu would be broken with static PAGE_OFFSET and they require the actual detected memory start to be used as ARCH_PFN_OFFSET.

Quoted 6 lines
arch/m68k/include/asm/page_mm.h +0 -0
 #include <asm-generic/memory_model.h>
 #endif
 
Signature · 1 line
2.30.1
Signature · 2 lines
Sincerely yours,
Mike.