scsi: hisi_sas: Set a port invalid only if there are no devices attached when refresh...
authorYihang Li <liyihang9@huawei.com>
Wed, 4 Jan 2023 04:03:20 +0000 (12:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:27:18 +0000 (08:27 +0100)
commitd4b717e34dacf33c6b3ad6572b6660d3d1c2b729
treecc57a7446e6a8565959352df24f8c4dfca43cc18
parente15750aa28a6f038c709cb7b4dc4ab6603aeeb8f
scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id

[ Upstream commit f58c89700630da6554b24fd3df293a24874c10c1 ]

Currently the driver 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 are no devices attached to the
port.

Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1672805000-141102-3-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/hisi_sas/hisi_sas_main.c