diff mbox series

[2/2] scsi: hisi_sas: Set a port invalid only if there is no devices attached when refreshing port id

Message ID 1672805000-141102-3-git-send-email-chenxiang66@hisilicon.com (mailing list archive)
State Accepted
Headers show
Series hisi_sas: Some misc update | expand

Commit Message

chenxiang Jan. 4, 2023, 4:03 a.m. UTC
From: Yihang Li <liyihang9@huawei.com>

Currently it sets the port invalid if one phy in the port is not enabled,
which may cause issues in expander situation. In directly attached
situation, if phy up doesn't occur in time when refreshing port id, the
port is incorrectly set to invalid which will also cause disk lost.

Therefore set a port invalid only if there is no devices attached to the port.

Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 7ce26bf..bffe4a8 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1316,7 +1316,7 @@  static void hisi_sas_refresh_port_id(struct hisi_hba *hisi_hba)
 				device->linkrate = phy->sas_phy.linkrate;
 
 			hisi_hba->hw->setup_itct(hisi_hba, sas_dev);
-		} else
+		} else if (!port->port_attached)
 			port->id = 0xff;
 	}
 }