diff options
author | Parth Dixit <parthd@codeaurora.org> | 2016-04-28 20:45:52 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-05-09 23:43:51 -0700 |
commit | 9946b6a462b471080312b0d633ec03000a9913a8 (patch) | |
tree | ba46f46b2703e65d5e4e2cc092c18fdcb8031e2b | |
parent | 1c3485ca2ed200f42d1045ddc2823240ecc2aaf7 (diff) |
platform: msm_shared: use lun_cfg only for lun 0 to 8
luncfg to initialize lun blk count and erase block size
is used only for lun0 to lun8 with lun_cfg[8] as the max array size.
RPMB is a special lun with Lun number 0xC4 and updating lun_cfg with
index 0xc4 corrupts DDR and results into unexpected results.
So use rpmb_num_blocks member of ufs_device structure for storing
the rpmb block size and use lun_cfg only for lun 0 to lun 8
Change-Id: Ia6a0d04974e5de4957df179fa505510caf331e43
-rw-r--r-- | platform/msm_shared/dme.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/platform/msm_shared/dme.c b/platform/msm_shared/dme.c index c6d651da..c98730b2 100644 --- a/platform/msm_shared/dme.c +++ b/platform/msm_shared/dme.c @@ -493,13 +493,20 @@ int dme_read_unit_desc(struct ufs_dev *dev, uint8_t index) return -UFS_FAILURE; } - dev->lun_cfg[index].logical_blk_cnt = BE64(desc->logical_blk_cnt); - - dev->lun_cfg[index].erase_blk_size = BE32(desc->erase_blk_size); - // use only the lower 32 bits for rpmb partition size if (index == UFS_WLUN_RPMB) dev->rpmb_num_blocks = BE32(desc->logical_blk_cnt >> 32); + /* + rpmb will not use blk count and blk size from lun_cfg as it has + its own entries in ufs_dev structure + */ + else + { + dev->lun_cfg[index].logical_blk_cnt = BE64(desc->logical_blk_cnt); + dev->lun_cfg[index].erase_blk_size = BE32(desc->erase_blk_size); + } + + return UFS_SUCCESS; } |