Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0956023 authored by Sayali Lokhande's avatar Sayali Lokhande
Browse files

scsi: ufs: Update condition for setting PA_TXHSADAPTTYPE



Attribute PA_TXHSADAPTTYPE(0x15d4) is added in
unipro version 1.8 onwards for UFS HS G4 support.
On older version's (which do not support G4),
ufshcd_dme_set for attr 0x15d4 always fails with
INVALID_MIB_ATTRIBUTE and fails QMVS validation.
This change uses correct condition check before
setting UFS adapt type attribute.

Change-Id: I3c8ff1b3b2aff2aba86cf0d812e50d90466ccd18
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent cdbe2d3e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4985,9 +4985,9 @@ int ufshcd_dme_set_attr(struct ufs_hba *hba, u32 attr_sel,
	} while (ret && peer && --retries);

	if (ret)
		dev_err(hba->dev, "%s: attr-id 0x%x val 0x%x failed %d retries\n",
		dev_err(hba->dev, "%s: attr-id 0x%x val 0x%x failed %d retries, err %d\n",
			set, UIC_GET_ATTR_ID(attr_sel), mib_val,
			UFS_UIC_COMMAND_RETRIES - retries);
			UFS_UIC_COMMAND_RETRIES - retries, ret);

	return ret;
}
@@ -5501,7 +5501,7 @@ int ufshcd_change_power_mode(struct ufs_hba *hba,
		/* INITIAL ADAPT */
		ufshcd_dme_set(hba, UIC_ARG_MIB(PA_TXHSADAPTTYPE),
			       PA_INITIAL_ADAPT);
	} else {
	} else if (hba->ufs_version >= UFSHCI_VERSION_30) {
		/* NO ADAPT */
		ufshcd_dme_set(hba, UIC_ARG_MIB(PA_TXHSADAPTTYPE), PA_NO_ADAPT);
	}