[PATCH 2/3] scsi: ufs: set device state to power-off before 1st link startup

From: DooHyun Hwang
Date: Thu Feb 04 2021 - 20:50:13 EST


In the ufshcd init sequence, device state should be power-off
bacause the UFS device is not active.

Signed-off-by: DooHyun Hwang <dh0421.hwang@xxxxxxxxxxx>
---
drivers/scsi/ufs/ufshcd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 286f7c918f0e..32cb3b0dcbcf 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -9447,13 +9447,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
/* Hold auto suspend until async scan completes */
pm_runtime_get_sync(dev);
atomic_set(&hba->scsi_block_reqs_cnt, 0);
+
/*
- * We are assuming that device wasn't put in sleep/power-down
- * state exclusively during the boot stage before kernel.
- * This assumption helps avoid doing link startup twice during
- * ufshcd_probe_hba().
+ * The device-initialize-sequence hasn't been invoked yet.
+ * Set the device to power-off state
*/
- ufshcd_set_ufs_dev_active(hba);
+ ufshcd_set_ufs_dev_poweroff(hba);

async_schedule(ufshcd_async_scan, hba);
ufs_sysfs_add_nodes(hba->dev);
--
2.29.0