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

Commit 03d619d6 authored by Asutosh Das's avatar Asutosh Das
Browse files

Revert "scsi: ufs: stub UFS shutdown handler"



This reverts commit aa484ff4 ("scsi: ufs: stub UFS shutdown
handler").
This is reverted so as to enable PON (Power-off Notification).
PON would notify the ufs device of the incoming power-down
so that the device can prepare for the same before
the power to the device is cut.

CRs-fixed: 941978
Change-Id: Idee8691d769218d7e732c9b7f936a2c40946b239
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 4a91ea36
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -8654,11 +8654,22 @@ static inline void ufshcd_add_sysfs_nodes(struct ufs_hba *hba)
 */
int ufshcd_shutdown(struct ufs_hba *hba)
{
	/*
	 * 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.
	 */
	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 */
	return 0;
}
EXPORT_SYMBOL(ufshcd_shutdown);