Re: [PATCH 4/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT

2018-10-30 Thread Rob Herring
On Mon, Oct 29, 2018 at 6:52 PM Florian Fainelli  wrote:
>
> If the architecture implements ARCH_HAS_PHYS_INITRD, make the FDT
> scanning code populate the physical address of the start of the FDT and
> its size.
>
> Signed-off-by: Florian Fainelli 
> ---
>  arch/arm/mm/init.c | 2 +-
>  drivers/of/fdt.c   | 4 
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 8f364aa24172..517e95cfb5d2 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -237,7 +237,7 @@ static void __init arm_initrd_init(void)
> phys_addr_t start;
> unsigned long size;
>
> -   /* FDT scan will populate initrd_start */
> +   /* FDT scan will populate initrd_start and phys_initrd_start */
> if (initrd_start && !phys_initrd_size) {
> phys_initrd_start = __virt_to_phys(initrd_start);
> phys_initrd_size = initrd_end - initrd_start;
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 76c83c1ffeda..313cd4f24258 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -899,6 +899,10 @@ static void __early_init_dt_declare_initrd(unsigned long 
> start,
> initrd_start = (unsigned long)__va(start);
> initrd_end = (unsigned long)__va(end);

As Ard pointed out, these __va() calls will BUG on arm64 if VM
debugging is enabled. Unless the arm64 folks want to remove that check
(probably not), I'm fine with a 'if (!IS_ENABLED(CONFIG_ARM64)) {'
conditional here.

> initrd_below_start_ok = 1;
> +#ifdef CONFIG_ARCH_HAS_PHYS_INITRD
> +   phys_initrd_start = start;
> +   phys_initrd_size = end - start;
> +#endif
>  }
>  #endif
>
> --
> 2.17.1
>


Re: [PATCH 4/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT

2018-10-30 Thread Rob Herring
On Mon, Oct 29, 2018 at 6:52 PM Florian Fainelli  wrote:
>
> If the architecture implements ARCH_HAS_PHYS_INITRD, make the FDT
> scanning code populate the physical address of the start of the FDT and
> its size.
>
> Signed-off-by: Florian Fainelli 
> ---
>  arch/arm/mm/init.c | 2 +-
>  drivers/of/fdt.c   | 4 
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 8f364aa24172..517e95cfb5d2 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -237,7 +237,7 @@ static void __init arm_initrd_init(void)
> phys_addr_t start;
> unsigned long size;
>
> -   /* FDT scan will populate initrd_start */
> +   /* FDT scan will populate initrd_start and phys_initrd_start */
> if (initrd_start && !phys_initrd_size) {
> phys_initrd_start = __virt_to_phys(initrd_start);
> phys_initrd_size = initrd_end - initrd_start;
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 76c83c1ffeda..313cd4f24258 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -899,6 +899,10 @@ static void __early_init_dt_declare_initrd(unsigned long 
> start,
> initrd_start = (unsigned long)__va(start);
> initrd_end = (unsigned long)__va(end);

As Ard pointed out, these __va() calls will BUG on arm64 if VM
debugging is enabled. Unless the arm64 folks want to remove that check
(probably not), I'm fine with a 'if (!IS_ENABLED(CONFIG_ARM64)) {'
conditional here.

> initrd_below_start_ok = 1;
> +#ifdef CONFIG_ARCH_HAS_PHYS_INITRD
> +   phys_initrd_start = start;
> +   phys_initrd_size = end - start;
> +#endif
>  }
>  #endif
>
> --
> 2.17.1
>


Re: [PATCH 4/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT

2018-10-30 Thread Russell King - ARM Linux
On Mon, Oct 29, 2018 at 04:52:04PM -0700, Florian Fainelli wrote:
> If the architecture implements ARCH_HAS_PHYS_INITRD, make the FDT
> scanning code populate the physical address of the start of the FDT and
> its size.
> 
> Signed-off-by: Florian Fainelli 
> ---
>  arch/arm/mm/init.c | 2 +-
>  drivers/of/fdt.c   | 4 
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 8f364aa24172..517e95cfb5d2 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -237,7 +237,7 @@ static void __init arm_initrd_init(void)
>   phys_addr_t start;
>   unsigned long size;
>  
> - /* FDT scan will populate initrd_start */
> + /* FDT scan will populate initrd_start and phys_initrd_start */
>   if (initrd_start && !phys_initrd_size) {
>   phys_initrd_start = __virt_to_phys(initrd_start);
>   phys_initrd_size = initrd_end - initrd_start;

We should be able to delete the whole if () { } block and comment as
a result of this series - it was added by Rob in 65939301acdb to
unify the DT initrd code.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up


Re: [PATCH 4/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT

2018-10-30 Thread Russell King - ARM Linux
On Mon, Oct 29, 2018 at 04:52:04PM -0700, Florian Fainelli wrote:
> If the architecture implements ARCH_HAS_PHYS_INITRD, make the FDT
> scanning code populate the physical address of the start of the FDT and
> its size.
> 
> Signed-off-by: Florian Fainelli 
> ---
>  arch/arm/mm/init.c | 2 +-
>  drivers/of/fdt.c   | 4 
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 8f364aa24172..517e95cfb5d2 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -237,7 +237,7 @@ static void __init arm_initrd_init(void)
>   phys_addr_t start;
>   unsigned long size;
>  
> - /* FDT scan will populate initrd_start */
> + /* FDT scan will populate initrd_start and phys_initrd_start */
>   if (initrd_start && !phys_initrd_size) {
>   phys_initrd_start = __virt_to_phys(initrd_start);
>   phys_initrd_size = initrd_end - initrd_start;

We should be able to delete the whole if () { } block and comment as
a result of this series - it was added by Rob in 65939301acdb to
unify the DT initrd code.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up