diff options
Diffstat (limited to 'drivers/mmc/core/block.c')
-rw-r--r-- | drivers/mmc/core/block.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 20135a5de748..2cfb963d9f37 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c | |||
@@ -72,6 +72,7 @@ MODULE_ALIAS("mmc:block"); | |||
72 | #define MMC_BLK_TIMEOUT_MS (10 * 1000) | 72 | #define MMC_BLK_TIMEOUT_MS (10 * 1000) |
73 | #define MMC_SANITIZE_REQ_TIMEOUT 240000 | 73 | #define MMC_SANITIZE_REQ_TIMEOUT 240000 |
74 | #define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16) | 74 | #define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16) |
75 | #define MMC_EXTRACT_VALUE_FROM_ARG(x) ((x & 0x0000FF00) >> 8) | ||
75 | 76 | ||
76 | #define mmc_req_rel_wr(req) ((req->cmd_flags & REQ_FUA) && \ | 77 | #define mmc_req_rel_wr(req) ((req->cmd_flags & REQ_FUA) && \ |
77 | (rq_data_dir(req) == WRITE)) | 78 | (rq_data_dir(req) == WRITE)) |
@@ -587,6 +588,24 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, | |||
587 | } | 588 | } |
588 | 589 | ||
589 | /* | 590 | /* |
591 | * Make sure the cache of the PARTITION_CONFIG register and | ||
592 | * PARTITION_ACCESS bits is updated in case the ioctl ext_csd write | ||
593 | * changed it successfully. | ||
594 | */ | ||
595 | if ((MMC_EXTRACT_INDEX_FROM_ARG(cmd.arg) == EXT_CSD_PART_CONFIG) && | ||
596 | (cmd.opcode == MMC_SWITCH)) { | ||
597 | struct mmc_blk_data *main_md = dev_get_drvdata(&card->dev); | ||
598 | u8 value = MMC_EXTRACT_VALUE_FROM_ARG(cmd.arg); | ||
599 | |||
600 | /* | ||
601 | * Update cache so the next mmc_blk_part_switch call operates | ||
602 | * on up-to-date data. | ||
603 | */ | ||
604 | card->ext_csd.part_config = value; | ||
605 | main_md->part_curr = value & EXT_CSD_PART_CONFIG_ACC_MASK; | ||
606 | } | ||
607 | |||
608 | /* | ||
590 | * According to the SD specs, some commands require a delay after | 609 | * According to the SD specs, some commands require a delay after |
591 | * issuing the command. | 610 | * issuing the command. |
592 | */ | 611 | */ |