Skip to contentSkip to conversation

arm: mach-omap2: Enlarge SYS_MALLOC_F_LEN

PATCH New Sjoerd Simons 3 participants 5 messages Apr 11, 2018 – Apr 12, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-omap2: Enlarge SYS_MALLOC_F_LEN

Since commit 8e14ba7bd524 ("gpio: omap_gpio: Add DM_FLAG_PRE_RELOC flag") omap GPIO gets bound before relocation. Unfortunately due to this, on at least the beaglebone black, the pre-relocation memory pool gets exhausted before probing the serial port. This then causes u-boot to panic as CONFIG_REQUIRE_SERIAL_CONSOLE is set...

Resolve this by doubling the default size of the pre-relocation malloc pool on mach-omap2.

---

 arch/arm/mach-omap2/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-omap2/Kconfig +3 -0
index 3bb1ecb58d..02c5a4c0b8 100644
@@ -186,4 +186,7 @@ source "board/compulab/cm_t43/Kconfig"
 config SPL_LDSCRIPT
         default "arch/arm/mach-omap2/u-boot-spl.lds"
 
+config SYS_MALLOC_F_LEN
+	default 0x0800
+
 endif
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 arm: mach-omap2: Enlarge SYS_MALLOC_F_LEN

Quoted 5 lines · Sjoerd Simons

Since commit 8e14ba7bd524 ("gpio: omap_gpio: Add DM_FLAG_PRE_RELOC flag") omap GPIO gets bound before relocation. Unfortunately due to this, on at least the beaglebone black, the pre-relocation memory pool gets exhausted before probing the serial port. This then causes u-boot to panic as CONFIG_REQUIRE_SERIAL_CONSOLE is set...

Ah, so, you're using am335x_boneblack_defconfig and not am335x_evm_defconfig which is why I didn't see this problem myself.

Quoted 15 lines

Resolve this by doubling the default size of the pre-relocation malloc pool on mach-omap2.

---

 arch/arm/mach-omap2/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-omap2/Kconfig +0 -0
index 3bb1ecb58d..02c5a4c0b8 100644

arch/arm/mach-omap2/Kconfig source "board/compulab/cm_t43/Kconfig" · line 190

Quoted 5 lines
arch/arm/mach-omap2/Kconfig +2 -0
@@ -186,4 +186,7 @@ source "board/compulab/cm_t43/Kconfig"
 config SPL_LDSCRIPT
         default "arch/arm/mach-omap2/u-boot-spl.lds"
 
+config SYS_MALLOC_F_LEN
+	default 0x0800

This isn't the first bad example, ugh, but we shouldn't go this route. Ideally we should modify the top-level Kconfig, as that declares SYS_MALLOC_F_LEN, to be default 0x800 if ARCH_OMAP2PLUS.

That said, most of the am335x platforms set SYS_MALLOC_F_LEN to either 0x1000 or 0x2000. At this point, I would recommend tweaking configs/am335x_evm* and configs/am335x_boneblack* to be consistent and use 0x1000 as I don't know if the HS variants can safely be pushed up to 0x2000 (adding in Andrew). Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180411/6df236c4/attachment.sig>
#2 lore raw

PATCH 1/1 arm: mach-omap2: Enlarge SYS_MALLOC_F_LEN

Quoted 34 lines · Tom Rini
Quoted 8 lines · Sjoerd Simons

Since commit 8e14ba7bd524 ("gpio: omap_gpio: Add DM_FLAG_PRE_RELOC flag") omap GPIO gets bound before relocation. Unfortunately due to
this, on at least the beaglebone black, the pre-relocation memory pool
gets exhausted before probing the serial port. This then causes u- boot
to panic as CONFIG_REQUIRE_SERIAL_CONSOLE is set...

Ah, so, you're using am335x_boneblack_defconfig and not am335x_evm_defconfig which is why I didn't see this problem myself.

Quoted 20 lines

Resolve this by doubling the default size of the pre-relocation malloc
pool on mach-omap2.

---

 arch/arm/mach-omap2/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-omap2/Kconfig +0 -0

omap2/Kconfig
index 3bb1ecb58d..02c5a4c0b8 100644

arch/arm/mach-omap2/Kconfig +0 -0
@@ -186,4 +186,7 @@ source "board/compulab/cm_t43/Kconfig"
 config SPL_LDSCRIPT
         default "arch/arm/mach-omap2/u-boot-spl.lds"
 
Quoted 7 lines

arch/arm/mach-omap2/Kconfig source "board/compulab/cm_t43/Kconfig" · line 190

Quoted 2 lines
arch/arm/mach-omap2/Kconfig +2 -0
+config SYS_MALLOC_F_LEN
+	default 0x0800

This isn't the first bad example, ugh, but we shouldn't go this route.
Ideally we should modify the top-level Kconfig, as that declares SYS_MALLOC_F_LEN, to be default 0x800 if ARCH_OMAP2PLUS.

Fwiw I proposed it that way around as various machs (tegra, zync, bmips, meson, integrator, etc) and the x86 arch seems to doing it like that.

Quoted 8 lines

That said, most of the am335x platforms set SYS_MALLOC_F_LEN to either
0x1000 or 0x2000. At this point, I would recommend tweaking configs/am335x_evm* and configs/am335x_boneblack* to be consistent and
use 0x1000 as I don't know if the HS variants can safely be pushed up to
0x2000 (adding in Andrew). Thanks!

