Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit f10cf63

Browse files
Konstantin VyshetskyTreehugger Robot
authored andcommitted
ANDROID: scsi: ufs: add UFSHCD_ANDROID_QUIRK_SET_IID_TO_ONE
Add UFSHCD_ANDROID_QUIRK_SET_IID_TO_ONE for host controllers which break when the Tag, LUN, and IID in the UPIU are all 0. In such cases set the IID to 1 if the quirk is set. Bug: 303649600 Change-Id: I43b410e947cffdf0b4acd2c38ba6b1432b2f1342 Signed-off-by: Konstantin Vyshetsky <[email protected]>
1 parent 74c0232 commit f10cf63

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,6 +2744,9 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
27442744
else
27452745
ret = -EINVAL;
27462746

2747+
if (!ret && hba->android_quirks & UFSHCD_ANDROID_QUIRK_SET_IID_TO_ONE)
2748+
lrbp->ucd_req_ptr->header.iid = 1;
2749+
27472750
return ret;
27482751
}
27492752

@@ -2768,6 +2771,8 @@ static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
27682771
if (likely(lrbp->cmd)) {
27692772
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, lrbp->cmd->sc_data_direction, 0);
27702773
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
2774+
if (hba->android_quirks & UFSHCD_ANDROID_QUIRK_SET_IID_TO_ONE)
2775+
lrbp->ucd_req_ptr->header.iid = 1;
27712776
} else {
27722777
ret = -EINVAL;
27732778
}

include/ufs/ufshcd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ enum ufshcd_android_quirks {
691691
* 64-bit addressing support.
692692
*/
693693
UFSHCD_ANDROID_QUIRK_36BIT_ADDRESS_DMA = 1 << 3,
694+
695+
/* Set IID to one. */
696+
UFSHCD_ANDROID_QUIRK_SET_IID_TO_ONE = 1 << 30,
694697
};
695698

696699
enum ufshcd_caps {

0 commit comments

Comments
 (0)