Merge "scsi: ufshcd: Fix race between clk scaling and ungate work"
This commit is contained in:
commit
a2236a02a7
1 changed files with 15 additions and 0 deletions
|
@ -1215,6 +1215,21 @@ int ufshcd_hold(struct ufs_hba *hba, bool async)
|
||||||
start:
|
start:
|
||||||
switch (hba->clk_gating.state) {
|
switch (hba->clk_gating.state) {
|
||||||
case CLKS_ON:
|
case CLKS_ON:
|
||||||
|
/*
|
||||||
|
* Wait for the ungate work to complete if in progress.
|
||||||
|
* Though the clocks may be in ON state, the link could
|
||||||
|
* still be in hibner8 state if hibern8 is allowed
|
||||||
|
* during clock gating.
|
||||||
|
* Make sure we exit hibern8 state also in addition to
|
||||||
|
* clocks being ON.
|
||||||
|
*/
|
||||||
|
if (ufshcd_can_hibern8_during_gating(hba) &&
|
||||||
|
ufshcd_is_link_hibern8(hba)) {
|
||||||
|
spin_unlock_irqrestore(hba->host->host_lock, flags);
|
||||||
|
flush_work(&hba->clk_gating.ungate_work);
|
||||||
|
spin_lock_irqsave(hba->host->host_lock, flags);
|
||||||
|
goto start;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case REQ_CLKS_OFF:
|
case REQ_CLKS_OFF:
|
||||||
if (cancel_delayed_work(&hba->clk_gating.gate_work)) {
|
if (cancel_delayed_work(&hba->clk_gating.gate_work)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue