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

Commit 7ae6b4b6 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

scsi: ufs: stub UFS shutdown handler



Currently it seems possible that UFS shutdown handler may race with some
other UFS transfer requests and it may disable the clocks while normal UFS
requests are in progress. Until we fix this race properly, this change
stubs out the UFS shutdown handler. Stubbing out UFS shutdown handler
shouldn't have any functional side effects as UFS device's cache should
anyway be synced by the SCSI shutdown handler. UFS shutdown handler's
main purpose was to send power down notification to UFS device but it
should work even without this explicit notification.

Change-Id: I557891c71defbde722bba1a884f608f4ba3c7da3
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent f1a9f6d4
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -7215,22 +7215,11 @@ static inline void ufshcd_add_sysfs_nodes(struct ufs_hba *hba)
 */
int ufshcd_shutdown(struct ufs_hba *hba)
{
	int ret = 0;

	if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba))
		goto out;

	if (pm_runtime_suspended(hba->dev)) {
		ret = ufshcd_runtime_resume(hba);
		if (ret)
			goto out;
	}

	ret = ufshcd_suspend(hba, UFS_SHUTDOWN_PM);
out:
	if (ret)
		dev_err(hba->dev, "%s failed, err %d\n", __func__, ret);
	/* allow force shutdown even in case of errors */
	/*
	 * TODO: This function should send the power down notification to
	 * UFS device and then power off the UFS link. But we need to be sure
	 * that there will not be any new UFS requests issued after this.
	 */
	return 0;
}
EXPORT_SYMBOL(ufshcd_shutdown);