From aa484ff4b600deef66cbb630379e902b9ff20a97 Mon Sep 17 00:00:00 2001 From: Subhash Jadavani Date: Mon, 3 Nov 2014 20:29:23 -0800 Subject: [PATCH] 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: Subhash Jadavani --- drivers/scsi/ufs/ufshcd.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 54f53f547b32..4959aefcc0d1 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7247,22 +7247,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); -- 2.11.0