Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ec7da63 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: Fix ufshcd_hold dead loop issue if error recovery is handing"

parents 54584f4f 4938c963
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2237,7 +2237,9 @@ int ufshcd_hold(struct ufs_hba *hba, bool async)
		 * If the timer was active but the callback was not running
		 * we have nothing to do, just change state and return.
		 */
		if (hrtimer_try_to_cancel(&hba->clk_gating.gate_hrtimer) == 1) {
		if ((hrtimer_try_to_cancel(&hba->clk_gating.gate_hrtimer) == 1)
			&& !(work_pending(&hba->clk_gating.gate_work))
			&& !hba->clk_gating.gate_wk_in_process) {
			hba->clk_gating.state = CLKS_ON;
			trace_ufshcd_clk_gating(dev_name(hba->dev),
						hba->clk_gating.state);
@@ -2289,7 +2291,9 @@ static void ufshcd_gate_work(struct work_struct *work)
						clk_gating.gate_work);
	unsigned long flags;

	hba->clk_gating.gate_wk_in_process = true;
	spin_lock_irqsave(hba->host->host_lock, flags);

	if (hba->clk_gating.state == CLKS_OFF)
		goto rel_lock;
	/*
@@ -2365,6 +2369,7 @@ static void ufshcd_gate_work(struct work_struct *work)
rel_lock:
	spin_unlock_irqrestore(hba->host->host_lock, flags);
out:
	hba->clk_gating.gate_wk_in_process = false;
	return;
}

+1 −0
Original line number Diff line number Diff line
@@ -480,6 +480,7 @@ struct ufs_clk_gating {
	struct device_attribute delay_perf_attr;
	struct device_attribute enable_attr;
	bool is_enabled;
	bool gate_wk_in_process;
	int active_reqs;
	struct workqueue_struct *clk_gating_workq;
};