From 9f16505c12f476b6158756bde4bc6f85c1432cd2 Mon Sep 17 00:00:00 2001 From: Jason Yan Date: Wed, 8 Aug 2018 20:16:17 +0800 Subject: [PATCH] scsi: libsas: re-init the negotiated_linkrate when phy down v2 When the PHY is down or disabled, the old negotiated_linkrate still can be seen by sysfs. Re-init the negotiated_linkrate so that it is consistent with the state of the PHY. Signed-off-by: Jason Yan --- include/scsi/libsas.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 258d5d8c71c8..15a2c83ae48e 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -449,6 +449,9 @@ static inline void sas_phy_disconnected(struct asd_sas_phy *phy) { phy->oob_mode = OOB_NOT_CONNECTED; phy->linkrate = SAS_LINK_RATE_UNKNOWN; + + if (phy->phy) + phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; } static inline unsigned int to_sas_gpio_od(int device, int bit) -- GitLab