diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2016-05-04 14:38:12 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-05-17 17:54:36 +0300 |
commit | 3c866568aff7dcfc0bbd5ffc7fcc34fa8f100f67 (patch) | |
tree | bfc1fac4d66074396bde169f4a4dfc26fbc6f8b5 /drivers/mmc | |
parent | 7ff2760999a86e4d2b1af93dcf0f0d336c309571 (diff) | |
download | linux-3c866568aff7dcfc0bbd5ffc7fcc34fa8f100f67.tar.xz |
mmc: block: Always switch back to main area after RPMB access
In preparation to support the use of the RPMB partition with transfer
modes that might require re-tuning, always switch back to the main
area after RPMB access.
RPMB is accessible only via IOCTL so only those paths are affected.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/card/block.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 5f2a3d69344f..48a5d2e04cea 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -618,6 +618,10 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev, ioc_err = __mmc_blk_ioctl_cmd(card, md, idata); + /* Always switch back to main area after RPMB access */ + if (md->area_type & MMC_BLK_DATA_AREA_RPMB) + mmc_blk_part_switch(card, dev_get_drvdata(&card->dev)); + mmc_put_card(card); err = mmc_blk_ioctl_copy_to_user(ic_ptr, idata); @@ -685,6 +689,10 @@ static int mmc_blk_ioctl_multi_cmd(struct block_device *bdev, for (i = 0; i < num_of_cmds && !ioc_err; i++) ioc_err = __mmc_blk_ioctl_cmd(card, md, idata[i]); + /* Always switch back to main area after RPMB access */ + if (md->area_type & MMC_BLK_DATA_AREA_RPMB) + mmc_blk_part_switch(card, dev_get_drvdata(&card->dev)); + mmc_put_card(card); /* copy to user if data and response */ |