Commit 8a769f3c authored by Yihang Li's avatar Yihang Li Committed by ZhouJuan
Browse files

scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id

mainline inclusion
from mainline-v6.2-rc4
commit f58c8970
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6V6I1
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f58c89700630



----------------------------------------------------------------------

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: default avatarYihang Li <liyihang9@huawei.com>
Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1672805000-141102-3-git-send-email-chenxiang66@hisilicon.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarxiabing <xiabing12@h-partners.com>
parent 28bc42bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1468,7 +1468,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;
	}
}