diff mbox series

of: of_reserved_mem: Increase limit on number of reserved regions

Message ID 1582567352-4664-1-git-send-email-isaacm@codeaurora.org
State Accepted, archived
Headers show
Series of: of_reserved_mem: Increase limit on number of reserved regions | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Isaac J. Manjarres Feb. 24, 2020, 6:02 p.m. UTC
From: Patrick Daly <pdaly@codeaurora.org>

Certain SoCs need to support a large amount of reserved memory
regions. For example, Qualcomm's SM8150 SoC requires that 20
regions of memory be reserved for a variety of reasons (e.g.
loading a peripheral subsystem's firmware image into a
particular space).

When adding more reserved memory regions to cater to different
usecases, the remaining number of reserved memory regions--12
to be exact--becomes too small. Thus, double the existing
limit of reserved memory regions.

Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring (Arm) Feb. 25, 2020, 9:08 p.m. UTC | #1
On Mon, 24 Feb 2020 10:02:32 -0800, "Isaac J. Manjarres" wrote:
> From: Patrick Daly <pdaly@codeaurora.org>
> 
> Certain SoCs need to support a large amount of reserved memory
> regions. For example, Qualcomm's SM8150 SoC requires that 20
> regions of memory be reserved for a variety of reasons (e.g.
> loading a peripheral subsystem's firmware image into a
> particular space).
> 
> When adding more reserved memory regions to cater to different
> usecases, the remaining number of reserved memory regions--12
> to be exact--becomes too small. Thus, double the existing
> limit of reserved memory regions.
> 
> Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
> Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
> ---
>  drivers/of/of_reserved_mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied, thanks.

Rob
Geert Uytterhoeven Feb. 26, 2020, 9:01 a.m. UTC | #2
Hi Isaac,

On Mon, Feb 24, 2020 at 7:03 PM Isaac J. Manjarres
<isaacm@codeaurora.org> wrote:
> From: Patrick Daly <pdaly@codeaurora.org>
>
> Certain SoCs need to support a large amount of reserved memory
> regions. For example, Qualcomm's SM8150 SoC requires that 20
> regions of memory be reserved for a variety of reasons (e.g.
> loading a peripheral subsystem's firmware image into a
> particular space).
>
> When adding more reserved memory regions to cater to different
> usecases, the remaining number of reserved memory regions--12
> to be exact--becomes too small. Thus, double the existing
> limit of reserved memory regions.
>
> Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
> Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>

Thanks for your patch!

> --- a/drivers/of/of_reserved_mem.c
> +++ b/drivers/of/of_reserved_mem.c
> @@ -22,7 +22,7 @@
>  #include <linux/slab.h>
>  #include <linux/memblock.h>
>
> -#define MAX_RESERVED_REGIONS   32
> +#define MAX_RESERVED_REGIONS   64
>  static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
>  static int reserved_mem_count;

This increases the size of reserved_mem[] by 896 (32-bit), 1280 (32-bit LPAE),
or 1792 (64-bit) bytes. While some systems don't need reserved memory
regions at all, and may be RAM-limited.

Perhaps this array can be replaced by some dynamically increasing
structure?

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 6bd610e..1a84bc0 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -22,7 +22,7 @@ 
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS	32
+#define MAX_RESERVED_REGIONS	64
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;