Skip to contentSkip to conversation

Revert "board: st: stm32mp1: Clean env_get_location()"

PATCH In review Kory Maincent 4 participants 11 messages Sep 17, 2025 – Sep 30, 2025 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "board: st: stm32mp1: Clean env_get_location()"

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

---

Debugging this issue raises another issue that need investigation. If env_get_location return ENVL_IS_NOWHERE but CONFIG_ENV_IS_NOWHERE is not set, U-boot stall without any log. There might be an ENV check issue here.

---
 board/st/stm32mp1/stm32mp1.c | 2 ++
 1 file changed, 2 insertions(+)
board/st/stm32mp1/stm32mp1.c +2 -0
index ab7af69d472..cb5cab9f36a 100644
@@ -751,6 +751,8 @@ enum env_location env_get_location(enum env_operation op, int prio)
 	case BOOT_FLASH_EMMC:
 		if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC))
 			return ENVL_MMC;
+		else if (CONFIG_IS_ENABLED(ENV_IS_IN_EXT4))
+			return ENVL_EXT4;
 		else
 			return ENVL_NOWHERE;
 
Signature · 1 line
2.43.0
#1 lore raw

Hi Köry,

Quoted 10 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Quoted 7 lines

---

Debugging this issue raises another issue that need investigation. If env_get_location return ENVL_IS_NOWHERE but CONFIG_ENV_IS_NOWHERE is not set, U-boot stall without any log. There might be an ENV check issue here.

I believe this may be related to what I hit almost three years ago, see commit log in https://source.denx.de/u-boot/u-boot/-/commit/b1f1b4a5a528eeefea283ccca2ee9777cb10c840

"""
since arch_env_get_location() is called
by env_init() which is part of the pre-relocation process, a valid, non-ENVL_UNKNOWN, value shall be returned otherwise the relocation fails with the following message:
initcall sequence 00000000002866c0 failed at call 0000000000256b34 (err=-19)

This valid, non-ENVL_UNKNOWN, value is ENVL_NOWHERE which requires to always select CONFIG_ENV_IS_NOWHERE otherwise this work-around does not work.
"""

Hope this helps.

I haven't dug deeper than that though.

Cheers,
Quentin

#2 lore raw
Quoted 35 lines · Quentin Schulz

Hi Köry,

Quoted 10 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Quoted 7 lines

---

Debugging this issue raises another issue that need investigation. If env_get_location return ENVL_IS_NOWHERE but CONFIG_ENV_IS_NOWHERE is not set, U-boot stall without any log. There might be an ENV check issue here.

I believe this may be related to what I hit almost three years ago, see commit log in https://source.denx.de/u-boot/u-boot/-/commit/b1f1b4a5a528eeefea283ccca2ee9777cb10c840

"""
since arch_env_get_location() is called
by env_init() which is part of the pre-relocation process, a valid, non-ENVL_UNKNOWN, value shall be returned otherwise the relocation fails with the following message:
initcall sequence 00000000002866c0 failed at call 0000000000256b34 (err=-19)

This valid, non-ENVL_UNKNOWN, value is ENVL_NOWHERE which requires to always select CONFIG_ENV_IS_NOWHERE otherwise this work-around does not work.
"""

Quoted 6 lines

Hope this helps.

I haven't dug deeper than that though.

Cheers,
Quentin

Hi

On reason is enum env_location are all defined in include/env_internal.h regardless CONFI_ENV_IS_IN_XXX flags being enabled.

So env_get_location() can return ENVL_NOWHERE without ENV_IS_NOWHERE flag set. which can lead to issue described by Quentin just above.

Patrice

Reviewed-by on v1 1/1
#3 lore raw
In reply to Kory Maincent
Quoted 26 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

---

Debugging this issue raises another issue that need investigation. If env_get_location return ENVL_IS_NOWHERE but CONFIG_ENV_IS_NOWHERE is not set, U-boot stall without any log. There might be an ENV check issue here.

---
 board/st/stm32mp1/stm32mp1.c | 2 ++
 1 file changed, 2 insertions(+)
board/st/stm32mp1/stm32mp1.c +0 -0
index ab7af69d472..cb5cab9f36a 100644

board/st/stm32mp1/stm32mp1.c enum env_location env_get_location(enum env_operation op, int prio) · line 758

