|
@@ -739,7 +739,14 @@ static void ufshcd_gate_work(struct work_struct *work)
|
|
|
unsigned long flags;
|
|
|
|
|
|
spin_lock_irqsave(hba->host->host_lock, flags);
|
|
|
- if (hba->clk_gating.is_suspended) {
|
|
|
+ /*
|
|
|
+ * In case you are here to cancel this work the gating state
|
|
|
+ * would be marked as REQ_CLKS_ON. In this case save time by
|
|
|
+ * skipping the gating work and exit after changing the clock
|
|
|
+ * state to CLKS_ON.
|
|
|
+ */
|
|
|
+ if (hba->clk_gating.is_suspended ||
|
|
|
+ (hba->clk_gating.state == REQ_CLKS_ON)) {
|
|
|
hba->clk_gating.state = CLKS_ON;
|
|
|
goto rel_lock;
|
|
|
}
|