From 30bc07bf5c510d6be87cbe3d697346ca1fddcbd3 Mon Sep 17 00:00:00 2001 From: Jiaxing Luo Date: Thu, 15 Aug 2019 10:41:34 +0800 Subject: [PATCH] scsi: hisi_sas: directly return when running I_T_nexus reset if phy disabled driver inclusion category: bugfix bugzilla: NA CVE: NA At hisi_sas_debug_I_T_nexus_reset(), we call sas_phy_reset() to have phy reset. But if the phy is disabled, sas_phy_reset() will directly return -ENODEV without issue a phy reset request. If so, We can directly return -ENODEV to libsas before issue a phy reset. 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, 5 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 4f3af6aaebef..03df459d0959 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1771,6 +1771,11 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device) struct sas_ha_struct *sas_ha = &hisi_hba->sha; DECLARE_COMPLETION_ONSTACK(phyreset); + if (!local_phy->enabled) { + sas_put_local_phy(local_phy); + return -ENODEV; + } + if (scsi_is_sas_phy_local(local_phy)) { struct asd_sas_phy *sas_phy = sas_ha->sas_phy[local_phy->number]; -- GitLab