Skip to contentSkip to conversation

of_reserved_mem: Increase the number of reserved regions

PATCH In review Phil Chang 3 participants 7 messages Oct 4, 2020 – Oct 5, 2020

Subsystems (2)
lore
Share & tools
lore

Phil Chang

author
#0 lore raw

PATCH 1/1 of_reserved_mem: Increase the number of reserved regions

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce, so that need to reserve more regisions

---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +1 -1
index 46b9371c8a33..595f0741dcef 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS	64
+#define MAX_RESERVED_REGIONS	128
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;
 
Signature · 1 line
2.18.0
#1 lore raw

Hi, Phil:

Phil Chang <[email protected]> 於 2020年10月4日 週日 下午1:51寫道:

Quoted 5 lines

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce,

space

Quoted 1 line

so that need to reserve more regisions

regions.

I guess this requirement is from Mediatek SoC, but I find below device tree and just find one reserved memory region,

arch/arm64/boot/dts/mediatek/mt7622.dtsi
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/mediatek/mt8516.dtsi

Could you show me the 68 regions?

Regards,
Chun-Kuang.

Quoted 28 lines
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +1 -2
index 46b9371c8a33..595f0741dcef 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS   64
+#define MAX_RESERVED_REGIONS   128
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;
 
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

author
#2 lore raw

Hi Chun-Kuang

Sorry for typo. In fact, the dts of new SoC is not upstream yet. I'm so sorry for couldn't show the detail now.

How about the configurable MAX_RESERVED_REGIONS size like this patch?
https://patchwork.kernel.org/patch/10692101/

Quoted 55 lines · Chun-Kuang Hu

Hi, Phil:

Phil Chang <[email protected]> 於 2020年10月4日 週日 下午1:51寫道:

Quoted 5 lines

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce,

space

Quoted 1 line

so that need to reserve more regisions

regions.

I guess this requirement is from Mediatek SoC, but I find below device tree and just find one reserved memory region,

arch/arm64/boot/dts/mediatek/mt7622.dtsi
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/mediatek/mt8516.dtsi

Could you show me the 68 regions?

Regards,
Chun-Kuang.

Quoted 28 lines
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +1 -2
index 46b9371c8a33..595f0741dcef 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS   64
+#define MAX_RESERVED_REGIONS   128
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;
 
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#3 lore raw
Quoted 2 lines · Phil Chang

Hi Chun-Kuang

Please don't top post to the lists.

Quoted 2 lines

Sorry for typo. In fact, the dts of new SoC is not upstream yet. I'm so sorry for couldn't show the detail now.

Don't have to have the dts upstream. Can you point to a downstream dts or post a snippet of the reserved memory?

Quoted 2 lines

How about the configurable MAX_RESERVED_REGIONS size like this patch?
https://patchwork.kernel.org/patch/10692101/

No, as I already said in that patch. But glad you found what's needed to make it dynamic. But even for dynamic, I want to understand the use.

Rob

Quoted 59 lines · Chun-Kuang Hu
Quoted 55 lines

Hi, Phil:

Phil Chang <[email protected]> 於 2020年10月4日 週日 下午1:51寫道:

Quoted 5 lines

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce,

space

Quoted 1 line

so that need to reserve more regisions

regions.

I guess this requirement is from Mediatek SoC, but I find below device tree and just find one reserved memory region,

arch/arm64/boot/dts/mediatek/mt7622.dtsi
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/mediatek/mt8516.dtsi

Could you show me the 68 regions?

Regards,
Chun-Kuang.

Quoted 28 lines
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +1 -2
index 46b9371c8a33..595f0741dcef 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS   64
+#define MAX_RESERVED_REGIONS   128
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;
 
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#4 lore raw

Rob Herring <[email protected]> 於 2020年10月6日 週二 上午2:57寫道:

Quoted 13 lines · Phil Chang
Quoted 2 lines

Hi Chun-Kuang

Please don't top post to the lists.

Quoted 2 lines

Sorry for typo. In fact, the dts of new SoC is not upstream yet. I'm so sorry for couldn't show the detail now.

Don't have to have the dts upstream. Can you point to a downstream dts or post a snippet of the reserved memory?

Quoted 6 lines
Quoted 2 lines

How about the configurable MAX_RESERVED_REGIONS size like this patch?
https://patchwork.kernel.org/patch/10692101/

No, as I already said in that patch. But glad you found what's needed to make it dynamic. But even for dynamic, I want to understand the use.

I get the point. We should prevent too many config. If this information could be get from dts, we should not get it from config. Agree that WHY of this patch is more important than HOW of this patch.

Regards,
Chun-Kuang.

Quoted 62 lines

Rob

Quoted 59 lines · Chun-Kuang Hu
Quoted 55 lines

Hi, Phil:

Phil Chang <[email protected]> 於 2020年10月4日 週日 下午1:51寫道:

Quoted 5 lines

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce,

space

Quoted 1 line

so that need to reserve more regisions

regions.

I guess this requirement is from Mediatek SoC, but I find below device tree and just find one reserved memory region,

arch/arm64/boot/dts/mediatek/mt7622.dtsi
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/mediatek/mt8516.dtsi

Could you show me the 68 regions?

Regards,
Chun-Kuang.

Quoted 28 lines
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +1 -2
index 46b9371c8a33..595f0741dcef 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS   64
+#define MAX_RESERVED_REGIONS   128
 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
 static int reserved_mem_count;
 
--

2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#5 lore raw
In reply to Phil Chang
Quoted 5 lines · Phil Chang

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce,

typo

Quoted 1 line

so that need to reserve more regisions

typo. Missing punctuation.

Quoted 14 lines
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +0 -0
index 46b9371c8a33..595f0741dcef 100644

drivers/of/of_reserved_mem.c line 25

Quoted 5 lines
drivers/of/of_reserved_mem.c +1 -1
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#define MAX_RESERVED_REGIONS   64
+#define MAX_RESERVED_REGIONS   128

At some point, this starts to feel like abuse of reserved regions. Please provide details on what the regions are.

Also, this probably just needs to be dynamic. I think we're at that point.

Rob

#6 lore raw

Hi, Rob:

Rob Herring <[email protected]> 於 2020年10月5日 週一 下午9:45寫道:

Quoted 31 lines · Phil Chang
Quoted 5 lines

Certain SoCs need to support large amount of reserved memory regions, especially to follow the GKI rules from Google. In MTK new SoC requires more than 68 regions of reserved memory for each IP's usage, such as load firmware to specific sapce,

typo

Quoted 1 line

so that need to reserve more regisions

typo. Missing punctuation.

Quoted 17 lines
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +0 -0
index 46b9371c8a33..595f0741dcef 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
Quoted 7 lines

drivers/of/of_reserved_mem.c line 25

Quoted 2 lines
drivers/of/of_reserved_mem.c +1 -1
-#define MAX_RESERVED_REGIONS   64
+#define MAX_RESERVED_REGIONS   128

At some point, this starts to feel like abuse of reserved regions. Please provide details on what the regions are.

Also, this probably just needs to be dynamic. I think we're at that point.

How about using a config like DRM_FBDEV_OVERALLOC [1] ?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/Kconfig?h=v5.9-rc8#n125

Regards,
Chun-Kuang.

Quoted 7 lines

Rob

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek