if (gating_allowed) {
ufshcd_setup_clocks(hba, true);
} else {
+ spin_lock_irqsave(hba->host->host_lock, flags);
hba->clk_gating.state = CLKS_ON;
+ spin_unlock_irqrestore(hba->host->host_lock, flags);
}
/* Exit from hibern8 */
if (ufshcd_can_hibern8_during_gating(hba)) {
ufshcd_set_link_trans_hibern8(hba);
if (ufshcd_link_hibern8_ctrl(hba, true)) {
+ spin_lock_irqsave(hba->host->host_lock, flags);
+ hba->clk_gating.state = __CLKS_ON;
+ spin_unlock_irqrestore(hba->host->host_lock, flags);
+ hba->clk_gating.is_suspended = true;
+ ufshcd_reset_and_restore(hba);
hba->clk_gating.state = CLKS_ON;
+ hba->clk_gating.is_suspended = false;
trace_ufshcd_clk_gating(dev_name(hba->dev),
hba->clk_gating.state);
goto out;
if (!ret)
ufshcd_set_link_hibern8(hba);
else {
+ ufshcd_host_reset_and_restore(hba);
goto out;
}
/*