All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: fix memory setup for platforms with PHY_OFFSET != 0
@ 2019-02-26 14:06 Thomas Bogendoerfer
  2019-02-27  6:32 ` Mike Rapoport
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bogendoerfer @ 2019-02-26 14:06 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel
  Cc: Mike Rapoport

For platforms, which use a PHY_OFFSET != 0, symbol _end also
contains that offset. So when calling memblock_reserve() for
reserving kernel and initrd the size argument needs to be
adjusted.

Fixes: bcec54bf3118 ("mips: switch to NO_BOOTMEM")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 arch/mips/kernel/setup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 8c6c48ed786a..d2e5a5ad0e6f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -384,7 +384,8 @@ static void __init bootmem_init(void)
 	init_initrd();
 	reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));
 
-	memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT);
+	memblock_reserve(PHYS_OFFSET,
+			 (reserved_end << PAGE_SHIFT) - PHYS_OFFSET);
 
 	/*
 	 * max_low_pfn is not a number of pages. The number of pages
-- 
2.13.7


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

* Re: [PATCH] MIPS: fix memory setup for platforms with PHY_OFFSET != 0
  2019-02-26 14:06 [PATCH] MIPS: fix memory setup for platforms with PHY_OFFSET != 0 Thomas Bogendoerfer
@ 2019-02-27  6:32 ` Mike Rapoport
  2019-02-27  9:43   ` Thomas Bogendoerfer
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2019-02-27  6:32 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel,
	Mike Rapoport

Hi,

On Tue, Feb 26, 2019 at 03:06:32PM +0100, Thomas Bogendoerfer wrote:
> For platforms, which use a PHY_OFFSET != 0, symbol _end also

Nit:                         PHYS_OFFSET, the same typo in subject

> contains that offset. So when calling memblock_reserve() for
> reserving kernel and initrd the size argument needs to be
> adjusted.

The changelog mentions initrd, but the patch changes only the kernel
reservation. Can you please update the changelog to match the code?

> Fixes: bcec54bf3118 ("mips: switch to NO_BOOTMEM")
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>

With the amends above

Acked-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  arch/mips/kernel/setup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index 8c6c48ed786a..d2e5a5ad0e6f 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -384,7 +384,8 @@ static void __init bootmem_init(void)
>  	init_initrd();
>  	reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));
> 
> -	memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT);
> +	memblock_reserve(PHYS_OFFSET,
> +			 (reserved_end << PAGE_SHIFT) - PHYS_OFFSET);
> 
>  	/*
>  	 * max_low_pfn is not a number of pages. The number of pages
> -- 
> 2.13.7
> 

-- 
Sincerely yours,
Mike.


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

* Re: [PATCH] MIPS: fix memory setup for platforms with PHY_OFFSET != 0
  2019-02-27  6:32 ` Mike Rapoport
@ 2019-02-27  9:43   ` Thomas Bogendoerfer
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2019-02-27  9:43 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel,
	Mike Rapoport

On Wed, 27 Feb 2019 08:32:43 +0200
Mike Rapoport <rppt@linux.ibm.com> wrote:

> The changelog mentions initrd, but the patch changes only the kernel
> reservation. Can you please update the changelog to match the code?

sure, changed and sent.

Thomas.

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

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

end of thread, other threads:[~2019-02-27  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 14:06 [PATCH] MIPS: fix memory setup for platforms with PHY_OFFSET != 0 Thomas Bogendoerfer
2019-02-27  6:32 ` Mike Rapoport
2019-02-27  9:43   ` Thomas Bogendoerfer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.