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

Commit cc23a3a8 authored by Yaniv Gardi's avatar Yaniv Gardi
Browse files

scsi: ufs: add quirk for delay before dme commands



add delay before each dme command (get, set), as this delay is
required for stability purposes.

Change-Id: I5aca4c25f251c41c6764269366a8ca7235ffafc1
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
parent 27a6d000
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1895,6 +1895,10 @@ int ufshcd_dme_set_attr(struct ufs_hba *hba, u32 attr_sel,
	uic_cmd.argument2 = UIC_ARG_ATTR_TYPE(attr_set);
	uic_cmd.argument3 = mib_val;

	/* for stability purposes */
	if (hba->quirks & UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS)
		usleep_range(1000, 1100);

	ret = ufshcd_send_uic_cmd(hba, &uic_cmd);
	if (ret)
		dev_err(hba->dev, "%s: attr-id 0x%x val 0x%x error code %d\n",
@@ -1928,6 +1932,10 @@ int ufshcd_dme_get_attr(struct ufs_hba *hba, u32 attr_sel,
		UIC_CMD_DME_PEER_GET : UIC_CMD_DME_GET;
	uic_cmd.argument1 = attr_sel;

	/* for stability purposes */
	if (hba->quirks & UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS)
		usleep_range(1000, 1100);

	ret = ufshcd_send_uic_cmd(hba, &uic_cmd);
	if (ret) {
		dev_err(hba->dev, "%s: attr-id 0x%x error code %d\n",
+6 −0
Original line number Diff line number Diff line
@@ -397,6 +397,12 @@ struct ufs_hba {
	/* runtime pm or system suspend/resume is broken */
	#define UFSHCD_QUIRK_BROKEN_SUSPEND              (1 << 6)

	/*
	 * delay before each dme command is required as the unipro
	 * layer has shown instabilities
	 */
	#define UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS        (1 << 7)

	wait_queue_head_t tm_wq;
	wait_queue_head_t tm_tag_wq;
	unsigned long tm_condition;