Skip to content

Commit 83bb24a

Browse files
ahunter6cjb
authored andcommitted
mmc: core: add high-capacity erase size capability flag
Let drivers specify the use of high-capacity erase size. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
1 parent 2cecdf0 commit 83bb24a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/mmc/core/mmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
952952
* If enhanced_area_en is TRUE, host needs to enable ERASE_GRP_DEF
953953
* bit. This bit will be lost every time after a reset or power off.
954954
*/
955-
if (card->ext_csd.enhanced_area_en) {
955+
if (card->ext_csd.enhanced_area_en ||
956+
(card->ext_csd.rev >= 3 && (host->caps2 & MMC_CAP2_HC_ERASE_SZ))) {
956957
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
957958
EXT_CSD_ERASE_GROUP_DEF, 1,
958959
card->ext_csd.generic_cmd6_time);

include/linux/mmc/host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ struct mmc_host {
236236
MMC_CAP2_HS200_1_2V_SDR)
237237
#define MMC_CAP2_BROKEN_VOLTAGE(1 << 7)/* Use the broken voltage */
238238
#define MMC_CAP2_DETECT_ON_ERR(1 << 8)/* On I/O err check card removal */
239+
#define MMC_CAP2_HC_ERASE_SZ(1 << 9)/* High-capacity erase size */
239240

240241
mmc_pm_flag_tpm_caps;/* supported pm features */
241242
unsigned int power_notify_type;

0 commit comments

Comments
 (0)