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

Commit e69f2db7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: avoid deadlock by releasing rw_sem during hibernate"

parents b575c077 d79e38f7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -10239,7 +10239,15 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up)
	 * racing during clock frequency scaling sequence.
	 */
	if (ufshcd_is_auto_hibern8_supported(hba)) {
		/*
		 * Scaling prepare acquires the rw_sem: lock
		 * h8 may sleep in case of errors.
		 * e.g. link_recovery. Hence, release the rw_sem
		 * before hibern8.
		 */
		up_write(&hba->lock);
		ret = ufshcd_uic_hibern8_enter(hba);
		down_write(&hba->lock);
		if (ret)
			/* link will be bad state so no need to scale_up_gear */
			return ret;
@@ -10370,6 +10378,8 @@ static ssize_t ufshcd_clkscale_enable_store(struct device *dev,

	hba->clk_scaling.is_allowed = value;

	flush_work(&hba->eh_work);

	if (value) {
		ufshcd_resume_clkscaling(hba);
	} else {