int ret;
        int data_len;
 
-       if (hba->ufs_version < ufshci_version(4, 0) || !hba->dev_info.b_advanced_rpmb_en ||
-           !(hba->capabilities & MASK_EHSLUTRD_SUPPORTED))
+       if (hba->ufs_version < ufshci_version(4, 0) || !hba->dev_info.b_advanced_rpmb_en)
                return -EINVAL;
 
        if (rpmb_request->ehs_req.length != 2 || rpmb_request->ehs_req.ehs_type != 1)
 
        /* Advanced RPMB starts from UFS 4.0, so its command type is UTP_CMD_TYPE_UFS_STORAGE */
        lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
 
-       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, dir, 2);
+       /*
+        * According to UFSHCI 4.0 specification page 24, if EHSLUTRDS is 0, host controller takes
+        * EHS length from CMD UPIU, and SW driver use EHS Length field in CMD UPIU. if it is 1,
+        * HW controller takes EHS length from UTRD.
+        */
+       if (hba->capabilities & MASK_EHSLUTRD_SUPPORTED)
+               ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, dir, 2);
+       else
+               ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, dir, 0);
 
        /* update the task tag and LUN in the request upiu */
        req_upiu->header.flags = upiu_flags;