From c69f67b4507486358cbf7ba442eb5e5243b51131 Mon Sep 17 00:00:00 2001 From: Jiaxing Luo Date: Thu, 15 Aug 2019 16:57:28 +0800 Subject: [PATCH] scsi: hisi_sas: no delay after issue phy reset if sas_smp_phy_control() fail driver inclusion category: bugfix bugzilla: NA CVE: NA At expander ENV, we delay after issue phy reset to wait for hardware to handle phy reset. But if sas_smp_phy_control() fail, delay is unnecessary because we will continue controller reset. So we do not delay if sas_smp_phy_control() return error. Feature or Bugfix: Bugfix Signed-off-by: Jiaxing Luo Signed-off-by: John Garry Signed-off-by: luojiaxing Reviewed-by: chenxiang Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 03df459d0959..df1a4558da16 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1806,8 +1806,9 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device) if (!ret) hisi_sas_phy_down(hisi_hba, sas_phy->id, 0); } else if (sas_dev->dev_status != HISI_SAS_DEV_INIT) - /* Sleep 2s to wait for I_T reset at expander env */ - msleep(2000); + /* Sleep 2s, wait for I_T reset at expander env except fail */ + if (!rc) + msleep(2000); return rc; } -- GitLab