Happy to prepare a patch for that; but the one thing that worries me is that there are probably more defconfigs broken due to this then just those. So changing the default via kconfig is probably more robust.

Signature · 2 lines
Sjoerd Simons
Collabora Ltd.
#3 lore raw

PATCH 1/1 arm: mach-omap2: Enlarge SYS_MALLOC_F_LEN

Quoted 43 lines · Sjoerd Simons
Quoted 34 lines · Tom Rini
Quoted 8 lines · Sjoerd Simons

Since commit 8e14ba7bd524 ("gpio: omap_gpio: Add DM_FLAG_PRE_RELOC flag") omap GPIO gets bound before relocation. Unfortunately due to
this, on at least the beaglebone black, the pre-relocation memory pool
gets exhausted before probing the serial port. This then causes u- boot
to panic as CONFIG_REQUIRE_SERIAL_CONSOLE is set...

Ah, so, you're using am335x_boneblack_defconfig and not am335x_evm_defconfig which is why I didn't see this problem myself.

Quoted 20 lines

Resolve this by doubling the default size of the pre-relocation malloc
pool on mach-omap2.

---

 arch/arm/mach-omap2/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-omap2/Kconfig +0 -0

omap2/Kconfig
index 3bb1ecb58d..02c5a4c0b8 100644

arch/arm/mach-omap2/Kconfig +0 -0
@@ -186,4 +186,7 @@ source "board/compulab/cm_t43/Kconfig"
 config SPL_LDSCRIPT
         default "arch/arm/mach-omap2/u-boot-spl.lds"
 
Quoted 7 lines

arch/arm/mach-omap2/Kconfig source "board/compulab/cm_t43/Kconfig" · line 190

Quoted 2 lines
arch/arm/mach-omap2/Kconfig +2 -0
+config SYS_MALLOC_F_LEN
+	default 0x0800

This isn't the first bad example, ugh, but we shouldn't go this route.
Ideally we should modify the top-level Kconfig, as that declares SYS_MALLOC_F_LEN, to be default 0x800 if ARCH_OMAP2PLUS.

Quoted 3 lines

Fwiw I proposed it that way around as various machs (tegra, zync, bmips, meson, integrator, etc) and the x86 arch seems to doing it like that.

Right. Those are bad examples I should migrate :(

Quoted 9 lines
Quoted 8 lines

That said, most of the am335x platforms set SYS_MALLOC_F_LEN to either
0x1000 or 0x2000. At this point, I would recommend tweaking configs/am335x_evm* and configs/am335x_boneblack* to be consistent and
use 0x1000 as I don't know if the HS variants can safely be pushed up to
0x2000 (adding in Andrew). Thanks!

Quoted 3 lines

Happy to prepare a patch for that; but the one thing that worries me is that there are probably more defconfigs broken due to this then just those. So changing the default via kconfig is probably more robust.

I'm a little worried too, frankly. We could do default 0x1000 if AM33XX in the top-level Kconfig file for now, and see about bumping it up to 0x2000 for ARCH_OMAP2PLUS for the next release.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180412/1491b784/attachment.sig>
#4 lore raw

PATCH 1/1 arm: mach-omap2: Enlarge SYS_MALLOC_F_LEN

In reply to Tom Rini
Quoted 36 lines · Tom Rini
Quoted 5 lines · Sjoerd Simons

Since commit 8e14ba7bd524 ("gpio: omap_gpio: Add DM_FLAG_PRE_RELOC flag") omap GPIO gets bound before relocation. Unfortunately due to this, on at least the beaglebone black, the pre-relocation memory pool gets exhausted before probing the serial port. This then causes u-boot to panic as CONFIG_REQUIRE_SERIAL_CONSOLE is set...

Ah, so, you're using am335x_boneblack_defconfig and not am335x_evm_defconfig which is why I didn't see this problem myself.

Quoted 15 lines

Resolve this by doubling the default size of the pre-relocation malloc pool on mach-omap2.

---

 arch/arm/mach-omap2/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-omap2/Kconfig +0 -0
index 3bb1ecb58d..02c5a4c0b8 100644

arch/arm/mach-omap2/Kconfig source "board/compulab/cm_t43/Kconfig" · line 190

Quoted 5 lines
arch/arm/mach-omap2/Kconfig +2 -0
@@ -186,4 +186,7 @@ source "board/compulab/cm_t43/Kconfig"
 config SPL_LDSCRIPT
         default "arch/arm/mach-omap2/u-boot-spl.lds"
 
+config SYS_MALLOC_F_LEN
+	default 0x0800

This isn't the first bad example, ugh, but we shouldn't go this route. Ideally we should modify the top-level Kconfig, as that declares SYS_MALLOC_F_LEN, to be default 0x800 if ARCH_OMAP2PLUS.

Quoted 6 lines

That said, most of the am335x platforms set SYS_MALLOC_F_LEN to either 0x1000 or 0x2000. At this point, I would recommend tweaking configs/am335x_evm* and configs/am335x_boneblack* to be consistent and use 0x1000 as I don't know if the HS variants can safely be pushed up to 0x2000 (adding in Andrew). Thanks!

Quick test shows they can even be pushed to 0x4000 without obvious problems. Lets be consistent and push all ARCH_OMAP2PLUS up to 0x2000 so we don't have to revisit this for awhile. The SPL_ version too.

Andrew