Re: [PATCH] MIPS: Loongson3,SGI-IP27: Simplify max_low_pfn calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 12 Nov 2018 22:18:01 +0000
Paul Burton <paul.burton@xxxxxxxx> wrote:

> Both the Loongson3 & SGI-IP27 platforms set max_low_pfn to the last
> available PFN describing memory. They both do it in paging_init() which
> is later than ideal since max_low_pfn is used before that function is
> called. Simplify both platforms to trivially initialize max_low_pfn
> using the end address of DRAM, and do it earlier in prom_meminit().
> diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
> index d8b8444d6795..813d13f92957 100644
> --- a/arch/mips/sgi-ip27/ip27-memory.c
> +++ b/arch/mips/sgi-ip27/ip27-memory.c
> @@ -435,6 +435,7 @@ void __init prom_meminit(void)
>  
>  	mlreset();
>  	szmem();
> +	max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());

this is too early, memory gets added after the following for loop.

>  
>  	for (node = 0; node < MAX_COMPACT_NODES; node++) {
>  		if (node_online(node)) {

it should work after this loop. I have the hardware to test later this day.

Thomas.

-- 
SUSE Linux GmbH
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux