JEDEC standard requires that EXT_CSD_PARTITION_SETTING_COMPLETED bit must be set in order to take in account enhanced area and general purpose partitions (gp) values. Current code doesn't checks this bit and blindly trust enhanced area and gp values. Moreover, "enhanced_area_en" attribute was set according to gp values but not necessary enhanced area one. It's then used to switch EXT_CSD_ERASE_GROUP_DEF bit which requires EXT_CSD_PARTITION_SETTING_COMPLETED. This attribute has been replaced by "partition_setting_completed" that match the expected behavior. User is now warned in case of misconfiguration. Plus, some code has been moved into functions for two reasons : * Functional reason (one behavior per function) * Deep indentation result Grégory Soutadé (3): mmc: Move code that manages user area and gp partitions into functions mmc: Replace "enhanced_area_en" attribute by "partition_setting_completed" mmc: Checks EXT_CSD_PARTITION_SETTING_COMPLETED before partitions computation drivers/mmc/core/mmc.c | 172 ++++++++++++++++++++++++++-------------------- include/linux/mmc/card.h | 2 +- include/linux/mmc/mmc.h | 2 + 3 files changed, 102 insertions(+), 74 deletions(-) >From commit 7ec62d421bdf29cb31101ae2689f7f3a9906289a in master linux tree. Changelog v5: Remove some useless braces Changelog v4: Second patch in v3 doesn't compile Changelog v3: Move code BEFORE fixing bugs. Changelog v2: Move code for user area and general purpose partitions into functions. -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html