Commit 6b2ad8d7 authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds

m68k/mm: make node data and node setup depend on CONFIG_DISCONTIGMEM

The pg_data_t node structures and their initialization currently depends on
!CONFIG_SINGLE_MEMORY_CHUNK. Since they are required only for DISCONTIGMEM
make this dependency explicit and replace usage of
CONFIG_SINGLE_MEMORY_CHUNK with CONFIG_DISCONTIGMEM where appropriate.

The CONFIG_SINGLE_MEMORY_CHUNK was implicitly disabled on the ColdFire MMU
variant, although it always presumed a single memory bank. As there is no
actual need for DISCONTIGMEM in this case, make sure that ColdFire MMU
systems set CONFIG_SINGLE_MEMORY_CHUNK to 'y'.

Link: https://lkml.kernel.org/r/20201101170454.9567-12-rppt@kernel.orgSigned-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Meelis Roos <mroos@linux.ee>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 050b2da2
...@@ -373,7 +373,7 @@ config RMW_INSNS ...@@ -373,7 +373,7 @@ config RMW_INSNS
config SINGLE_MEMORY_CHUNK config SINGLE_MEMORY_CHUNK
bool "Use one physical chunk of memory only" if ADVANCED && !SUN3 bool "Use one physical chunk of memory only" if ADVANCED && !SUN3
depends on MMU depends on MMU
default y if SUN3 default y if SUN3 || MMU_COLDFIRE
select NEED_MULTIPLE_NODES select NEED_MULTIPLE_NODES
help help
Ignore all but the first contiguous chunk of physical memory for VM Ignore all but the first contiguous chunk of physical memory for VM
...@@ -406,7 +406,7 @@ config M68K_L2_CACHE ...@@ -406,7 +406,7 @@ config M68K_L2_CACHE
config NODES_SHIFT config NODES_SHIFT
int int
default "3" default "3"
depends on !SINGLE_MEMORY_CHUNK depends on DISCONTIGMEM
config CPU_HAS_NO_BITFIELDS config CPU_HAS_NO_BITFIELDS
bool bool
......
...@@ -126,7 +126,7 @@ static inline void *__va(unsigned long x) ...@@ -126,7 +126,7 @@ static inline void *__va(unsigned long x)
extern int m68k_virt_to_node_shift; extern int m68k_virt_to_node_shift;
#ifdef CONFIG_SINGLE_MEMORY_CHUNK #ifndef CONFIG_DISCONTIGMEM
#define __virt_to_node(addr) (&pg_data_map[0]) #define __virt_to_node(addr) (&pg_data_map[0])
#else #else
extern struct pglist_data *pg_data_table[]; extern struct pglist_data *pg_data_table[];
......
...@@ -29,7 +29,7 @@ static inline void *phys_to_virt(unsigned long address) ...@@ -29,7 +29,7 @@ static inline void *phys_to_virt(unsigned long address)
} }
/* Permanent address of a page. */ /* Permanent address of a page. */
#if defined(CONFIG_MMU) && defined(CONFIG_SINGLE_MEMORY_CHUNK) #if defined(CONFIG_MMU) && !defined(CONFIG_DISCONTIGMEM)
#define page_to_phys(page) \ #define page_to_phys(page) \
__pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
#else #else
......
...@@ -47,14 +47,14 @@ EXPORT_SYMBOL(pg_data_map); ...@@ -47,14 +47,14 @@ EXPORT_SYMBOL(pg_data_map);
int m68k_virt_to_node_shift; int m68k_virt_to_node_shift;
#ifndef CONFIG_SINGLE_MEMORY_CHUNK #ifdef CONFIG_DISCONTIGMEM
pg_data_t *pg_data_table[65]; pg_data_t *pg_data_table[65];
EXPORT_SYMBOL(pg_data_table); EXPORT_SYMBOL(pg_data_table);
#endif #endif
void __init m68k_setup_node(int node) void __init m68k_setup_node(int node)
{ {
#ifndef CONFIG_SINGLE_MEMORY_CHUNK #ifdef CONFIG_DISCONTIGMEM
struct m68k_mem_info *info = m68k_memory + node; struct m68k_mem_info *info = m68k_memory + node;
int i, end; int i, end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment