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

Commit c7ab053e 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: Release rw_sem while sending device management requests"

parents 01ab04a6 5c9ff180
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3445,6 +3445,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
	int tag;
	struct completion wait;
	unsigned long flags;
	bool has_read_lock = false;

	/*
	 * May get invoked from shutdown and IOCTL contexts.
@@ -3452,8 +3453,10 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
	 * In error recovery context, it may come with lock acquired.
	 */

	if (!ufshcd_is_shutdown_ongoing(hba) && !ufshcd_eh_in_progress(hba))
	if (!ufshcd_is_shutdown_ongoing(hba) && !ufshcd_eh_in_progress(hba)) {
		down_read(&hba->lock);
		has_read_lock = true;
	}

	/*
	 * Get free slot, sleep if slots are unavailable.
@@ -3486,7 +3489,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
out_put_tag:
	ufshcd_put_dev_cmd_tag(hba, tag);
	wake_up(&hba->dev_cmd.tag_wq);
	if (!ufshcd_is_shutdown_ongoing(hba) && !ufshcd_eh_in_progress(hba))
	if (has_read_lock)
		up_read(&hba->lock);
	return err;
}