Quoted 8 lines
board/st/stm32mp1/stm32mp1.c +2 -0
@@ -751,6 +751,8 @@ enum env_location env_get_location(enum env_operation op, int prio)
 	case BOOT_FLASH_EMMC:
 		if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC))
 			return ENVL_MMC;
+		else if (CONFIG_IS_ENABLED(ENV_IS_IN_EXT4))
+			return ENVL_EXT4;
 		else
 			return ENVL_NOWHERE;
 

Thanks
Patrice

#4 lore raw
Quoted 7 lines · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…
Quoted 6 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

Quoted 7 lines
Quoted 5 lines

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Hello,

Any news from the maintainers? Is there a reason for not being merge?

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#5 lore raw
Quoted 16 lines · Kory Maincent
Quoted 12 lines · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…
Quoted 11 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Quoted 7 lines
Quoted 1 line

Hello,

Any news from the maintainers? Is there a reason for not being merge?

Regards,

Hi Kory

I expect to send a pull request before end of this week for master branch including your patch.

Patrice

#6 lore raw
Quoted 11 lines · On Tue, 30 Sep 2025 09:45:08 +0200 Patrice CHOTARD…
Quoted 4 lines · Kory Maincent
Quoted 1 line · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…

On 9/17/25 16:17, Kory Maincent wrote:

[...]

Quoted 5 lines
Quoted 2 lines

Hello,

Quoted 8 lines
Quoted 3 lines

Any news from the maintainers? Is there a reason for not being merge?

Regards,

Hi Kory

I expect to send a pull request before end of this week for master branch including your patch.

Oh ok. Thanks for this update.

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#7 lore raw
Quoted 18 lines · Kory Maincent
Quoted 15 lines · On Tue, 30 Sep 2025 09:45:08 +0200 Patrice CHOTARD…
Quoted 4 lines · Kory Maincent
Quoted 1 line · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…

On 9/17/25 16:17, Kory Maincent wrote:

[...]

Quoted 8 lines
Quoted 2 lines

Hello,

Any news from the maintainers? Is there a reason for not being merge?

Regards,

Quoted 8 lines
Quoted 4 lines

Hi Kory

I expect to send a pull request before end of this week for master branch including your patch.

Oh ok. Thanks for this update.

Regards,

Applied to u-boot-stm32/master

Thanks
Patrice

#8 lore raw
In reply to Patrice CHOTARD
Quoted 23 lines · Patrice CHOTARD
Quoted 20 lines · Kory Maincent
Quoted 7 lines · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…
Quoted 6 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

Quoted 7 lines
Quoted 5 lines

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Hello,

Quoted 7 lines
Quoted 3 lines

Any news from the maintainers? Is there a reason for not being merge?

Regards,

Hi Kory

I expect to send a pull request before end of this week for master branch including your patch.

Since the release is Monday, I'd really prefer sooner this week to later this week if possible, thanks!

Signature · 1 line
Tom
#9 lore raw
Quoted 26 lines · Tom Rini
Quoted 25 lines · Patrice CHOTARD
Quoted 22 lines · Kory Maincent
Quoted 7 lines · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…
Quoted 6 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

Quoted 7 lines
Quoted 5 lines

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Hello,

Any news from the maintainers? Is there a reason for not being merge?

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Regards,

Hi Kory

I expect to send a pull request before end of this week for master branch including your patch.

Since the release is Monday, I'd really prefer sooner this week to later this week if possible, thanks!

Hi Tom

I am preparing the PR, it will be send today.

Thanks
Patrice

#10 lore raw
Quoted 33 lines · Patrice CHOTARD
Quoted 30 lines · Tom Rini
Quoted 29 lines · Patrice CHOTARD
Quoted 16 lines · Kory Maincent
Quoted 12 lines · On Thu, 18 Sep 2025 16:16:35 +0200 Patrice CHOTARD…
Quoted 11 lines · Kory Maincent

This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot. The previous cleanup incorrectly removed this fallback option which is needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should remain as it is configurable via menuconfig. Even if it is not described in ST defconfigs people may have enabled it in their defconfig.

Quoted 7 lines
Quoted 1 line

Hello,

Any news from the maintainers? Is there a reason for not being merge?

Regards,

Hi Kory

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I expect to send a pull request before end of this week for master branch including your patch.

Since the release is Monday, I'd really prefer sooner this week to later this week if possible, thanks!

Hi Tom

I am preparing the PR, it will be send today.

Great, thanks, I appreciate it.

Signature · 1 line
Tom