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

Commit 153b5488 authored by Yaniv Gardi's avatar Yaniv Gardi Committed by Subhash Jadavani
Browse files

scsi: ufs: add a quirk to fix gear change to HS



With the G3 UFS devices, changing gear into HS is failing.
This quirk solves the problem of changing gear into HS by enabling
the attribute that specifies whether or not the inbound Link supports
unterminated line in HS mode

Change-Id: Id9c0e391b7bac0ef720841cf75c7da0e3cc44d56
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent af289785
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -2463,12 +2463,24 @@ out:
static int ufshcd_uic_change_pwr_mode(struct ufs_hba *hba, u8 mode)
{
	struct uic_command uic_cmd = {0};
	int ret;

	if (hba->quirks & UFSHCD_BROKEN_GEAR_CHANGE_INTO_HS) {
		ret = ufshcd_dme_set(hba,
				UIC_ARG_MIB_SEL(PA_RXHSUNTERMCAP, 0), 1);
		if (ret) {
			dev_err(hba->dev, "%s: failed to enable PA_RXHSUNTERMCAP ret %d\n",
						__func__, ret);
			goto out;
		}
	}

	uic_cmd.command = UIC_CMD_DME_SET;
	uic_cmd.argument1 = UIC_ARG_MIB(PA_PWRMODE);
	uic_cmd.argument3 = mode;

	return ufshcd_uic_pwr_ctrl(hba, &uic_cmd);
	ret = ufshcd_uic_pwr_ctrl(hba, &uic_cmd);
out:
	return ret;
}

static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba)
+7 −0
Original line number Diff line number Diff line
@@ -488,6 +488,13 @@ struct ufs_hba {
	 */
	#define UFSHCD_BROKEN_LCC			  (1 << 9)

	/*
	 * The attribute PA_RXHSUNTERMCAP specifies whether or not the
	 * inbound Link supports unterminated line in HS mode. Setting this
	 * attribute to 1 fixes moving to HS gear.
	 */
	#define UFSHCD_BROKEN_GEAR_CHANGE_INTO_HS        (1 << 10)

	wait_queue_head_t tm_wq;
	wait_queue_head_t tm_tag_wq;
	unsigned long tm_condition;