android_kernel_oneplus_msm8998/drivers/scsi/libsas
John Garry a30e90a8eb 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>
2019-06-11 12:24:00 +02:00
..
Kconfig
Makefile
sas_ata.c
sas_discover.c
sas_dump.c
sas_dump.h
sas_event.c
sas_expander.c scsi: libsas: Do discovery on empty PHY to update PHY info 2019-06-11 12:24:00 +02:00
sas_host_smp.c
sas_init.c
sas_internal.h
sas_phy.c
sas_port.c
sas_scsi_host.c scsi: libsas: defer ata device eh commands to libata 2018-05-26 08:48:59 +02:00
sas_task.c