linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] microblaze: Kernel parameters should be parsed earlier
@ 2020-02-11 13:13 Michal Simek
  2020-02-24 11:18 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2020-02-11 13:13 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Andrew Morton, Arvind Sankar, Geert Uytterhoeven,
	Greg Kroah-Hartman, Mike Rapoport, Shubhrajyoti Datta

Kernel command line should be parsed before cma initialization to be able
to get cma sizes from command line. That's why call parse_early_param()
before dma_continugous_reserve().

Unfortunately it can't be called earlier in machine_early_init() because
if earlycon is passed in the command line the parse_early_param() attempts
an ioremap which fails as the memory params are not set yet.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---

Changes in v2:
- Fix case with earlycon

 arch/microblaze/kernel/setup.c | 1 -
 arch/microblaze/mm/init.c      | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 511c1ab7f57f..a8fc15ac4291 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -54,7 +54,6 @@ void __init setup_arch(char **cmdline_p)
 	*cmdline_p = boot_command_line;
 
 	setup_memory();
-	parse_early_param();
 
 	console_verbose();
 
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 1056f1674065..9899ff2ef9b6 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -347,6 +347,8 @@ asmlinkage void __init mmu_init(void)
 	 * inside 768MB limit */
 	memblock_set_current_limit(memory_start + lowmem_size - 1);
 
+	parse_early_param();
+
 	/* CMA initialization */
 	dma_contiguous_reserve(memory_start + lowmem_size - 1);
 }
-- 
2.25.0


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

* Re: [PATCH v2] microblaze: Kernel parameters should be parsed earlier
  2020-02-11 13:13 [PATCH v2] microblaze: Kernel parameters should be parsed earlier Michal Simek
@ 2020-02-24 11:18 ` Michal Simek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2020-02-24 11:18 UTC (permalink / raw)
  To: LKML, Michal Simek, git
  Cc: Andrew Morton, Arvind Sankar, Geert Uytterhoeven,
	Greg Kroah-Hartman, Mike Rapoport, Shubhrajyoti Datta

út 11. 2. 2020 v 14:13 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Kernel command line should be parsed before cma initialization to be able
> to get cma sizes from command line. That's why call parse_early_param()
> before dma_continugous_reserve().
>
> Unfortunately it can't be called earlier in machine_early_init() because
> if earlycon is passed in the command line the parse_early_param() attempts
> an ioremap which fails as the memory params are not set yet.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
>
> Changes in v2:
> - Fix case with earlycon
>
>  arch/microblaze/kernel/setup.c | 1 -
>  arch/microblaze/mm/init.c      | 2 ++
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
> index 511c1ab7f57f..a8fc15ac4291 100644
> --- a/arch/microblaze/kernel/setup.c
> +++ b/arch/microblaze/kernel/setup.c
> @@ -54,7 +54,6 @@ void __init setup_arch(char **cmdline_p)
>         *cmdline_p = boot_command_line;
>
>         setup_memory();
> -       parse_early_param();
>
>         console_verbose();
>
> diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
> index 1056f1674065..9899ff2ef9b6 100644
> --- a/arch/microblaze/mm/init.c
> +++ b/arch/microblaze/mm/init.c
> @@ -347,6 +347,8 @@ asmlinkage void __init mmu_init(void)
>          * inside 768MB limit */
>         memblock_set_current_limit(memory_start + lowmem_size - 1);
>
> +       parse_early_param();
> +
>         /* CMA initialization */
>         dma_contiguous_reserve(memory_start + lowmem_size - 1);
>  }
> --
> 2.25.0
>

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

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

end of thread, other threads:[~2020-02-24 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 13:13 [PATCH v2] microblaze: Kernel parameters should be parsed earlier Michal Simek
2020-02-24 11:18 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).