scsi: ufs: fix deadlock when attempting hibern8 during clock gating
If UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability is enabled then UFS driver should put the link in hibern8 along with gating of UFS related clocks but we are hitting the deadlock in this case. UFS gating work calls the ufshcd_uic_hibern8_enter() which would call the helper function ufshcd_uic_pwr_ctrl(). ufshcd_uic_pwr_ctrl() calls ufshcd_hold() to make sure that clocks are ungated which means clock ungate work would end up waiting for the gate work to finish which causes the deadlock (as gate work is waiting for ufshcd_uic_pwer_ctrl() to finish). Fix this issue by letting the callers of ufshcd_uic_pwr_ctrl() to decide if they really need to vote for the UFS clocks or not. Change-Id: I5b9d1a1c75bbc5a7097e6cc71cd9ec6885cd271a Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> [subhashj@codeaurora.org: resolved merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
parent
2fcdc6a234
commit
155737fa4e
1 changed files with 0 additions and 2 deletions
|
@ -2718,7 +2718,6 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
|
|||
bool uic_ready;
|
||||
int retries = POWER_MODE_RETRIES;
|
||||
|
||||
ufshcd_hold(hba, false);
|
||||
mutex_lock(&hba->uic_cmd_mutex);
|
||||
init_completion(&uic_async_done);
|
||||
ufshcd_add_delay_before_dme_cmd(hba);
|
||||
|
@ -2788,7 +2787,6 @@ out:
|
|||
hba->uic_async_done = NULL;
|
||||
spin_unlock_irqrestore(hba->host->host_lock, flags);
|
||||
mutex_unlock(&hba->uic_cmd_mutex);
|
||||
ufshcd_release(hba);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue