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: Yaniv Gardi <ygardi@codeaurora.org> [subhashj@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [venkatg@codeaurora.org: resolved trivial merge conflicts] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This commit is contained in:
parent
e6aa6d8e5a
commit
9da665ff6d
2 changed files with 14 additions and 0 deletions
|
@ -2243,6 +2243,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",
|
||||
|
@ -2301,6 +2305,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",
|
||||
|
|
|
@ -508,6 +508,12 @@ struct ufs_hba {
|
|||
/* UFSHC advertises 64-bit not supported even though it supports */
|
||||
#define UFSHCD_QUIRK_BROKEN_CAP_64_BIT_0 (1 << 3)
|
||||
|
||||
/*
|
||||
* delay before each dme command is required as the unipro
|
||||
* layer has shown instabilities
|
||||
*/
|
||||
#define UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS (1 << 7)
|
||||
|
||||
struct uic_command *active_uic_cmd;
|
||||
struct mutex uic_cmd_mutex;
|
||||
struct completion *uic_async_done;
|
||||
|
|
Loading…
Add table
Reference in a new issue