]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: libsas: Do discovery on empty PHY to update PHY info
authorJohn Garry <john.garry@huawei.com>
Fri, 12 Apr 2019 08:57:56 +0000 (16:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:33 +0000 (06:43 -0700)
commit43a25a4a716e519f55ebbf89b349f5d82f918c2e
tree42c9def3dcd4431b13e2cb2c760285eda5b53d00
parente363683dd6e7428648c63b3074c4ca228ac0d4e8
scsi: libsas: Do discovery on empty PHY to update PHY info

[ Upstream commit d8649fc1c5e40e691d589ed825998c36a947491c ]

When we discover the PHY is empty in sas_rediscover_dev(), the PHY
information (like negotiated linkrate) is not updated.

As such, for a user examining sysfs for that PHY, they would see
incorrect values:

root@(none)$ cd /sys/class/sas_phy/phy-0:0:20
root@(none)$ more negotiated_linkrate
3.0 Gbit
root@(none)$ echo 0 > enable
root@(none)$ more negotiated_linkrate
3.0 Gbit

So fix this, simply discover the PHY again, even though we know it's empty;
in the above example, this gives us:

root@(none)$ more negotiated_linkrate
Phy disabled

We must do this after unregistering the device associated with the PHY
(in sas_unregister_devs_sas_addr()).

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/libsas/sas_expander.c