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

Commit 294cf3d0 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 resuming while handling errors during suspend"

parents bcb87d5a e6cc2a1b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4536,6 +4536,13 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
	if (!sdp || !scsi_device_online(sdp))
		return -ENODEV;

	/*
	 * If scsi commands fail, the scsi mid-layer schedules scsi error-
	 * handling, which would wait for host to be resumed. Since we know
	 * we are functional while we are here, skip host resume in error
	 * handling context.
	 */
	hba->host->eh_noresume = 1;
	if (pwr_mode != UFS_ACTIVE_PWR_MODE) {
		ret = ufshcd_send_request_sense(hba, sdp);
		if (ret)
@@ -4564,6 +4571,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
	if (!ret)
		hba->curr_dev_pwr_mode = pwr_mode;
out:
	hba->host->eh_noresume = 0;
	return ret;
}