Skip to contentSkip to conversation

m68k: fix flatmem memory model setup

PATCH In review Angelo Dureghello 4 participants 4 messages Feb 28, 2021 – Apr 12, 2021 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
Change for v2:
- replace PAGE_OFFSET with m68k_memory[0].addr

---
 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..1c683ce57d48 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 (m68k_memory[0].addr >> PAGE_SHIFT)
 #include <asm-generic/memory_model.h>
 #endif
 
Signature · 1 line
2.30.1
Acked-by on v2 1/1
#1 lore raw
Quoted 8 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.

Quoted 23 lines

---
Change for v2:
- replace PAGE_OFFSET with m68k_memory[0].addr

---
 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..1c683ce57d48 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 (m68k_memory[0].addr >> PAGE_SHIFT)
 #include <asm-generic/memory_model.h>
 #endif
 
Signature · 1 line
2.30.1
Signature · 2 lines
Sincerely yours,
Mike.
#2 lore raw
In reply to Angelo Dureghello

Hi Angelo,

Quoted 8 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.

Thanks. I will add to the for-next (and for-linus) branches of the m68knommu git tree - with Mike's Acked-by.

If no issues show up I'll get this to Linus in the next week or two.

Thanks
Greg

Quoted 21 lines

---
Change for v2:
- replace PAGE_OFFSET with m68k_memory[0].addr

---
  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..1c683ce57d48 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 (m68k_memory[0].addr >> PAGE_SHIFT)
  #include <asm-generic/memory_model.h>
  #endif
 
maintainer Reviewed-by on v2 1/1
#3 lore raw
In reply to Angelo Dureghello
Quoted 8 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.

As this affects m68k-with-MMU, too, I have applied it, and queued it in the m68k for-v5.13 branch. But it should hit upstream before v5.12 due to Greg's pull request.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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