scsi: ufs: fixed DUN size for ICE encryption to be 4k

Previously the size was 512 which could have caused performance
issues.

Change-Id: If9577b1303c7cfad5c7175448ca93582222fbbb5
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
This commit is contained in:
Andrey Markovytch 2016-11-13 18:01:53 +02:00 committed by Gerrit - the friendly Code Review server
parent a80e267a8c
commit 24c9ad1c6c
3 changed files with 6 additions and 7 deletions

View file

@ -339,7 +339,8 @@ int ufs_qcom_ice_cfg_start(struct ufs_qcom_host *qcom_host,
req = cmd->request;
if (req->bio)
lba = req->bio->bi_iter.bi_sector;
lba = (req->bio->bi_iter.bi_sector) >>
UFS_QCOM_ICE_TR_DATA_UNIT_4_KB;
slot = req->tag;
if (slot < 0 || slot > qcom_host->hba->nutrs) {
@ -390,6 +391,7 @@ int ufs_qcom_ice_cfg_start(struct ufs_qcom_host *qcom_host,
bypass = ice_set.decr_bypass ? UFS_QCOM_ICE_ENABLE_BYPASS :
UFS_QCOM_ICE_DISABLE_BYPASS;
/* Configure ICE index */
ctrl_info_val =
(ice_set.crypto_data.key_index &
@ -398,8 +400,7 @@ int ufs_qcom_ice_cfg_start(struct ufs_qcom_host *qcom_host,
/* Configure data unit size of transfer request */
ctrl_info_val |=
(UFS_QCOM_ICE_TR_DATA_UNIT_4_KB &
MASK_UFS_QCOM_ICE_CTRL_INFO_CDU)
UFS_QCOM_ICE_TR_DATA_UNIT_4_KB
<< OFFSET_UFS_QCOM_ICE_CTRL_INFO_CDU;
/* Configure ICE bypass mode */

View file

@ -822,7 +822,8 @@ static int ufs_qcom_crypto_req_setup(struct ufs_hba *hba,
/* Use request LBA as the DUN value */
if (req->bio)
*dun = req->bio->bi_iter.bi_sector;
*dun = (req->bio->bi_iter.bi_sector) >>
UFS_QCOM_ICE_TR_DATA_UNIT_4_KB;
ret = ufs_qcom_ice_req_setup(host, lrbp->cmd, cc_index, enable);

View file

@ -2466,9 +2466,6 @@ static int ufshcd_prepare_crypto_utrd(struct ufs_hba *hba,
goto out;
req_desc->header.dword_0 |= cc_index | UTRD_CRYPTO_ENABLE;
if (lrbp->cmd->request && lrbp->cmd->request->bio)
dun = lrbp->cmd->request->bio->bi_iter.bi_sector;
req_desc->header.dword_1 = (u32)(dun & 0xFFFFFFFF);
req_desc->header.dword_3 = (u32)((dun >> 32) & 0xFFFFFFFF);
out: