Skip to content

drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration#19145

Open
jlaitine wants to merge 1 commit into
apache:masterfrom
tiiuae:fix_ftl_bbm_configuration
Open

drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration#19145
jlaitine wants to merge 1 commit into
apache:masterfrom
tiiuae:fix_ftl_bbm_configuration

Conversation

@jlaitine

Copy link
Copy Markdown
Contributor

Summary

This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check compile time that FTL is enabled in case some of the drivers implement the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Impact

This checks the validity of bad-block management configuration at build time; the compilation fails
if the mtd driver implements bad block management, but the configuration doesn't enable the FTL_BBM

Testing

Tested by compiling this PR in CI

@github-actions github-actions Bot added Area: Drivers Drivers issues Size: S The size of the change in this PR is small labels Jun 15, 2026
Comment thread drivers/mtd/Kconfig Outdated
@@ -52,7 +52,7 @@ config FTL_READAHEAD

config FTL_BBM
bool "Enable bad block management in the FTL layer"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the prompt string

@jlaitine jlaitine force-pushed the fix_ftl_bbm_configuration branch from a212414 to d934816 Compare June 15, 2026 17:26
@jlaitine jlaitine marked this pull request as ready for review June 15, 2026 19:04
…guration

This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check
compile time that FTL is enabled in case some of the drivers implement
the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
@jlaitine jlaitine force-pushed the fix_ftl_bbm_configuration branch from d934816 to 71ef4e2 Compare June 15, 2026 20:44
@jlaitine jlaitine requested a review from simbit18 as a code owner June 15, 2026 20:44
@github-actions github-actions Bot added the Arch: arm Issues related to ARM (32-bit) architecture label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Drivers Drivers issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants